1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-09 00:11:49 -07:00
Commit graph

179622 commits

Author SHA1 Message Date
Elías Gabriel Pérez
2a782c8d28 Add electric-indent actions to reindent (bug#79371)
* lisp/electric.el (electric-indent-actions)
(electric-indent-function): New user options.
(electric-indent-should-reindent-p, electric-indent--yank-advice)
(electric-indent-save-hook): New functions.
(electric-indent-post-self-insert-function): Use them.
2025-09-23 16:16:54 -04:00
Stefan Monnier
578aeedbe9 (electric-indent-functions-without-reindent): Pare down
* lisp/electric.el (electric-indent-functions-without-reindent):
Remove obsolete entries: Haskell modes, python-mode, and
coffer-mode already disable electric reindentation on their
side, so we don't need those entries any more.

* lisp/org/org.el (org-mode): Don't rely on
`electric-indent-functions-without-reindent'.
2025-09-23 13:48:06 -04:00
Michael Albinus
c16b0d9af3 ; Instrument file-notify-test07-many-events
* test/lisp/filenotify-tests.el (file-notify--test-monitor):
Improve instrumentation.
2025-09-23 11:23:11 +02:00
Eli Zaretskii
bea8b09568 ; * doc/lispref/symbols.texi (Shorthands): Fix markup. 2025-09-23 09:00:57 +03:00
Yuan Fu
7b8c17d527
Fix python-ts-mode font-lock breakage by grammar change (bug#79457)
* lisp/progmodes/python.el (python--treesit-fontify-string): Use
new algorithm.
2025-09-22 16:41:06 -07:00
Sean Whitton
192a0e1773 ; * lisp/vc/vc-git.el (vc-git--checkin): Fix error message. 2025-09-22 17:21:38 +01:00
Roi Martin
85c42b3a87 Fix font lock in php-ts-mode
Fix font lock in php-ts-mode when the tree-sitter grammars are
automatically installed.  Also, update php-ts-mode to call the new
`mhtml-ts-mode--treesit-font-lock-settings' function.

* lisp/progmodes/php-ts-mode.el (php-ts-mode--keywords)
(php-ts-mode--operators): Generate the lists after the tree-sitter
grammars are installed.
(php-ts-mode--font-lock-settings, php-ts-mode--font-lock-settings-cached)
(php-ts-mode--custom-html-font-lock-settings)
(php-ts-mode--custom-html-font-lock-settings-cached): Evaluate the rules
after the tree-sitter grammars are installed.  Also, add cache for the
rules.
(php-ts-mode): Call the new
`php-ts-mode--custom-html-font-lock-settings' function.  (Bug#79363)
2025-09-22 18:11:39 +03:00
Stephen Berman
77ca60b48d Navigate *Completions* buffer based on 'completions-format'
This patch makes 'next-completion' and 'previous-completion' work
in the vertical completions format analogously to how they work in
the default horizontal format (bug#78959).  It also fixes wrapping
in the vertical format and confines navigation (including
wrapping) in column-wise movement in the vertical format to the
current line, analogously to how navigation (including wrapping)
in line-wise movement in the horizontal format is confined to the
current column.

* doc/emacs/mini.texi (Completion): Fix several typos and improve
wording is several places.
(Completion Commands): Document navigation of the *Completions*
buffer in the vertical format.  Document the difference between
format-sensitive movement and strictly column-wise or line-wise
movement.  Document 'minibuffer-complete-and-exit' and update the
documentation of 'minibuffer-completion-auto-choose' and
'minibuffer-choose-completion'.  Document the use of a numeric
prefix argument with the navigation commands.
(Completion Options): Rearrange and improve documentation of
'completions-sort', 'completions-format' and
'completion-auto-wrap', updating the latter to document the new
behavior.

* lisp/minibuffer.el (minibuffer-visible-completions-map): Rebind
"<left>" to 'minibuffer-previous-column-completion' and "<right>"
to 'minibuffer-next-column-completion'.
(minibuffer-next-completion): Add check for whether completions
format is vertical to decide whether to call
'next-line-completion' and replace calling 'next-completion' by
'next-column-completion'.
(minibuffer-next-column-completion)
(minibuffer-previous-column-completion): New commands.

* lisp/simple.el (completion-list-mode-map): Rebind "<left>" to
'previous-column-completion' and "<right>" to 'next-column-completion'.
(last-completion): Add handling for vertical completions format.
(completion--move-to-candidate-end): Always move point to the
position immediately after the last character of the completion
candidate.  This unifies the behavior, simplifies the
implementation and facilitates implementing the improved
navigation of the *Completions* buffer.
(previous-column-completion, next-column-completion): New
commands, replacing the previous definitions of
'previous-completion' and 'next-completion' to reflect their
column-wise operation.  Confine navigation (including wrapping) in
vertical format to the current line.
(previous-line-completion, next-line-completion): Implement
line-wise navigation (including wrapping) through all completions
in vertical format, not just those in the current column as in
horiztonal format.  Update doc strings.
(next-completion, previous-completion): Redefine to call
'{next,previous}-line-completion' when completions format is
vertical and '{next,previous}-column-completion' otherwise.

* test/lisp/minibuffer-tests.el
(completions-format-navigation--tests): New function providing a
template to define tests of the navigation and wrapping behavior
with specified numbers of completion candidates.
(completions-format-navigation-test-{2,3,4,5,10,15,16}): New tests.
2025-09-22 16:04:42 +02:00
Philipp Stephani
aeadaf7748 Fix minor incorrect statement about shorthands.
* doc/lispref/symbols.texi (Shorthands): Make documentation match
reality.  See symbol_char_span in src/lread.c.
2025-09-22 14:40:32 +02:00
Philipp Stephani
dac0040f8d ; * doc/lispref/symbols.texi (Shorthands): Add missing parenthesis. 2025-09-22 14:28:08 +02:00
Andrea Corallo
ec4066d532 Revert "* Clean-up some compilation warnings in vc-hooks.el"
This reverts commit dd622e06e7 as
functions are autoloaded.
2025-09-22 10:28:40 +02:00
Andrea Corallo
0b9e96ce5e Make native lisp code reflect EQ C implementation
* src/comp.c (ABI_VERSION): Bump new version
	(comp_t): add 'eq'.
	(helper_link_table): add 'slow_eq'.
	(emit_slow_eq): New function.
	(emit_EQ): Rework to reflect EQ implementation.
	(declare_runtime_imported_funcs): Import 'slow_eq'.
	(Fcomp__init_ctxt): Register emitter 'emit_eq' for op code Qeq.

This and the previous 2 commits increase elisp-benchmarks performance by
3.6% on my test machine. Also a (small) reduction in eln size comes with
it.
2025-09-22 10:28:40 +02:00
Andrea Corallo
e7380934d0 * Make sure the compiler optimizes for symbols_with_pos_enabled 0 in EQ
* src/lisp.h (EQ): Make use '__builtin_expect'.
2025-09-22 10:28:40 +02:00
Pip Cet
020e2f5ddb Change EQ to move slow code path into a separate function
* src/data.c (slow_eq): New function.
    * src/lisp.h (EQ): Call it.
2025-09-22 10:28:40 +02:00
Juri Linkov
e58efac78e * lisp/keymap.el (read-only-keymap-bind): The remaining fix.
Replace 'browse-url-keymap-filter' with 'read-only-keymap-filter'.
2025-09-22 09:20:27 +03:00
Po Lu
36635b934e Fix bootstrap and prevent browse-url from preloading numerous files
* lisp/keymap.el (read-only-keymap-filter)
(read-only-keymap-bind): New functions, removed from
browse-url.el.

* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): Move to keymap.el.  All callers
changed.
2025-09-22 09:42:34 +08:00
Sean Whitton
8310795bab VC checkin-patch: Support extracting commit metadata from patches
* lisp/vc/vc-git.el (vc-git--mailinfo): New function.
(vc-git-checkin-patch): Use it to extract authorship, date and
log message information from patches.
(vc-git--call): New INFILE argument.  All uses changed.
* lisp/vc/vc-hg.el (vc-hg--checkin): When COMMENT is nil, take
authorship, date and log message information from the patch.
* lisp/vc/vc.el (checkin-patch): Specify to use authorship, date
and comment information in PATCH-STRING (bug#79408).
(prepare-patch): Specify that patch should include authorship
identity, date and log message information for REV if supported.
(diff-bounds-of-hunk): Declare.
(vc-default-checkin-patch): Warn if it looks like we will ignore
patch authorship information.
* test/lisp/vc/vc-tests/vc-tests.el (vc-hg-command)
(vc-git--out-str): Declare.
(vc-test--checkin-patch): New function.
(vc-test-git08-checkin-patch, vc-test-hg08-checkin-patch): New
tests.
2025-09-21 21:59:02 +01:00
Sean Whitton
0109b4a758 * lisp/vc/vc-git.el (vc-git--checkin): Validate parameters. 2025-09-21 21:44:28 +01:00
Juri Linkov
8a501c47a4 Support 'RET' for visiting URLs in read-only buffers (bug#74792)
* lisp/net/browse-url.el (browse-url-keymap-filter)
(browse-url-keymap-bind): New functions.
(browse-url-button-map): Bind "C-c RET" to 'browse-url-button-open'
and rebind "RET" with the filter 'browse-url-keymap-bind'.

* lisp/ansi-osc.el (ansi-osc-hyperlink-map):
* lisp/net/goto-addr.el (goto-address-highlight-keymap):
* lisp/progmodes/bug-reference.el (bug-reference-map):
Bind "RET" with the filter 'browse-url-keymap-bind'.
2025-09-21 20:52:02 +03:00
Roi Martin
203faa6e42 Suffix tree-sitter cache variables with "-cached"
* lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--indent-rules)
(cmake-ts-mode--indent-rules-cached, cmake-ts-mode--font-lock-settings)
(cmake-ts-mode--font-lock-settings-cached):
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings)
(go-ts-mode--font-lock-settings-cached):
* lisp/progmodes/js.el (js--treesit-indent-rules)
(js--treesit-indent-rules-cached, js--treesit-font-lock-settings)
(js--treesit-font-lock-settings-cached): Suffix tree-sitter cache
variables with "-cached" (bug#79363).
2025-09-21 19:49:20 +03:00
Roi Martin
2ae54a8b17 Fix font lock and cache indent rules in mhtml-ts-mode
Fix font lock in mhtml-ts-mode when the required tree-sitter grammars
are automatically installed (bug#79363).  Also, cache tree-sitter indent
rules.
* lisp/textmodes/mhtml-ts-mode.el
(mhtml-ts-mode--treesit-font-lock-settings): Evaluate the rules only
after the tree-sitter grammars are installed.
(mhtml-ts-mode--treesit-indent-rules): Cache indent rules.
(mhtml-ts-mode): Call the new
`mhtml-ts-mode--treesit-font-lock-settings' function.
2025-09-21 19:49:18 +03:00
Steven Allen
ae32e25419 Fix minibuffer-nonselected-mode when using recursive minibuffers
* lisp/minibuffer.el (minibuffer-nonselected-setup): Use
window-buffer-change-functions in addition to
window-selection-change-functions to detect changes from one recursive
minibuffer to another within the same minibuffer-window.
(minibuffer-nonselected-check): Ensure that the target minibuffer is
current before checking/deleting the overlay (bug#79472).
2025-09-21 19:34:33 +03:00
Eli Zaretskii
33e6176932 ; * lisp/international/textsec-check.el (textsec-suspicious-p): Doc fix. 2025-09-21 13:03:16 +03:00
Juri Linkov
49d8302b40 * lisp/progmodes/js.el: Obsolete 'js--treesit-sexp-nodes'.
(js--treesit-sexp-nodes): Set the default value to nil and make obsolete.
(js--treesit-thing-settings): Instead of using
'js--treesit-sexp-nodes', define a list of named and anonymous nodes
that don't match the 'sexp' thing (bug#79465).
2025-09-20 21:20:04 +03:00
Eli Zaretskii
2ba301b30e ; * etc/NEWS: Merge two "Register" sections. Fix wording. 2025-09-20 19:37:48 +03:00
Masatake YAMATO
a760f1fe6e (register-preview-info): sort registers in preview buffer
* lisp/register.el (register-preview): Sort alist returned
from `register-of-type-alist'.  (Bug#79474)
2025-09-20 19:35:07 +03:00
Eli Zaretskii
7f6b68cd7c ; * doc/emacs/programs.texi (Hideshow): Fix last change. 2025-09-20 13:38:00 +03:00
Eli Zaretskii
5a56c0fb43 ; * lisp/ldefs-boot.el: Update. 2025-09-20 06:35:11 -04:00
Eli Zaretskii
b6a065c90d Merge from origin/emacs-30
159ad91d0d ; Add Richard Stallman to admin/MAINTAINERS.
2025-09-20 06:33:22 -04:00
Eli Zaretskii
6570c746fe Avoid signaling errors in 'dabbrev-capf'
* lisp/dabbrev.el (dabbrev-capf): Call
'dabbrev--reset-global-variables' if necessary.  (Bug#61274)
2025-09-20 13:15:59 +03:00
Eli Zaretskii
66308637d7 ; Fix last change.
* etc/NEWS:
* doc/emacs/programs.texi (Hideshow): Fix wording and punctuation.
2025-09-20 13:06:17 +03:00
Elías Gabriel Pérez
071cdb66fd Add hideable indicators for hideshow. (Bug#79294)
* doc/emacs/programs.texi (Hideshow): Update documentation.
* etc/NEWS: Announce changes.
* lisp/progmodes/hideshow.el (hs-show-indicators)
(hs-indicator-type, hs-indicator-maximum-buffer-size): New user
options.
(hs-indicator-hide, hs-indicator-show): New icons.
(hs-block-positions, hs--make-indicators-overlays)
(hs-indicator-mouse-toggle-hidding, hs--add-indicators)
(hs--refresh-indicators): New functions.
(hs-hide-block-at-point): Use hs-block-positions.
(hs-inside-comment-p): Use 'get-char-property' instead of
'hs-overlay-at'.
(hs-minor-mode): Rework.
2025-09-20 12:58:31 +03:00
Janneke Nieuwenhuizen
32ccb2347f Fix 'shell-resync-dirs' for multi-line prompt.
* lisp/shell.el (shell-eval-command): Instead of always taking the last
element from the shell-dirtrack-query command, first try selecting the
last directory.  (Bug#79441)
2025-09-20 12:52:50 +03:00
Eli Zaretskii
40adabe2ef Improve documentation of 'accept-process-output'
* doc/lispref/processes.texi (Accepting Output):
* src/process.c (Faccept_process_output): Document better the
meaning of the timeout of 'accept-process-output' a,d the fact
that it doesn't always return as soon as some output is available.
See https://lists.gnu.org/archive/html/emacs-devel/2025-08/msg00750.html
for more details.
2025-09-20 12:32:21 +03:00
Stephen Berman
65fb579896 Prevent displaying an ungrammatical string in *Help*
* lisp/help-fns.el (help-fns-function-description-header): If a
function type symbol begins with a vowel, precede it with the
article "an" instead of "a".  To date this only prevents
displaying "a interpreted-function", and it's susceptible to
future false positives (bug#79469).
2025-09-20 10:18:40 +02:00
Po Lu
2457934323 Fix reference leak in displaying successive dashes of distinct styles on Android
* src/android.c (android_set_dashes): Always release local
reference to dash array even when it was returned by
GetObjectField.
2025-09-20 10:08:05 +08:00
Alan Mackenzie
ea01e59eb1 CC Mode: Don't indent a construct in a class after a template
This fixes bug#79438.

* lisp/progmodes/cc-align.el (c-lineup-class-field-cont): New
function.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Change the
entry for class-field-cont from + to
c-lineup-class-field-cont.

* doc/misc/cc-mode.texi (Misc Line-Up): Add a new entry for
c-lineup-class-field-cont.
2025-09-19 20:51:45 +00:00
Juri Linkov
2cc525467b New mode 'minibuffer-nonselected-mode'
* lisp/minibuffer.el (minibuffer-nonselected): New face.
(minibuffer-nonselected-overlay): New buffer-local variable.
(minibuffer-nonselected-check, minibuffer-nonselected-setup):
New functions.
(minibuffer-nonselected-mode): New command (bug#49844).
2025-09-19 18:15:42 +03:00
Mattias Engdegård
9f174f08d8 ; * src/bytecode.c (exec_byte_code): Revert gratuituous style change 2025-09-19 10:31:54 +02:00
Po Lu
fb15f86248 ; * src/bytecode.c (exec_byte_code): Fix coding style. 2025-09-19 09:28:17 +08:00
Mattias Engdegård
7d5633d0f4 * src/bytecode.c (exec_byte_code): Better quitcounter reset value.
This value forces a quit check at the next backward branch, to avoid
rare situations being hard to interrupt.
Suggested by Pip Cet.
2025-09-18 22:13:38 +02:00
Juri Linkov
27853a2bca * lisp/textmodes/mhtml-ts-mode.el: Fix for recent changes in js-ts-mode.
(mhtml-ts-mode--treesit-font-lock-settings): Replace variable
'js--treesit-font-lock-settings' with the function call.
(mhtml-ts-mode--treesit-indent-rules): Replace variable
'js--treesit-indent-rules' with the function call (bug#79363).
2025-09-18 18:20:15 +03:00
Mattias Engdegård
0767f1818a Don't save quitcounter across longjmp in exec_byte_code
* src/bytecode.c (exec_byte_code): Reset quitcounter to 1 after longjmp;
the exact value isn't important.  This may reduce register pressure a
tiny bit or at least remove a useless stack slot.
2025-09-18 17:05:29 +02:00
Michael Albinus
979ddc0601 Fix failed tests on emba
* test/lisp/autorevert-tests.el (auto-revert-test05-global-notify)
(auto-revert-test07-auto-revert-several-buffers): Adapt tests.

* test/src/comp-resources/comp-test-funcs.el (foo): Define error symbol.
2025-09-18 14:56:05 +02:00
Andrea Corallo
dd622e06e7 * Clean-up some compilation warnings in vc-hooks.el
* lisp/vc/vc-hooks.el(vc-diff-outgoing-base)
(vc-root-diff-outgoing-base, vc-apply-to-other-working-tree)
(vc-apply-root-to-other-working-tree): Declare.
2025-09-18 14:48:59 +02:00
Sean Whitton
d3a2541798 Refactor vc-git checkin functions
* lisp/vc/vc-git.el (vc-git-patch-string): Delete.  All uses
changed.
(vc-git--checkin): Rename vc-git-checkin to this.
(vc-git-checkin-patch, vc-git-checkin): New wrapper functions.
2025-09-18 12:48:32 +01:00
Sean Whitton
0b4fe2628c vc--prompt-other-working-tree: Fail when no other working trees
* lisp/vc/vc.el (vc--prompt-other-working-tree): When there are
no other working trees, signal an error.
2025-09-18 12:33:56 +01:00
Leo C. Stein
23a8c06a23 Skip over possible blank lines returned by kpsewhich
* lisp/ffap.el (ffap-latex-mode): Starting with TeXlive 2025, the
kpsewhich utility may return blank lines before the first valid
path for `ffap'.  The old behavior of `ffap-latex-mode' was to
simply return the first line of output from kpsewhich (if the
output was nonempty).  The fix simply skips all \r and \n chars.
(Bug#79397)

Copyright-paperwork-exempt: yes
2025-09-18 13:07:11 +02:00
Roi Martin
79b7c7b1d3 Fix font lock and indentation in js-ts-mode
Fix font lock and indentation in js-ts-mode when the tree-sitter grammar
is automatically installed (Bug#79363).
* lisp/progmodes/js.el (js--treesit-indent-rules)
(js--treesit-font-lock-settings): Evaluate the rules only after the
tree-sitter grammar is installed.
(js-ts-mode): Call the new `js--treesit-indent-rules' and
`js--treesit-font-lock-settings' functions.
2025-09-18 09:20:56 +03:00
Eli Zaretskii
159ad91d0d ; Add Richard Stallman to admin/MAINTAINERS. 2025-09-18 08:52:46 +03:00