Commit Graph

181895 Commits

Author SHA1 Message Date
Paul Eggert
eda9a819ce Append newline to server -error commands
Problem reported by Zhengyi Fu (bug#80844).
* lisp/server.el (server--process-filter-1, server-return-error)
(server-edit-abort): Append newline to -error commands, too.
Otherwise emacsclient has no reliable way to find the end of the
error command’s argument, except to wait for EOF which is
undesirable since the Emacs server keeps the socket open
for a while, waiting for emacsclient to exit.
2026-04-16 23:33:35 -07:00
Yuan Fu
35a8e7e068 Make sure range (1, 1) doesn't capture anything (bug#80798)
* src/treesit.c (Ftreesit_query_capture): Return Qnil if
querying (1, 1).
2026-04-16 23:23:25 -07:00
Yuan Fu
5ea181a75e Accept marker as position in treesit.c functions (bug#80830)
* src/treesit.c (treesit_check_positive_integer): Remove.
(treesit_check_position):
(Ftreesit_node_first_child_for_pos):
(Ftreesit_node_descendant_for_range):
(Ftreesit_query_capture):
(Ftreesit__linecol_at): Use fix_position.

* test/src/treesit-tests.el:
(treesit-query-marker-position): Test.
2026-04-16 23:23:12 -07:00
João Távora
cbbe2b5f55 Eglot: add M-x eglot-describe-connection
Also add more bindings to M-x eglot-list-connections

* lisp/progmodes/eglot.el (eglot-list-connections-mode-map): Add
bindings for e, w, RET.
(eglot-events-buffer-of-listed-connection)
(eglot-show-workspace-configuration-of-listed-connection)
(eglot-describe-listed-connection): New commands.
(eglot-describe-connection): New command.

* doc/misc/eglot.texi: Document new keys and eglot-describe-connection.

* etc/EGLOT-NEWS: Announce.
2026-04-17 00:19:51 +01:00
Sean Whitton
f6bb77270f vc-file-tree-walk: Stop emitting messages
* lisp/vc/vc.el (vc-file-tree-walk, vc-file-tree-walk-internal):
Stop emitting messages about traversing directories.
2026-04-16 16:50:32 -04:00
Sean Whitton
2259c116ae vc-file-tree-walk-internal: Use vc-registered
* lisp/vc/vc.el (vc-file-tree-walk-internal): Use vc-registered
not vc-backend, for robustness.
2026-04-16 16:49:56 -04:00
Sean Whitton
c93a6bd5d8 ; Fix formatting. 2026-04-16 16:10:02 -04:00
Sean Whitton
75fd526980 ; Fix last change. 2026-04-16 16:08:36 -04:00
Sean Whitton
792fef0583 vc-rename-file: Fix skipping calling into the backend
* lisp/vc/vc.el (vc-rename-file): Replace broken attempted use
of vc-dir-status-files with walking OLD using vc-file-tree-walk.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-directory):
Assert that the files are registered or not as appropriate.  New
test case in which there are only registered files.
2026-04-16 14:36:45 -04:00
João Távora
f146bfe3e7 Jsonrpc: simplify previous change
* lisp/jsonrpc.el (jsonrpc--save-excursion-maybe): Delete.
(jsonrpc--forwarding-buffer, jsonrpc--log-event): Use simple
save-excursion.
2026-04-16 18:46:39 +01:00
João Távora
ce06e8cdef Eglot: adjust previous change to eglot-uri-to-path
* lisp/progmodes/eglot.el (eglot-uri-to-path): Tweak.
2026-04-16 18:20:23 +01:00
Juri Linkov
d88e73d047 Update 'crm-complete-and-exit' from 'minibuffer-complete-and-exit'
* lisp/emacs-lisp/crm.el (crm-complete-and-exit):
Add new arg 'no-exit'.  Call 'minibuffer-choose-completion'
when 'completion--selected-candidate' returns non-nil (bug#80821).
2026-04-16 20:12:03 +03:00
Stefan Monnier
126eab79b0 src/syntax.c (update_syntax_table): Remove redundant assignment 2026-04-16 11:39:26 -04:00
Michael Albinus
1811ce52c2 ; * etc/NEWS: Presentational fixes and improvements. 2026-04-16 17:31:07 +02:00
Vincent Belaïche
3d822669ee Announce ert-play-keys in etc/NEWS. 2026-04-16 17:09:04 +02:00
Sean Whitton
ae822de38d ; newcomers-presets: FIXME. 2026-04-16 09:22:06 -04:00
Michael Albinus
ed98d9f81f ; * doc/misc/ert.texi: Fix typos. 2026-04-16 14:50:28 +02:00
Vincent Belaïche
5b6fc8ebfc ert-play-keys function
* lisp/emacs-lisp/ert-x.el (ert-play-keys): new defun.

* test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo)
(undo-test-point-after-forward-kill): Use new function
`ert-play-keys' and `(ert-with-test-buffer (:selected t) ...)'
rather (with-temp-buffer (switch-to-buffer (current-buffer) ...)'.

* test/lisp/erc/erc-scenarios-spelling.el
(erc-scenarios-spelling--auto-correct): Use new function
`ert-play-keys' and `(ert-with-buffer-selected ...)' rather than
`execute-kbd-macro' and `(with-current-buffer
... (set-window-buffer nil (current-buffer) ...)'.

* doc/misc/ert.texi (Helper Functions): Document ert-play-keys,
and differences between ert-simulate-command, ert-simulate-keys
& ert-play-keys.

* test/lisp/emacs-lisp/ert-x-tests.el
(ert-x-tests-play-keys)
(ert-x-tests-simulate-command, ert-x-tests-simulate-keys): New
tests.
2026-04-16 13:30:42 +02:00
João Távora
1c4c9d759a Eglot: add shutdown/reconnect bindings to eglot-list-connections buffer
* lisp/progmodes/eglot.el (eglot-list-connections-mode-map): New
defvar.

* lisp/progmodes/eglot.el (eglot--list-connections-entries): New
function, extracted from eglot-list-connections.

* lisp/progmodes/eglot.el (eglot--list-connections-cmd): New macro.

* lisp/progmodes/eglot.el (eglot-shutdown-listed-connection)
(eglot-reconnect-listed-connection): New commands.

* lisp/progmodes/eglot.el (eglot-list-connections): Use
eglot--list-connections-entries.

* doc/misc/eglot.texi: Document eglot-list-connections and new keys.

* etc/EGLOT-NEWS: Announce.
2026-04-16 09:28:21 +01:00
João Távora
d7c9676ec8 Jsonrpc: don't suddenly jump point in events buffer
* lisp/jsonrpc.el (jsonrpc--save-excursion-maybe): New macro.

* lisp/jsonrpc.el (jsonrpc--log-event, jsonrpc--forwarding-buffer):
Use it.
2026-04-16 08:41:38 +01:00
João Távora
213b8e0b97 Eglot: un-canonicalize server URIs to project's root
Some LSP servers prefer to canonicalize all document URIs to
their "true name", chasing all fs symbolic links.  If the user
is visiting a project under a symlink, say ~/myprojects/foo
which points to /data/true/projects/foo.  When visiting a
~/myprojects/foo/f.c and trying to jump to a nearby file f.h via
LSP 'xref-find-definitions', the path should probably be
~/myproject/foo/f.h, not /data/true/projects/foo/f.h.

Even though Emacs can recognize that the two files are the same,
'buffer-file-name' is not.  This confuses tools like C-x C-f,
ibuffer, and ultimately the users themselves who probably
oblivious to the true place of the project.  After all they
started Eglot under a syminked file.

* lisp/progmodes/eglot.el (eglot-lsp-server): Add trueroot slot.
(eglot-uri-to-path): Rework to consider trueroot and project root.
2026-04-16 08:05:13 +01:00
Eli Zaretskii
abcd0d3c8d ; * lisp/isearch.el (isearch-occur): Doc fix. (Bug#80785) 2026-04-16 08:26:33 +03:00
Toby Dylan Hocking
eb4835e521 Make | optional for 'gnu' regexp in compilation-mode (bug#80681)
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Make leading '|'
optional when there are leading spaces (bug#80681).
* etc/compilation.txt (GNU style): New error with two leading
spaces.
* test/lisp/progmodes/compile-tests.el
(compile-test-error-regexps): Increment expected
compilation-num-errors-found.
(compile-tests--test-regexps-data): New error test case for
'gnu' with two leading spaces.  Change expected match for
'cucumber' to match again 'gnu'.

Copyright-paperwork-exempt: yes
2026-04-15 18:11:00 -04:00
Sean Whitton
5045394694 vc-rename-file: Fix case of directory with only untracked files
* lisp/vc/vc.el (vc-rename-file): Don't call into the backend if
moving a directory containing only untracked files.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-directory):
New test for this case.
2026-04-15 17:59:10 -04:00
Sean Whitton
324e5b4177 ; * test/lisp/vc/vc-tests/vc-tests.el: Disable new tests on RCS. 2026-04-15 13:53:58 -04:00
Juri Linkov
4ad8bd9b48 Handle the symbol property 'isearch-exit' in 'isearch-occur' (bug#80785)
* lisp/isearch.el (isearch-occur): When the command has
a non-nil symbol property 'isearch-exit', exit the search
before running the command.
2026-04-15 20:40:23 +03:00
Sean Whitton
43f0da207e Fix renaming whole directories with Mercurial
* lisp/vc/vc-hg.el (vc-hg-rename-file): Use 'hg mv --after'.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-directory):
New test.
2026-04-15 10:06:48 -04:00
Sean Whitton
0ea1c0d831 ; * lisp/vc/vc.el (vc-rename-file): Delete old FIXME. 2026-04-15 10:06:20 -04:00
Sean Whitton
5347b221da vc-rename-file: New OK-IF-ALREADY-EXISTS parameter
* lisp/vc/vc.el (vc-delete-file): New NOCONFIRM parameter.
(vc-rename-file): New OK-IF-ALREADY-EXISTS parameter.
* lisp/dired-aux.el (dired-rename-file): Pass it.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file): Test
it.  Also test moving files into an existing directory.
2026-04-15 10:06:20 -04:00
Sean Whitton
8b823737ff ; vc-test--working-revision: Update for vc-hg change
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--working-revision):
Recognize '0000000000000000000000000000000000000000' now that
vc-hg-working-revision returns changeset hashes.
2026-04-15 10:02:16 -04:00
Juri Linkov
0384600a21 New faces 'tab-line-active' and 'tab-line-inactive' (bug#80742)
This is intended to parallel the 'mode-line-active/inactive'
and 'header-line-active/inactive' distinction.

* doc/emacs/display.texi (Standard Faces): Document the new faces.

* lisp/faces.el (tab-line-active, tab-line-inactive): Add new faces.

* lisp/tab-line.el (tab-line-faces): Add new faces
to MEMBERS arg of 'defgroup'.
(tab-line-auto-hscroll): Use one of the faces
depending on 'mode-line-window-selected-p'.

* src/dispextern.h (CURRENT_TAB_LINE_ACTIVE_FACE_ID_3)
(CURRENT_TAB_LINE_ACTIVE_FACE_ID): New macros
based on header-line equivalents.
(CURRENT_TAB_LINE_HEIGHT): Use CURRENT_TAB_LINE_ACTIVE_FACE_ID.
(face_id): Use TAB_LINE_ACTIVE_FACE_ID and
TAB_LINE_INACTIVE_FACE_ID instead of TAB_LINE_FACE_ID.

* src/xdisp.c (window_box_height, pos_visible_p, init_iterator)
(window_text_pixel_size, display_mode_lines, display_mode_line)
(format-mode-line): Replace all uses of TAB_LINE_FACE_ID with
either a new macro or the new face IDs.

* src/xfaces.c (lookup_basic_face, realize_basic_faces):
Map new face IDs to their lisp symbols.
(syms_of_xfaces): New lisp symbols.
2026-04-14 20:14:15 +03:00
Eli Zaretskii
a1899d8cb1 ; Improve documentation of map.el methods
* lisp/emacs-lisp/map.el (map-elt, map-delete, map-values)
(map-length, map-copy, map-do, map-values-apply, map-empty-p)
(map-contains-key, map-into, map-insert, map-apply): Doc fixes.
(Bug#80804)
2026-04-14 19:41:23 +03:00
Eli Zaretskii
dcbfa53e4b ; * src/conf_post.h: Another tweak of conditionals for MinGW64. 2026-04-14 17:48:59 +03:00
Eli Zaretskii
be18635ef0 ; * doc/emacs/fixit.texi (Transpose): Improve text and indexing. 2026-04-14 17:34:24 +03:00
Eli Zaretskii
5e34dba5b8 ; And one more attempt to fix MinGW64 build
* src/conf_post.h [WINDOWSNT]: Use "#if !FOO" because HAVE_DECL_*
are defined to zero.
2026-04-14 16:02:42 +03:00
Eli Zaretskii
6bda6e2123 ; Another attempt to fix the MinGW64 build
* src/conf_post.h [WINDOWSNT]: Add prototype for 'getline'.
2026-04-14 15:32:11 +03:00
Eli Zaretskii
601c099d1d ; Fix MinGW64 build due to missing 'getdelim' prototype
* src/conf_post.h [WINDOWSNT]: Add prototype for 'getdelim'.
Reported by Angelo Graziosi <angelo.g0@libero.it>.
2026-04-14 14:18:49 +03:00
Stefan Monnier
a2b78854b0 (loaddefs-generate--make-autoload): Avoid %s on compound values
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Avoid `%s` on compound values.
2026-04-13 17:02:27 -04:00
Stefan Monnier
6942d508f0 SETUP_SYNTAX_TABLE: syntax-propertize more lazily (bug#80600)
Many regexps do not pay attention to syntax tables at all
because they don't use things like \s, \b, \<, or \_<.
So delay the actual initialization of the machinery for
`syntax-table` properties (especially the call to `syntax-propertize`)
until the first time we actually need to consult the syntax of
a character.

* src/syntax.c (uninitialized_interval): New constant.
(RE_SETUP_SYNTAX_TABLE_FOR_OBJECT, SETUP_SYNTAX_TABLE):
Set `forw/backward_i` to that new constant to indicate they haven't
actually be initialized yet.
Set `start` and `stop` fields right away, instead of delegating it to
`update_syntax_table`, so that `e_property` and `b_property`
can be set independently.
(update_syntax_table): Remove the `init` argument.  Instead, discover
the need for initialization based on the fact that `forw/backward_i`
are uninitialized.  Presume `start` and `stop` fields have been
set already.
(parse_sexp_propertize): Update call accordingly.
(update_syntax_table_forward): Remove the `init` argument.

* src/syntax.h (update_syntax_table, update_syntax_table_forward):
Remove the `init` argument.
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD):
Update calls accordingly.
2026-04-13 16:45:27 -04:00
Stephen Berman
6b479f201c ; Another fix for recent 'dired-readin-insert' change
* lisp/dired.el (dired-readin-insert): Restore point after
searching for Dired buffer entry of 'ls' error file (bug#80499).
2026-04-13 20:21:13 +02:00
Stefan Monnier
5caab891b4 lisp/international/mule.el (auto-coding-alist): Fix name (bug#80818) 2026-04-13 10:40:11 -04:00
Eli Zaretskii
5d0efe0a5a Fix hangs on MS-Windows when deleting a pipe process
* src/w32.c (sys_close): Don't close a descriptor from which the
reader thread is reading, to avoid hanging Emacs.  (Bug#80770)
2026-04-13 17:06:46 +03:00
Eli Zaretskii
cde6878f9d Fix MinGW64 build broken by changes in emacsclient.c
* nt/gnulib-cfg.mk (getdelim, getline): Do not omit.  It is now
needed for 'emacsclient', but MinGW64 doesn't have it in its runtime
libraries (mingw.org's MinGW does have it).  (Bug#80770)
2026-04-13 16:31:16 +03:00
Sean Whitton
5a5801fc24 ; * lisp/vc/vc.el: Note about different file name kinds (bug#80722). 2026-04-13 09:24:44 -04:00
Eli Zaretskii
71fce9fe2b Revert "; Fix node names in modus-themes.org"
This reverts commit d4002877d3.
It is no longer needed with the latest Org v9.8.2.
2026-04-13 13:48:22 +03:00
Eli Zaretskii
873da49988 Revert "; Fix last change."
This reverts commit 670bb34d91.
It is no longer needed with the latest Org 9.8.2.
2026-04-13 13:47:24 +03:00
Paul Eggert
7d07690e5d emacsclient receiving long-line fixes
Do not mishandle long lines, or lines containing NUL,
when receiving data.
* lib-src/emacsclient.c (check_socket_timeout, main):
Use ssize_t for return values from recv,
since in theory the value could exceed INT_MAX now.
(main): Do not use a fixed-size buffer for receiving data;
instead, grow the buffer as needed (admittedly unlikely).
When a partial line is received via recv, do not discard its data;
instead, keep reading, possibly with a grown buffer.
Do not ignore received data after a null byte is received.
Add a comment about when received data is ignored due to a goto.
2026-04-12 23:21:02 -07:00
Paul Eggert
46c08d8574 emacsclient send_buffer size--
* lib-src/emacsclient.c (send_to_emacs_len):
No need to add 1 to SEND_BUFFER_SIZE.
2026-04-12 23:21:02 -07:00
Paul Eggert
180953c8f6 emacsclient config+sending long-line fixes
Do not mishandle long lines, or lines containing NUL,
when getting configuration or sending data.
* lib-src/emacsclient.c (send_to_emacs_len, quote_argument_len):
New functions, generalizing the old send_to_emacs and quote_argument.
Rewrite the old functions to use the new ones.
(get_server_config): Do not mishandle long lines in the config file.
(set_tcp_socket): No longer a need to null-terminate auth string.
(main): Do not mishandle long lines from stdin, or lines with NUL.
2026-04-12 23:21:02 -07:00
Kyle Meyer
ca33663e50 Update to Org 9.8.2 2026-04-12 16:44:03 -04:00