1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 20:00:46 -08:00
Commit graph

179907 commits

Author SHA1 Message Date
Mattias Engdegård
eed2fce541 Disable one tab-bar-test case on macOS
The test works when run interactively and in batch mode started from
a terminal, but not from M-x compile.

* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Disable on macOS when TERM=dumb.
2025-10-21 13:19:07 +02:00
Yuan Fu
11915c6acb
; Fix previous tree-sitter commit
* lisp/treesit.el (treesit-font-lock-rules): Use lang instead of
current-language, lang = (or cunrrent-language default-language).
2025-10-21 00:01:59 -07:00
Elías Gabriel Pérez
1c8fc379b8 hideshow: Define new keymap for all the commands.
bug#79569

* lisp/progmodes/hideshow.el (hs-prefix-map): New keymap.
(hs-minor-mode-map): Use the new keymap.
2025-10-21 09:37:37 +03:00
Elías Gabriel Pérez
c513224fa3 hideshow: Update the indicators properly after showing/hiding
bug#79616

* lisp/progmodes/hideshow.el (hs-discard-overlays)
(hs-make-overlay, hs-show-block): Rework
'hs--refresh-indicators' calls.
(hs--refresh-indicators): Rework code, add new function
arguments.
(hs-minor-mode): Properly remove the indicators after turning
off the mode.
2025-10-21 09:33:16 +03:00
Yuan Fu
80a17f7a30
Cache compiled tree-sitter queries (bug#79363)
This way major modes can compute font-lock settings and
indentation rules dynamically when the major mode is enabled.
We don't want to compute it at package load time because the
grammar might not be installed at that point.  (Grammar might
be (semi)auto-installed when the major mode is enabled.)

This commit adds treesit--query-cache and changes
treesit-font-lock-rules to not compile the query.  Instead, the
queries are compiled in
treesit-validate-and-compile-font-lock-rules.

Go-ts-mode is modified to use this new framework.

* lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p):
(go-ts-mode--method-elem-supported-p):
(go-ts-mode--font-lock-settings-cached): Removed.
(go-ts-mode--font-lock-settings): Simply return the result of
treesit-font-lock-rules rather than saving to
go-ts-mode--font-lock-settings-cached.  Use
treesit-query-with-optional for computed queries.
* lisp/treesit.el (treesit--query-cache): New variable.
(treesit-font-lock-settings): Add new field language.
(treesit-font-lock-setting-language): New function.
(treesit-query-with-optional): New function.
(treesit-font-lock-recompute-features): Don't compile query and
store language (because we can't derive from compiled query anymore).
(treesit-replace-font-lock-feature-settings): Use the new
language field.
(treesit-validate-and-compile-font-lock-rules): Renamed from
treesit-validate-font-lock-rules, add logic to compile queries.
(treesit-major-mode-setup): Use treesit-validate-and-compile-font-lock-rules.
2025-10-20 22:12:35 -07:00
Elías Gabriel Pérez
4565870dfa hideshow: Add new option for control how the block should be hidden.
bug#79585

* doc/emacs/programs.texi (Hideshow):
* etc/NEWS: Document changes.

* lisp/progmodes/hideshow.el (hs-hide-behavior): New user option.
(hs-life-goes-on): Add 'save-excursion' and 'save-match-data'.
(hs-hide-block): Rework.
2025-10-20 20:57:17 +03:00
Mattias Engdegård
498f89af2a Don't feed the stack overflow detector bad data
* src/lisp.h (record_in_backtrace): Don't record the argument address as
stack_top because most of the time it won't be on the C stack at all.
* src/eval.c (eval_sub): Do it here instead using an address guaranteed
to be on the C stack and we are just in the Lisp interpreter anyway.
2025-10-20 17:53:48 +02:00
Mattias Engdegård
e443811bd7 ; * test/lisp/vc/vc-tests/vc-tests.el: use write-region, again 2025-10-20 16:25:55 +02:00
Sean Whitton
095956a745 vc-test--with-temp-change: Use write-region
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--with-temp-change):
Use write-region (bug#79657).
2025-10-20 15:16:05 +01:00
Michael Albinus
fb48f6016e Revert "* test/lisp/net/tramp-resources/foo.tar.gz: Remove."
This reverts commit e5cd797988.
2025-10-20 14:58:38 +02:00
Michael Albinus
e5cd797988 * test/lisp/net/tramp-resources/foo.tar.gz: Remove. 2025-10-20 14:43:04 +02:00
Michael Albinus
c024b9c661 Tramp cleanup
* doc/misc/tramp.texi (Configuration): Extend example.

* lisp/net/tramp.el (tramp-skeleton-write-region):
* lisp/net/tramp-cache.el (tramp-flush-file-upper-properties):
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
Use `when-let*'	consequently.

* lisp/net/tramp-cmds.el (tramp-file-name-with-method):
Add :initialize and :set functions.
(tramp-set-file-name-with-method): New defun.
(with-tramp-file-name-with-method): Filter out enabled methods.

* lisp/net/tramp-compat.el: Add TODO.

* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test-cascaded-file-archive): Use "foo.zip".

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case-p):
Extend check.
(tramp-test48-session-timeout): Adapt test.

* test/lisp/net/tramp-archive-resources/foo.zip: Renamed from outer.zip.
2025-10-20 14:42:12 +02:00
Eli Zaretskii
71526e7584 Avoid unnecessary y-or-n-p questions in client frames
* lisp/server.el (server-visit-files): Don't consider the file as
having disappeared if it never existed when visited previously.
Doc fix.  (Bug#79609)
2025-10-20 15:10:28 +03:00
João Távora
61a05c3088 Eglot: expand on eglot-workspace-configuration sections (bug#79655)
* doc/misc/eglot.texi (Project-specific configuration): Clarify section.
2025-10-20 12:59:03 +01:00
Mattias Engdegård
3179f3aba0 ; * lisp/emacs-lisp/rx.el (rx--foldl): Replace with 'all' and 'any'. 2025-10-20 12:55:19 +02:00
Mattias Engdegård
d1b3eb7eec Add any and all (bug#79611)
* lisp/subr.el (all, any): New.
* test/lisp/subr-tests.el (subr-all, subr-any): New tests.
* doc/lispref/lists.texi (List Elements): Document.
* etc/NEWS: Announce.
2025-10-20 11:39:16 +02:00
Mattias Engdegård
cfe3c1c840 Add drop-while and take-while (bug#79611)
* lisp/subr.el (internal--effect-free-fun-arg-p)
(drop-while, take-while): New.
* test/lisp/subr-tests.el (subr-drop-while, subr-take-while): New tests.
* doc/lispref/lists.texi (List Elements): Document.
* etc/NEWS: Announce.
2025-10-20 11:38:42 +02:00
João Távora
72255c9992 Flymake: fix daemon-mode + and window client fringe usage (bug#77313)
To make Flymake's margin/fringe decision correct, four cases
must be tested. (1) A daemon that starts flymake-mode on a
buffer and then connecting a graphical client.  Here fringes
must be used. (2) Like 1, but with a tty client.  Here margins
must be used automatically.  (3) A non-daemonic start of a
graphical emacs. (4) A non-daemonic start of a tty emacs.

The code was failing case 1.  1 and 2 are the trickiest to get
right and currently can't be gotten right unless the margin
auto-resize is done at buffer annotation time.

Additionally, fix bugs in 'flymake-start's buffer visibility logic.
Refactor duplicate code in 'flymake--highlight-line' and fix docstrings.

* lisp/progmodes/flymake.el (flymake-autoresize-margins): Fix
focstring.
(flymake--bs-display): Rename from flymake--indicator-overlay-spec.
Fix docstring. Return just the display spec.
(flymake--suitably-fringed-p): New helper, instead of duplication.
(flymake--resize-margins): Cut up into two functions.
(flymake--restore-margins): Dedicated to restoring functions.
(flymake--highlight-line): Simplify logic when
flymake-indicator-type is 'auto'.
(flymake-start): Fix visibility logic to account for daemon mode.
Maybe resize margins here.
(flymake-mode): Call restore margins.
2025-10-19 23:48:58 +01:00
Juri Linkov
7df7a90e2c * lisp/progmodes/compile.el (compilation--set-up-margin): Fix.
Call 'set-window-margins' only on the compilation buffer where the
hook 'window-buffer-change-functions' is set buffer-locally (bug#79640).
2025-10-19 20:56:30 +03:00
Juri Linkov
3212bdc464 New value 'auto' of user option 'flymake-indicator-type' used by default
* lisp/progmodes/flymake.el (flymake-indicator-type):
Change the default value from 'fringes' to 'auto'.
(flymake--resize-margins): Use margins when
'flymake-indicator-type' is 'auto', but fringes are no available.
(flymake--highlight-line): Use display condition '(when CONDITION . SPEC)'
that checks for 'window-fringes' at display time and switches
between fringes and margins (bug#77313).
2025-10-19 20:41:12 +03:00
Sean Whitton
4faebea822 vc-git-registered: Be quieter when Git is not installed
* lisp/vc/vc-git.el (vc-git-registered): If Git is not
installed, don't echo a message about it.
2025-10-19 16:41:11 +01:00
Sean Whitton
b0012cb8e1 vc-rename-file: Make it work regardless of default-directory
* lisp/vc/vc.el (vc-rename-file): Make it work regardless of
default-directory; now the only influence of default-directory
should be resolving OLD and NEW if they are relative file names.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file): Test
the influence of default-directory on vc-rename-file.
2025-10-19 15:39:22 +01:00
Mattias Engdegård
04cb852c13 ; * src/bytecode.c (exec_byte_code): editing mistake (thanks Pip!) 2025-10-19 15:14:20 +02:00
Mattias Engdegård
346213f883 Disable -Wclobbered for GCC in exec_byte_code (bug#79610)
* src/bytecode.c (exec_byte_code):
Disable the -Wclobbered warning for GCC locally as the old work-around
doesn't appear to be effective for variables with explicitly assigned
registers.  This also allows us to remove that work-around which
improves the code somewhat.
2025-10-19 15:09:01 +02:00
Mattias Engdegård
076307b163 ; exec_byte_code: refactor branch case 2025-10-19 14:57:34 +02:00
Mattias Engdegård
ae673ce20c exec_byte_code: use fixed registers for top and pc (bug#79610)
GCC seems to have difficulty allocating important global interpreter
variables in registers; telling it which ones to use for 'top' and 'pc'
makes a big difference and seems to ease pressure enough for it to
deal with other variables as well.

We do it for AMD64 and ARM64.  Clang doesn't seem to need these directives.
It does result in -Wclobbered warnings that seem difficult to silence.

* src/bytecode.c (BC_REG_TOP, BC_REG_PC): New.
(exec_byte_code): Use them.
2025-10-19 14:57:34 +02:00
Mattias Engdegård
fbc68bbc36 ; exec_byte_code: don't re-use op in FETCH2 2025-10-19 14:57:34 +02:00
Mattias Engdegård
b72e352cb4 exec_byte_code: reduce use of semi-global 'op' (bug#79610)
* src/bytecode.c (exec_byte_code):
Re-type op from int to ptrdiff_t, which avoids some useless conversions.
Reduce its use by using local variables for intra-block use,
and another variable (arg) where it doesn't need to be alive across
instruction dispatch.  We also eliminate it where performance doesn't
matter by re-fetching it from the instruction stream.

All this should help the register allocator.
2025-10-19 14:57:34 +02:00
Mattias Engdegård
8ed5b4378a ; ispell-tests-common.el: tidy file-matching regexp 2025-10-19 14:09:22 +02:00
Lockywolf
2ae535c90b Fix ispell-tests on emacs CI
* test/lisp/textmodes/ispell-resources/fake-aspell-new.bash
Error with a broken dictionary.

* test/lisp/textmodes/ispell-tests/ispell-tests-common.el
(ispell-tests--constants/nonexistent-dictionary): Add.
(ispell-tests--some-valid-dictionary): Give fallback dictionary.

* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-accept-buffer-local-defs/received-file): Use
proper broken dictionary.
2025-10-19 12:14:58 +02:00
LdBeth
6cb8a67e4b Fix a recent regression in Newsticker
* lisp/net/newst-backend.el (newsticker--parse-text-container):
New function.
(newsticker--parse-atom-1.0): Use it.  (Bug#79617)
2025-10-19 08:00:36 +03:00
Stefan Monnier
4ec24ce2a1 (eval-and-compile): Preserve the surrounding lexical context
Implement a better fix for bug#79634.

* lisp/emacs-lisp/byte-run.el (eval-and-compile):
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment)
<eval-and-compile>: Preserve the surrounding lexical context (the part
available during macroexpansion, i.e. which vars are dynbound).

* lisp/emacs-lisp/rx.el (<pcase> rx): Remove workaround.

* test/lisp/emacs-lisp/macroexp-tests.el
(macroexp--dynbound-eval-and-compile): New test.
2025-10-18 17:45:07 -04:00
Helmut Eller
48357dc612 Add a test for puthash
It's actually for a bug on the feature/igc branch.

* test/src/fns-tests.el (ft-puthash-weak): New test
(ft--puthash-weak): New helper.
2025-10-18 20:22:17 +02:00
Juri Linkov
08dc7d0c93 * lisp/minibuffer.el (completion--insert-strings): Use the correct frame.
Provide the 'frame-height' call with the frame of the window where
the *Completions* buffer is displayed for the case when the minibuffer
window uses a dedicated frame (bug#79635).
2025-10-18 20:53:44 +03:00
Alan Mackenzie
97b960ec6d Fix coding error in byte-run--strip-vector/record
* lisp/emacs-lisp/byte-run.el (byte-run--strip-vector/record):
Replace a symbol with position by its bare symbol, rather
than returning it unchanged.
2025-10-18 17:08:02 +00:00
Sean Whitton
0b4079ddb6 vc-do-command: Don't print a spurious newline
* lisp/vc/vc-dispatcher.el (vc-do-command): Don't print a
spurious newline.  Don't omit the format string with 'message'.
(Bug#79650)
2025-10-18 17:30:21 +01:00
Alcor
c66680d001 Rcirc: Fix invalid face error message when applying IRC color
* lisp/net/rcirc.el (rcirc-color-attributes): Fix invalid face.
(Bug#79561)

Copyright-paperwork-exempt: yes
2025-10-18 17:23:13 +03:00
Lockywolf
1f3d417736 Fix detecting a working hunspell on systems without a dictionary
Fixes bug#79477 and bug#79514

* test/lisp/textmodes/ispell-tests/ispell-hunspell-tests.el
(ispell-tests-hunspell--hunspell-working): Implement checker.
(ispell/hunspell/ispell-word/russian/check-only): Add skip-check.
(ispell/hunspell/ispell-word/english/check-only): Add skip-check.
(ispell/hunspell/ispell-word/language-switch/check-only): Add
skip-check.
(ispell/hunspell/ispell-word/russian/check-only/wrong-language): Add
skip-check.
(ispell/hunspell/ispell-word/multilang): Add skip-check.
* test/lisp/textmodes/ispell-tests/ispell-tests-common.el
(fake-aspell-path): Improve checking that an engine works.
(ispell-tests--letopt): Make restoring variables more robust,
rename to a local name.  Add debug spec.
(ispell-tests--with-ispell-global-dictionary): Rename to a local name
Add debug spec.
(ispell-tests--some-valid-dictionary): Add a selector for a safe
dictionary.
(ispell/ispell-accept-buffer-local-defs/received-file): Add.
(ispell-tests--constants/english/correct-list): Add.
(ispell-tests--constants/english/correct-one): Add.
(ispell-tests--constants/english/wrong): Add.
(ispell-tests--constants/russian/correct): Add.
(ispell-tests--constants/russian/wrong): Add.
(ispell-tests--constants/completion): Add.
* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-buffer-local-words/ispell-buffer-session-localwords):
reverse letopt and with-ispell-dictionary.
(ispell/ispell-buffer-local-words/ispell-words-keyword):
reverse letopt and with-ispell-dictionary.
(ispell/ispell-complete-word-interior-frag/simple):
reverse letopt and with-ispell-dictionary.
(ispell/ispell-complete-word/ispell-completion-at-point):
reverse letopt and with-ispell-dictionary.
(ispell/ispell-init-process/works-with-home):
reverse letopt and with-ispell-dictionary.
(ispell/ispell-kill-ispell):
reverse letopt and with-ispell-dictionary.
* test/lisp/textmodes/ispell-resources/fake-aspell-new.bash:
Add comments on unused function.  Replace echo with printf.
2025-10-18 13:59:07 +03:00
Eli Zaretskii
1b1ab741b8 : Update ldefs-boot.el. 2025-10-18 06:18:26 -04:00
Eli Zaretskii
521e06d3ef Merge from origin/emacs-30
53aac6aecd ; Improve documentation of commands that split current wi...
2025-10-18 06:15:46 -04:00
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
Eli Zaretskii
53aac6aecd ; Improve documentation of commands that split current window
* doc/emacs/sending.texi (Sending Mail):
* doc/emacs/dired.texi (Dired Enter, Dired Visiting):
* doc/emacs/maintaining.texi (Old Revisions)
(Change Log Commands, Looking Up Identifiers):
* doc/emacs/windows.texi (Displaying Buffers):
* doc/emacs/files.texi (Visiting): Add cross-references to where
user options are described which control how windows are split.

* lisp/mail/sendmail.el (mail-other-window):
* lisp/gnus/message.el (message-mail-other-window)
(message-news-other-window):
* lisp/replace.el (occur-mode-goto-occurrence-other-window):
* lisp/vc/vc.el (vc-revision-other-window):
* lisp/vc/vc-dir.el (vc-dir-find-file-other-window):
* lisp/progmodes/xref.el (xref-find-definitions-other-window):
* lisp/simple.el (compose-mail-other-window)
(clone-indirect-buffer-other-window):
* lisp/vc/add-log.el (add-change-log-entry-other-window):
* lisp/view.el (view-file-other-window)
(view-buffer-other-window):
* lisp/window.el (switch-to-buffer-other-window):
* lisp/files.el (find-file-other-window)
(find-file-read-only-other-window)
(find-alternate-file-other-window):
* lisp/dired.el (dired-other-window)
(dired-mouse-find-file-other-window)
(dired-find-file-other-window, dired-jump-other-window): Mention
in the doc strings how to control the way the current window is
split.
2025-10-18 10:47:29 +03:00
Stefan Monnier
ce7f2b93bb lisp/emacs-lisp/rx.el (<pcase> rx): Workaround for bug#79634 2025-10-17 15:53:18 -04:00