1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-19 04:21:45 -07:00
Commit graph

179866 commits

Author SHA1 Message Date
Spencer Baugh
bea16dfe69 Respect keymaps in buffer text for clicks on displayed strings
When clicking on a string displayed by a display property, also
look at the text properties of the underlying buffer text for
keymaps, not just the displayed string.  The displayed string
takes precedence over the buffer text, but it doesn't replace
it.

Also, we should use the buffer's local map even for clicks on
the mode line.  (Otherwise, what's the point of the <mode-line>
event?)

* src/keymap.c (Fcurrent_active_maps): Consider displayed
string, then buffer text, then fall back to local
map.  (Bug#79505)

* test/src/keymap-tests.el
(keymap-test-keymaps-for-non-buffer-positions): Add more tests.
2025-10-18 12:48:41 +03:00
Augusto Stoffel
59da5020da Fix an error when bookmark handler is a lambda
* lisp/bookmark.el (bookmark-type-from-full-record): Ensure
handler is a symbol before calling 'symbol-function'.
(Bug#79618)
2025-10-18 12:35:29 +03:00
Eli Zaretskii
0d8a31423a ; Fix documentation of a recent commit
* src/window.c (Fcombine_windows, Funcombine_window): Doc fixes.

* doc/lispref/windows.texi (Recombining Windows): Fix markup and
wording.
2025-10-18 12:26:28 +03:00
Eli Zaretskii
a779f7e01b Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-10-18 12:14:23 +03:00
Eli Zaretskii
30bb6770f4 ; * etc/NEWS: Document last change (bug#79597). 2025-10-18 12:13:49 +03:00
Lin Sun
1eeadd1f14 Remove directory of deleted package from `load-path'
* lisp/emacs-lisp/package.el (package--delete-directory): Remove
the directory of the to-be-deleted package `load-path'.  Doc
fix.  (Bug#79597)
2025-10-18 12:10:58 +03:00
Martin Rudalics
ef2b032567 Add functions 'combine-windows' and 'uncombine-window'
* src/window.c (make_parent_window, Fcombine_windows)
(Funcombine_window): New functions.
(Fsplit_window_internal): Use make_parent_window.
* doc/lispref/windows.texi (Recombining Windows): Describe new
functions 'combine-windows' and 'uncombine-window'.
(Window Configurations): Explain "window clones".
* etc/NEWS: Mention new functions 'combine-windows' and
'uncombine-window'.
2025-10-18 10:33:10 +02:00
john muhl
81bc83c1a5 New 'lua-mode' inferior process command & options
* lisp/progmodes/lua-mode.el (lua-process-buffer-name)
(lua-process-history-file, lua-process-startfile): New options.
(lua-start-process): Use new options.
(lua-send-file): New command.
(lua--repl-buffer-p): Remove unused internal variable.  (Bug#79573)
2025-10-18 11:22:43 +03:00
Stefan Monnier
ce7f2b93bb lisp/emacs-lisp/rx.el (<pcase> rx): Workaround for bug#79634 2025-10-17 15:53:18 -04:00
Przemysław Alexander Kamiński
7de5a6d1f7 Release NS objects (bug#79023)
* src/nsterm.m (ns_free_frame_resources): Release the NSView.
([EmacsView dealloc]): Release the EmacsLayer and menu.
([EmacsWindow dealloc]): Fix the toolbar release.

Co-authored-by: Rudolf Adamkovič <rudolf@adamkovic.org>
2025-10-17 19:53:38 +01:00
Sean Whitton
ba8752cae9 Replace recent fix for vc-auto-revert-mode autoload problem
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Wrap references to MODE-variable in bound-and-true-p.
* lisp/vc/vc-hooks.el (auto-revert-mode): Restore to compilation
declaration only.
2025-10-17 15:06:11 +01:00
Eli Zaretskii
d587ce8c65 Support Tree-sitter version 0.26 and later
* src/treesit.c (init_treesit_functions)
[TREE_SITTER_LANGUAGE_VERSION >= 15]: Define prototype for, and
load 'ts_language_abi_version' instead of the deprecated (and
removed in tree-sitter 0.26) 'ts_language_version'.
(ts_language_abi_version) [TREE_SITTER_LANGUAGE_VERSION >= 15]:
Define on WINDOWSNT, instead of 'ts_language_version'.
(treesit_language_abi_version): New compatibility function.
(treesit_load_language, Ftreesit_language_abi_version): Use
'treesit_language_abi_version' instead of 'ts_language_version'.
(Bug#79627)
2025-10-17 14:15:41 +03:00
Eli Zaretskii
bd0a141d09 ; * doc/lispref/windows.texi (Window Hooks): Fix markup. 2025-10-17 13:41:15 +03:00
Martin Rudalics
3fd24aee7e Clarify buffer-local behavior of 'window-buffer-change-functions'
* doc/lispref/windows.texi (Window Hooks): Explain how to
discern calls for 'window-buffer-change-functions' where a
buffer was removed from the window from those where a buffer is
now shown in that window.
2025-10-17 10:24:53 +02:00
Helmut Eller
3e78f6487d Add some tests for weak hashtables
Also add ft- as shorthand for fns-tests-.

* test/src/fns-tests.el (ft-hash-table-weakness, ft-weak-key-removal)
(ft-weak-value-removal, ft-weak-and-removal, ft-weak-or-removal): New
tests.
(ft--test-weak-removal, ft--gc, ft--check-entries, ft--check-entry)
(ft--hash-table-entries, ft--populate-hashtable, ft--component-num)
(ft--parse-component, ft--dead-component, ft--format-component)
(ft--init-rng, ft--nentries): New helpers.
2025-10-17 10:06:16 +02:00
Stephen Gildea
90ec5ef01b Manual pages: use a showcase time-stamp-pattern
* doc/man/ebrowse.1:
* doc/man/emacs.1.in:
* doc/man/emacsclient.1:
* doc/man/etags.1:  Loosen the time-stamp-pattern used so that
it is not specific to each file.  These files now provide
readable examples that will work with most man pages.
2025-10-16 17:29:01 -07:00
Stephen Gildea
d208502e4c time-stamp: padding composed characters
* lisp/time-stamp.el (time-stamp-string-preprocess): Use
'string-width' instead of 'length' to calculate needed padding.

Thanks to Stefan Monnier for the suggestion.
2025-10-16 15:23:48 -07:00
Eshel Yaron
888a910bc9
; elisp-scope.el: Standardize copyright notice.
Suggested by Arash Esbati <arash@gnu.org>.
2025-10-16 19:21:09 +02:00
Spencer Baugh
17ac50ea9e Return case common to all completions in try-completion
When completion-ignore-case is non-nil, if all completions share
a common prefix ignoring case, try-completion has always
returned that.  Now, if all completions also share a common
prefix including case, try-completion includes that common
prefix in its return value (bug#79377).

* lisp/minibuffer.el (completion-pcm--merge-completions): Always
use return value from try-completion, which may change case.
* src/minibuf.c (Ftry_completion): Return the common prefix
which changes case.
* test/lisp/minibuffer-tests.el (completion-pcm-bug4219)
(completion-substring-test-5): New tests.
2025-10-16 20:18:23 +03:00
Juri Linkov
b0078bfa15 Improve color contrast of refine-related diff faces on dark backgrounds
* lisp/vc/diff-mode.el (diff-refine-removed, diff-refine-added):
* lisp/vc/ediff-init.el (ediff-fine-diff-A, ediff-fine-diff-B):
* lisp/vc/smerge-mode.el (smerge-refined-removed, smerge-refined-added):
Lower the dominant component of RGB colors from "aa" to "88" (bug#79633).
2025-10-16 20:05:41 +03:00
Juri Linkov
bbbad93498 * lisp/treesit.el: Small fixes in navigation functions.
(treesit-up-list): Better handle multi-language buffers.
(treesit-hs-find-next-block): Fix off-by-one error.
2025-10-16 19:40:21 +03:00
Sean Whitton
208241aa83 Update VC-Dir contents upon revert-buffer
* lisp/vc/vc-hooks.el (vc-after-revert): New function.
(after-revert-hook): Add it.
2025-10-16 17:19:43 +01:00
Sean Whitton
d0d6e5ce65 vc-auto-revert-mode: Fix an autoload problem
* lisp/vc/vc-hooks.el (auto-revert-mode): Replace compiler
declaration for this variable with a full defvar-local.
2025-10-16 16:56:47 +01:00
Sean Whitton
f36ed942b1 autorevert: Use defvar-local for the -mode variables
* lisp/autorevert.el (auto-revert-mode, auto-revert-tail-mode):
Use defvar-local not defvar.  New comment explaining why these
duplicate definitions of the variables are present.
2025-10-16 16:56:00 +01:00
Martin Rudalics
8aeb4f82d9 ; * lisp/minibuffer.el (minibuffer--nonselected-check): Fix typos. 2025-10-16 10:17:29 +02:00
Martin Rudalics
85a9189dbb In 'minibuffer--nonselected-check' consult 'completion-reference-buffer'
* lisp/minibuffer.el (minibuffer--nonselected-check): Don't
highlight when the selected window's buffer has
'completion-reference-buffer' set.
2025-10-16 09:59:15 +02:00
Juri Linkov
0a4503de3a Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms
* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/elixir-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/heex-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/lua-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/rust-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/markdown-ts-mode.el:
* lisp/textmodes/mhtml-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el: In autoload forms replace
'(treesit-available-p)' with (boundp 'treesit-major-mode-remap-alist).
Calling 'treesit-available-p' in loaddefs.el is too early
since the tree-sitter library might not be loaded yet.
Checking if 'treesit-major-mode-remap-alist' is bound is
equivalent to checking if Emacs is compiled with tree-sitter support.
(bug#79622)
2025-10-16 09:45:30 +03:00
Stephen Gildea
88c18efb3a time-stamp: padding with mixed uni- and multibyte
* lisp/time-stamp.el (time-stamp-string-preprocess): Use
'length' instead of 'format' to calculate string padding,
so that we consistently count characters, not bytes.
2025-10-15 20:44:47 -07:00
Stefan Monnier
39d711696a (remote-shell-program): Simplify
* lisp/files.el (remote-shell-program): Don't bother looking
for the full file name of the `ssh` executable, since all users
end up looking it up in `load-path` anyway.
2025-10-15 16:30:59 -04:00
Eshel Yaron
cb4d9efbd4
; elisp-scope.el: Rename some private symbols as such
Also add a few missing docstrings.

* lisp/emacs-lisp/elisp-scope.el (elisp-scope-symbol-role-p)
(elisp-scope-read-symbol-role, elisp-scope-special-variables)
(elisp-scope-let, elisp-scope-let*): Add docstring.
(elisp-scope-counter, elisp-scope-callback)
(elisp-scope-current-let-alist-form, elisp-scope-local-new)
(elisp-scope-sym-pos, elisp-scope-sym-bare)
(elisp-scope-report, elisp-scope-special-variable-p)
(elisp-scope-let-1, elisp-scope-variable)
(elisp-scope-binding, elisp-scope-symbol): Rename, replace
'elisp-scope-' prefix with 'elisp-scope--' to indicate that
these are private.  Update all references.
2025-10-15 21:41:22 +02:00
Stefan Monnier
f37a150a5f doc/emacs/display.texi (Semantic Font Lock): Simplify 2025-10-15 15:21:06 -04:00
Stefan Monnier
b25d9d2081 (easy-mmode--less-selective-first): Uncomment the test
* test/lisp/emacs-lisp/easy-mmode-tests.el (easy-mmode--less-selective-first):
Mark it as failing, instead.
2025-10-15 14:36:04 -04:00
Juri Linkov
eb9a93b221 * lisp/minibuffer.el: Fix recent change of scrolling truncated completions
(completion--lazy-insert-strings-on-scroll): Don't move to the last
completion candidate since this is what happens when scrolling without
truncated completions buffer (bug#79506).
2025-10-15 20:14:43 +03:00
Juri Linkov
c4490084fc ; * lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Improve docstrings.
Add mentions of `treesit-enabled-modes' to the docstrings (bug#79627).
2025-10-15 19:08:48 +03:00
Sean Whitton
6cb7fa36ad New tests for multiple globalized minor modes
* test/lisp/emacs-lisp/easy-mmode-tests.el
(easy-mmode-test-mode): Mark permanent-local.
(easy-mmode--test-two-globalized-modes): New function.
(easy-mmode--more-selective-first)
(easy-mmode--less-selective-first): New tests.
2025-10-15 16:20:46 +01:00
Stefan Monnier
11b7cd7ebe (xdg-mime-apps): Restore corner case and simplify
* lisp/xdg.el (xdg-mime-apps): Return nil if that's what the table
holds, like we did before commit f60fc1287d.
Consolidate the three (assoc type xdg-mime-table) and shrink the
scope of `files`.
2025-10-15 09:31:05 -04:00
Eshel Yaron
eeaa942147
; Refine a few 'elisp-*' faces for dark backgrounds
* lisp/progmodes/elisp-mode.el (elisp-major-mode-name)
(elisp-symbol-role, elisp-symbol-role-definition, elisp-rx):
Use a lighter foreground color when background color is dark
to improve legibility.
2025-10-15 12:24:59 +02:00
Michael Albinus
53fa2b7218 Add support for su-rs and sudo-rs programs
* doc/misc/tramp.texi (Inline methods): Add "surs" and "sudors" methods.

* etc/NEWS: Add optional "surs" and "sudors" Tramp methods.
Presentational fixes and improvements.

* lisp/net/tramp-cmds.el (tramp-file-name-with-method): Add "surs"
and "sudors" to :type.  Adapt :version.

* lisp/net/tramp-sh.el (tramp-enable-surs-method)
(tramp-enable-sudors-method): New defuns
(tramp-sh-handle-expand-file-name): Add "surs" and "sudors" in check.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.

* lisp/comint.el (comint-password-prompt-regexp):
* test/lisp/comint-tests.el (comint-testsuite-password-strings):
Add su-rs and sudo-rs password prompts.
2025-10-15 10:30:29 +02:00
Stefan Monnier
7845936cbb (font-lock-defaults): Clarify the use of SYNTAX-ALIST (bug#79586)
* doc/lispref/modes.texi (Font Lock Basics):
* lisp/font-core.el (font-lock-defaults): Document when
SYNTAX-ALIST is used and how it interacts with syntactic fontification.
2025-10-14 21:51:04 -04:00
Stefan Monnier
8c19b71660 (rx): Remove the rx--pcase-expand middle man
* lisp/emacs-lisp/rx.el (rx): Remove the `rx--pcase-expand` middle man,
now that `loaddefs-gen.el` expands the `pcase-defmacro` for us.
2025-10-14 11:58:08 -04:00
Stefan Monnier
171c7fd6df (define-minor-mode): Update global-minor-modes if init-value is non-nil
When a global minor mode is enabled by init-value rather than by
calling the major mode function, we failed to register it in
`global-minor-modes` (bug#79518).

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Register
ourselves in `global-minor-modes` at top-level for global modes
with a non-nil init-value.
Also in the `modefun`, simply the code with `not` and `add-to-list`
and consolidate the local/global paths to update `*-minor-modes`.

* lisp/simple.el (global-minor-modes): Move to...
* lisp/subr.el (global-minor-modes): ...here so it's defined early enough
for `auto-compression-mode` to register itself.
2025-10-14 11:47:05 -04:00
Michael Albinus
3aae55acfc Fix Tramp customization
Do not use the ;;;###tramp-autoload cookie for defcustoms.  This
damages the customisation when Tramp is autoloaded.  Reported by
Joel Reicher <joel.reicher@gmail.com>.

* lisp/net/tramp-cache.el (tramp-verbose): Declare.
(tramp-connection-properties):
* lisp/net/tramp-message.el (tramp-verbose):
Remove ;;;###tramp-autoload cookie.
2025-10-14 12:58:27 +02:00
Eli Zaretskii
bcc33e300a Extend Tree-sitter support on MS-Windows to v0.26.x
* lisp/term/w32-nt.el (dynamic-library-alist): Support Tree-sitter
DLLs for versions upto 0.26.x.
2025-10-14 12:47:57 +03:00
Jonas Bernoulli
0dd8138d3f
Update to Transient v0.10.1-8-g188ec9a1 2025-10-13 20:33:30 +02:00
Sean Whitton
aae6a9a740 ; * lisp/vc/vc-dir.el (vc-dir-resynch-file): Use cl-nset-difference. 2025-10-13 16:38:49 +01:00
Sean Whitton
78416e8bed * lisp/vc/vc-dir.el (vc-dir-resynch-file): Use file-in-directory-p.
For better compatibility with MS-Windows.
2025-10-13 16:38:14 +01:00
Sean Whitton
7e38562bcd ; Fix recently introduced uses of "ELisp". 2025-10-13 16:37:40 +01:00
Eshel Yaron
fff1c66830
; Improve 'elisp-unknown-call' face for dark backgrounds
* lisp/progmodes/elisp-mode.el (elisp-unknown-call): Use a
lighter foreground color on dark backgrounds for legibility.
2025-10-13 11:39:12 +02:00
Eli Zaretskii
00b92cd932 ; Improve documentation of semantic highlighting
* lisp/progmodes/elisp-mode.el (elisp)
(elisp-fontify-semantically, elisp-symbol-at-mouse)
(elisp-free-variable, elisp-special-variable-declaration)
(elisp-condition, elisp-major-mode-name, elisp-face)
(elisp-symbol-role, elisp-symbol-role-definition)
(elisp-function, elisp-non-local-exit, elisp-unknown-call)
(elisp-macro, elisp-special-form, elisp-throw-tag)
(elisp-feature, elisp-rx, elisp-theme, elisp-binding-variable)
(elisp-bound-variable, elisp-shadowing-variable)
(elisp-shadowed-variable, elisp-variable-at-point)
(elisp-warning-type, elisp-function-property-declaration)
(elisp-thing, elisp-slot, elisp-widget-type, elisp-type)
(elisp-group, elisp-nnoo-backend, elisp-ampersand)
(elisp-constant, elisp-defun, elisp-defmacro, elisp-defvar)
(elisp-defface, elisp-icon, elisp-deficon, elisp-oclosure)
(elisp-defoclosure, elisp-coding, elisp-defcoding)
(elisp-charset, elisp-defcharset, elisp-completion-category)
(elisp-completion-category-definition, elisp-add-help-echo)
(elisp-fontify-symbol-precedence-function): Add :version tags.

* lisp/emacs-lisp/elisp-scope.el: Fix references to meta-syntactic
variables in the commentary.
(elisp-scope-describe-symbol-role, coding, defcoding, charset)
(defcharset): Doc fixes.
(elisp-scope-safe-macros): Add :version tag.  Doc fix.

* doc/emacs/display.texi (Semantic Font Lock): Fix punctuation and
wording, improve cross-references and indexing.
2025-10-13 11:32:23 +03:00
Martin Rudalics
750499e4b7 Rewrite 'minibuffer-nonselected-mode' to use 'window-state-change-functions'
* lisp/minibuffer.el (minibuffer-nonselected): Rewrite
doc-string.
(minibuffer--nonselected-overlay): Define it global.  Rewrite
doc-string.
(minibuffer--nonselected-check): Rewrite by comparing the active
minibuffer window with the selected window.
(minibuffer--nonselected-setup): Globally add
'minibuffer--nonselected-check' to list of functions called by
'window-state-change-functions'.
(minibuffer--nonselected-exit): Remove
'minibuffer--nonselected-check' from list of functions called by
'window-state-change-functions' when exiting last recursive
minibuffer.
(minibuffer-nonselected-mode): Globally add/remove
'minibuffer--nonselected-setup' to/from list of functions called
by 'minibuffer-setup-hook' and 'minibuffer--nonselected-exit'
to/from list of functions called by 'minibuffer-exit-hook' when
activating/deactivating 'minibuffer-nonselected-mode'.  Rewrite
doc-string.
2025-10-13 10:22:04 +02:00