Commit graph

183429 commits

Author SHA1 Message Date
Sean Whitton 29058fcfe4 Avoid preprocessor conditionals for EWOULDBLOCK
* lib-src/emacsclient.c (connect_with_timeout)
(check_socket_timeout):
* src/process.c (would_block): Gnulib means EWOULDBLOCK is
always defined, so collapse "#ifdef EWOULDBLOCK" branches.
Suggested by Spencer Baugh <sbaugh@janestreet.com>.
2026-09-10 11:23:02 +01:00
Sean Whitton e6d158e945 Make emacsclient's --timeout apply to connect(2)
* lib-src/emacsclient.c (connect_with_timeout): New function.
(set_tcp_socket, connect_socket): Use it (bug#81777).
2026-09-10 11:23:02 +01:00
Jonas Bernoulli 5210b89cfa
Allow setting font-lock-keyword property using declare form
* doc/lispref/functions.texi (Declare Form): Document
'font-lock-keyword' meta property.
* etc/NEWS: Announce addition of 'font-lock-keyword' meta property.
* lisp/emacs-lisp/byte-run.el (byte-run--set-font-lock-keyword): New
function.
* (defun-declarations-alist): Add entry for 'font-lock-keyword', using
'byte-run--set-font-lock-keyword'.
* (with-no-warnings): Set 'font-lock-keyword' meta property.
2026-09-10 12:19:22 +02:00
Sean Whitton 67eb1ee26e ; Improve docs for query-replace-show-preview. 2026-09-10 10:57:43 +01:00
Eli Zaretskii eade0abc31 ; Fix doc strings in the last changeset
* lisp/replace.el (replace-preview--input)
(replace-preview-update): Doc fixes.
2026-09-10 08:00:40 +03:00
Rahul Martim Juliato a8736d5f88 Improve where the replacement is previewed (bug#81583)
* lisp/replace.el (replace-preview--input): New function.
(replace-preview-update): Add optional START and END, and
preview only the matches between them.
(replace-preview-setup): Accept a nil FROM, read from the
minibuffer along with the replacement, and add optional
BACKWARD.  Limit the preview to the part of the buffer that the
replacement will cover.
(query-replace-read-to): Add optional BACKWARD and pass it on.
(query-replace-read-args): Preview the replacement while reading
FROM as well, and preview nothing when the caller asks for no
highlighting.
* lisp/isearch.el (isearch-query-replace): Pass BACKWARD to
`query-replace-read-to'.
* test/lisp/replace-tests.el (replace-tests--preview): Add START
and END.
(replace-tests-preview-bounds, replace-tests-preview-input): New
tests.
* doc/emacs/search.texi (Replace): Document the above.
2026-09-09 20:54:04 +03:00
Rahul Martim Juliato 92acd66831 Use short symbols for query-replace-show-preview (bug#81583)
* lisp/replace.el (query-replace-show-preview): Accept the
symbols `replacement-only' and `both'.  Update the :type
accordingly, which also fixes the name of a function that does
not exist.
(query-replace-preview-match): Update the doc string.
(replace-preview-both, replace-preview-replacement-only): Say
which value of the option calls them.
(replace-preview--format): Dispatch on the new values, and still
call a function value.
(replace-preview-setup): Test the option for non-nil instead of
testing it with `functionp'.
* test/lisp/replace-tests.el (replace-tests--preview)
(replace-tests-preview-both, replace-tests-preview-cleanup)
(replace-tests-preview-disabled): Use the new values.
* doc/emacs/search.texi (Replace): Document the new values.
2026-09-09 20:53:55 +03:00
Eli Zaretskii 530271f5a0 ; Another fix for MinGW64 build
* src/w32.c: Include <sys/types.h> to avoid compilation error due
to a bug in MinGW64 pthreads_compat.h header.  (Bug#81826)
2026-09-09 20:00:13 +03:00
Toomas Rosin d5a885882b x_get_net_workarea: Fix indexing of _NET_WORKAREA (bug#81761)
* src/xfns.c (x_get_net_workarea): Fix indexing of _NET_WORKAREA
(bug#81761).

Copyright-paperwork-exempt: yes
2026-09-09 13:29:48 +01:00
Eli Zaretskii daae902164 Fix the MinGW64 UCRT64 build
* lib-src/ntlib.c: Include <sys/types.h> earlier, due to a bug in
MinGW64 pthreads_compat.h header.  (Bug#81826)
2026-09-09 15:02:57 +03:00
Jonas Bernoulli 0dde9b12a6
(lisp-imenu-generic-expression): Highlight define-button-type
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1):
Highlight `define-button-type' the same as `define-widget'.
* (lisp-imenu-generic-expression): Treat `define-button-type'
the same as `define-widget'.
2026-09-09 10:53:32 +02:00
Jonas Bernoulli 9ced94569d
(lisp--el-match-keyword): Use new font-lock-keyword symbol property
Add new `font-lock-keyword' symbol property, which does the opposite
of the existing `no-font-lock-keyword'; allowing to highlight certain
functions, like macros and special-forms, as opposed to allowing to
not highlight certain macros.

* lisp/emacs-lisp/lisp-mode.el (lisp--el-match-keyword): Use new
`font-lock-keyword'.
2026-09-09 10:53:30 +02:00
Sean Whitton cfc72c30b5 prepare-user-lisp: Don't skip symlinks to directories
* lisp/startup.el (prepare-user-lisp): Don't skip symlinks to
directories (bug#81810).
2026-09-09 09:47:54 +01:00
Spencer Baugh 8268065404 Check for killed buffer when leaving minibuffer (Bug#81828)
* src/minibuf.c (read_minibuf): Check if the old current buffer
was killed before trying to restore it when leaving the minibuffer.
2026-09-09 10:04:32 +02:00
Jared Finder bfdc20a1c4 New support for Ghostty terminal emulator
* lisp/faces.el (term-file-aliases): Alias xterm-ghostty to
ghostty.
* lisp/term/ghostty.el: New file.
2026-09-08 15:46:13 +01:00
Eli Zaretskii 63d2a70a42 ; * doc/emacs/maintaining.texi (Looking Up Identifiers): Minor addition. 2026-09-08 16:00:51 +03:00
Sean Whitton ed6366876c vc-dir--count-outgoing: Check overlay still exists
* lisp/vc/vc-dir.el (vc-dir--count-outgoing): Check overlay
still exists.
2026-09-08 11:16:20 +01:00
Aaron L. Zeng 0791a547c0 Prevent vc-set-async-update error in process sentinel
* lisp/vc/vc-dir.el (vc-dir-refresh): New OK-IF-ALREADY-RUNNING
argument.
(vc-dir): Use it so that we do not error if already refreshing
(bug#81798).
* lisp/vc/vc-dispatcher.el (vc-set-async-update): Use it such
that if VC-Dir is already refreshing, we restart the refresh.
2026-09-08 10:25:24 +01:00
Paul Eggert 45ee1b7266 Fix bug with canvas_apply_data and bignum data
* src/image.c (canvas_apply_data):
Don’t assume uint32_t fits into fixnum (Bug#81816).
2026-09-07 22:32:34 -07:00
Dmitry Gutov 7a1ba0b645 xref-make-etags-location: Add docstring
* lisp/progmodes/etags.el (xref-make-etags-location):
Add docstring.
2026-09-08 06:17:46 +03:00
Dmitry Gutov 38a6fd7cea ; Correct the binding in NEWS entry 2026-09-08 05:39:50 +03:00
Roi Martin e33b54d938 Rename outline-xref' command to outline-find-headings'
* etc/NEWS: Update entry.
* lisp/outline.el (outline-mode-prefix-map, outline-mode-menu-bar-map):
Use `outline-find-headings'.
(outline-find-headings--fetch-xrefs): Rename from
`outline-xref--fetch-headings'.
(outline-find-headings--show-xrefs): Rename from
`outline-xref--show-xrefs'.
(outline-find-headings): Rename from `outline-xref'.
* test/lisp/outline-tests.el
(outline-tests--outline-find-headings-search-function): Rename from
`outline-tests--outline-xref-search-function'.
(outline-tests--outline-find-headings-regexp): Rename from
`outline-tests--outline-xref-regexp'.
(outline-tests--outline-find-headings-undefined): Rename from
`outline-tests--outline-xref-undefined'.  (Bug#81592)
2026-09-08 05:36:42 +03:00
Stéphane Marks ae474d3864 c-ts-mode-indent-style support for setopt-local (bug#81151)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-style-setter):
Add BUFFER-LOCAL argument.  If setting globally, do not override
buffer locals.
(c-ts-mode--simple-indent-rules): Remove 'style' arg, use
`'-ts-mode-indent-style' instead.  Handle the case where
this style is a function.  Set 'treesit-simple-indent-rules'.
(c-ts-mode-set-style, c-ts-mode, c++-ts-mode): Adjust accordingly.
2026-09-07 18:07:50 -04:00
Paul Eggert 89100e9c71 Port emacs-module-tests to Solaris 10
* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object):
Also allow a function name "_DYNAMIC" (Bug#81471).
2026-09-07 14:12:35 -07:00
Stefan Monnier 6c54097767 test/lisp/simple-tests.el (simple-tests--undo): Avoid continuing undo
Make sure the first 'undo' is not treated as the continuation of
some previous undo.
2026-09-07 14:12:58 -04:00
Sean Whitton 619a395916 VC-Dir: Fix error on `n' before "./" has appeared
If you typed `n' before "./" had appeared, Emacs signalled a
wrong-type-argument error.  Now it signals a better one.

* lisp/vc/vc-dir.el (vc-dir--before-dotname-p): Return nil if
the "./" entry hasn't appeared yet.
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test-vc-dir-next/previous): Simulate the problem case.

* lisp/emacs-lisp/ewoc.el (ewoc-goto-next): Signal a user-error
instead of a plain error.  This makes sense for all the current
call sites.  (This is secondary to the bug fix above: this code
was never reached, previously.)
2026-09-07 14:14:01 +01:00
João Távora 0ed3fa830d Eglot: simplify and consolidade xref integration
Recently, xref gained the xref-find-by-kind API, and Eglot gained
support for that.  This commit restructures Eglot's side: any
non-definition LSP reference-like (generic references, declaration,
implementation, and typeDefinition) can now be requested for any
arbitrary symbol, even if point is not on that symbol (of course as long
as the server supports the 'workspace/symbol' method).

This historically hairy code is made somewhat simpler and should agree
with users' expectations of commands like C-u M-?.

However, there is still a wrinkle: some servers (clangd, ty, but not
rust-analyzer) need the document where the canonical definition site
lives to have been explicitly 'didOpen'ed by the client.  And we need
the canonical definition site to request references for an arbitrary
symbol, because LSP itself barely knows about "symbols", i.e. they are
not first-class entities.  LSP only knows document locations.

The previous approach by Dmitry Gutov's did the heroics: it visited the
URI transiently, just to place point on the definition and then request
the special kind of reference.  This worked, but (1) is only needed if
the URI isn't already visited (2) is somewhat hacky and risks things
like surpsising confirmation prompts and user hooks.

Perhaps this wrinkle can be addressed later with a lighter weight
version of a 'didOpen'-sending helper.  For now, we take the simpler
approach: craft the request directly from the information we got from
'workspace/symbol', even if that info points to unmanaged LSP documents.
If the server complains, so be it.  Users should at least be able to
read the message and visit the file themselves.

For reference, Clangd's behavior is seen a server bug, according to
https://discourse.llvm.org/t/clangd-explicit-and-implicit-doc-open/205/2
and https://github.com/microsoft/language-server-protocol/issues/861.

* lisp/progmodes/eglot.el (eglot--lsp-xrefs-for-id): New function.
(eglot--lsp-xrefs-for-method, eglot--lsp-xref-helper): Delete,
folding into eglot--lsp-xrefs-for-id.
(eglot--lsp-xref-refs): Delete variable.
(xref-backend-identifier-at-point): Return symbol at point.
(xref-backend-definitions, xref-backend-references)
(xref-backend-xrefs-by-kind): Use new helper.
(xref-backend-xref-kinds): Rewrite.
(eglot--deffinder): New helper
(eglot-find-declaration, eglot-find-implementation)
(eglot-find-typeDefinition): Rewrite using eglot--deffinder.
2026-09-07 12:36:37 +01:00
Eli Zaretskii f1288078ff ; Avoid compilation warning on MS-Windows
* src/image.c (image_bitmap_pixmap): Add back the required
type-cast.
2026-09-07 13:55:20 +03:00
Paul Eggert d418272f31 Port diff-mode-tests to POSIX diff
Do not assume that diff has the -a option, as POSIX does not
require it.  Problem found on Solaris 10 (bug#81480).
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock)
(diff-mode-test-font-lock-syntax-one-line)
(diff-mode-test-git-patch)
(diff-mode-test-git-patch/before-first-hunk)
(diff-mode-test-git-patch/signature):
Skip unless "diff -a" works.
2026-09-07 01:57:17 -07:00
Paul Eggert 962b0d07cd Update from Gnulib by running admin/merge-gnulib 2026-09-06 16:02:06 -07:00
Paul Eggert d56b7e6a7e Port grep-compute-defaults to Solaris grep
grep.el assumes support for grep -E, which is universal among
Emacs platforms except for Solaris /usr/bin/grep.  So, on Solaris
substitute a grep that supports -E, if available in one of the
standard Solaris locations.  In the usual case where one is
available, this fixes Bug#81483.
* lisp/progmodes/grep.el (grep-compute-defaults):
On Solaris, prefer /usr/sfw/bin/grep or /usr/xpg4/bin/grep to
plain grep if plain grep lacks support for -E.
2026-09-06 14:12:12 -07:00
Paul Eggert 0076b8df57 Port nsm-check-local-subnet-ipv4 test to Solaris 10
* test/lisp/net/nsm-tests.el (nsm-check-local-subnet-ipv4):
Don’t test the nsm-trust-local-network case when
network-interface-list reports no network interfaces.
On Solaris 10, network-interface-list always returns nil because
Solaris 10 lacks getifaddrs, and it’s not worth our trouble to
port network-interface-list to the hacky way this obsolescent OS
reports network interfaces (bug#81473).
2026-09-06 10:39:33 -07:00
Paul Eggert 8cfcc3cb00 Port tab-bar-tests to Solaris
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Test tty-type "linux" only on gnu/linux, as it may not exist
on other platforms, e.g., Solaris (bug#81477).
2026-09-06 10:19:10 -07:00
Dmitry Gutov 7904066fb7 ; Fix a typo 2026-09-06 15:45:04 +03:00
Eli Zaretskii 6e9fd53cca ; Fix last change in latexenc.el
* lisp/international/latexenc.el
(latexenc-find-file-coding-system): Fix last change.
2026-09-06 13:28:59 +03:00
Eli Zaretskii a947231851 Port gcc-tests to Solaris 10’s GCC 3.4.3
Problem reported by Paul Eggert (Bug#81484).
* test/lisp/cedet/semantic/bovine/gcc-tests.el (semantic-gcc-test):
Do not assume GCC is version 4 or later.
(semantic-gcc-test/1, semantic-gcc-test/6): Update GCC version number.
* test/src/regex-emacs-tests.el (regex-tests-generic-line):
Read the test file in utf-8-unix.
2026-09-05 14:46:22 -07:00
Jim Porter 6b53a6f9e4 Use completion boundaries in 'pcomplete-long-option-completion-table'
This indicates that the current completion field is complete when the
string is, e.g. "--option=".  The option value is a subsequent field and
is handled by other parts of Pcomplete (bug#81792).

* lisp/pcomplete.el (pcomplete-long-option-completion-table): Set
boundary for completed options that take values.

* test/lisp/pcomplete-tests.el (pcomplete-shell-completion): Convert to
macro and accept BODY arguments.
(pcomplete-test-long-options/with-value/multiple)
(pcomplete-test-long-options/without-value/multiple): New tests.
2026-09-05 13:37:51 -07:00
Stefan Monnier 194587e0ef lisp-mode.el: Fix lack of handling of shorthands in font-lock
* lisp/emacs-lisp/lisp-mode.el (lisp--el-match-keyword)
(lisp-string-in-doc-position-p): Obey shorthands (bug#80574).
2026-09-05 14:38:22 -04:00
Sean Whitton 1d836d5c59 ; * lisp/startup.el (prepare-user-lisp): Fix last change. 2026-09-05 13:34:22 +01:00
Sean Whitton bdf6d6c1b1 Autoload cookies for some commands in admin/*.el
These files are not included in Emacs distributions so this will
only affect those who, e.g., symlink these into ~/.emacs.d/user-lisp/.

* admin/admin.el:
* admin/authors.el: Autoload all commands.
* admin/gitmerge.el (gitmerge): Autoload.
2026-09-05 13:05:12 +01:00
Sean Whitton 7013cc3f13 prepare-user-lisp: Ignore dangling symlinks
* lisp/startup.el (prepare-user-lisp): Ignore dangling symlinks.
Restructure to reduce number of system calls made for everything
except dangling symlinks.
2026-09-05 12:58:53 +01:00
Eli Zaretskii 38e69f8b27 ; Update ldefs-boot.el. 2026-09-05 07:07:38 -04:00
Eli Zaretskii 251827829d Merge from origin/emacs-31
cf1d8f9bc9 ; Improve documentation of deletion of composed characters
2890334e70 Improve Tramp manual
56f3336189 'speedbar-window' now run 'speedbar-before-delete-hook' (...
62b891880c ; * lisp/simple.el (next-error-follow-minor-mode): Copyedit.
49c6767723 ; newcomers-presets: Mention using copy-theme-options.
c709b66dcb flymake-show-buffer-diagnostics: Fix interactive form
2026-09-05 07:04:40 -04:00
Eli Zaretskii 62c9725bae Fix mojibake in visiting LaTeX files
* lisp/international/latexenc.el
(latexenc-find-file-coding-system): Decode the main file's name,
since at this point the buffer is still unibyte and undecoded.
(Bug#81606)
2026-09-05 13:41:08 +03:00
Eli Zaretskii cf1d8f9bc9 ; Improve documentation of deletion of composed characters
* doc/emacs/basic.texi (Erasing): Document
'composition-break-at-point' (bug#81790).
2026-09-05 13:21:55 +03:00
Michael Albinus 2890334e70 Improve Tramp manual
* doc/misc/tramp.texi (Multi-hops, File name syntax): Use "localname".
(Home directories): Discuss missing remote home directory.  (Bug#81799)
2026-09-05 12:16:45 +02:00
Stephen Berman cd6bbb7ac2 Prevent Dired marking in hidden subdirs (bug#81612)
* lisp/dired.el (dired-mark-files-in-region, dired-mark): Don't
mark or flag for deletion if entry is in hidden (sub)dir.
2026-09-05 11:39:13 +02:00
Vincenzo Pupillo 56f3336189 'speedbar-window' now run 'speedbar-before-delete-hook' (bug#81708).
* lisp/speedbar.el (speedbar-window-mode): Fix documentation.  Run
the 'speedbar-before-delete-hook'.
2026-09-05 11:44:20 +03:00
Andreas Schwab 2e5e9d48fb gnus-icalendar: use DURATION to calculate end-time of the event
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-ical):
Use DURATION to calculate end-time if DTEND is absent.
2026-09-04 22:10:44 +02:00
Sean Whitton 62b891880c ; * lisp/simple.el (next-error-follow-minor-mode): Copyedit. 2026-09-04 17:12:45 +01:00