Commit graph

176708 commits

Author SHA1 Message Date
Stefan Kangas
1c16d81bac Fix fontification of ATTRIBUTE_NO_SANITIZE_ADDRESS functions
* .dir-locals.el (c-mode) <c-noise-macro-names>:
Add "ATTRIBUTE_NO_SANITIZE_ADDRESS", to fontify functions with this
attribute correctly.
2025-02-10 00:03:12 +01:00
Stefan Kangas
893f6652da ; Add missing section marker to ert.el 2025-02-09 22:44:51 +01:00
Stefan Kangas
859608c051 Use unload-function instead of unload-hook in ert
* lisp/emacs-lisp/ert.el
(ert-unload-function): Rename from 'ert--unload-function'.
(ert--unload-function): Make into obsolete function alias for the above.
2025-02-09 22:44:51 +01:00
Juri Linkov
e9d17e4197 Improve treesit settings for {json,html,toml,yaml}-ts-mode (bug#73404)
* lisp/progmodes/json-ts-mode.el (json-ts-mode): Add 'list' thing
to 'treesit-thing-settings'.
(json-ts-mode): Disable outlines.

* lisp/textmodes/html-ts-mode.el (html-ts-mode--defun-name):
Get a grandchild 'tag_name' from 'element' that was already
defined by 'treesit-defun-type-regexp'.
(html-ts-mode--outline-predicate): New function.
(html-ts-mode): Add "comment" to the 'list' thing
in 'treesit-thing-settings'.  Use "tag_name" and "attribute"
in 'sentence' to conform to sentence navigating arguments
in other ts-modes.  Remove unnecessary heading
from 'treesit-simple-imenu-settings' and use "element"
supported by 'html-ts-mode--defun-name'.
Set 'treesit-outline-predicate' to 'html-ts-mode--outline-predicate'.

* lisp/textmodes/toml-ts-mode.el (toml-ts-mode):
Add 'treesit-thing-settings'.

* lisp/textmodes/yaml-ts-mode.el (yaml-ts-mode--defun-name)
(yaml-ts-mode--outline-predicate): New functions.
(yaml-ts-mode): Set 'treesit-defun-type-regexp',
'treesit-defun-name-function', 'treesit-defun-tactic'.
Add 'sentence' to 'treesit-thing-settings'.
Set 'treesit-simple-imenu-settings' and 'treesit-outline-predicate'.
Use 'kill-local-variable' for 'forward-sexp-function'
and 'show-paren-data-function' instead of resetting their value.

* lisp/treesit.el (treesit-outline-search): Check for the thing
before the end of the line to support such case when the thing
fits on the current line and ends before the end of the line
such as e.g. '<h1>...</h1>' in html-ts-mode.
(treesit-hs-find-next-block, treesit-hs-inside-comment-p):
Use anchors for "\\`comment\\'" (bug#75609).
2025-02-09 19:54:02 +02:00
Stefan Kangas
7e60ceeccb ; Silence byte-compiler
* lisp/net/eww.el (eww-bookmark-kill):
* test/lisp/savehist-tests.el: Silence byte-compiler.
2025-02-09 16:16:01 +01:00
Stefan Kangas
5c07fc7557 ; Simplify last commit
* lisp/mail/footnote.el (footnote-mode): Simplify last change.
2025-02-09 15:56:51 +01:00
Stefan Kangas
64905eba27 Improve filling with footnote-mode
* lisp/mail/footnote.el (footnote-mode): Add regexp for footnotes
to sentence-end-base to improve filling.
2025-02-09 15:36:39 +01:00
Juri Linkov
35fa712690 * lisp/vc/diff-mode.el (diff-mode): Disable view-mode keybindings.
Put the property 'mode-class' with the value 'special' on the symbol
'diff-mode'.  This fixes the case when 'view-read-only' is non-nil
by disabling activation of 'view-mode' that overrides single keys
from 'diff-mode-shared-map' (bug#75993).
2025-02-09 09:40:44 +02:00
Eli Zaretskii
821ec78512 ; * etc/NEWS: Fix a recent change. 2025-02-09 07:24:28 +02:00
Po Lu
d93342cf32 Merge from savannah/emacs-30
563efd6838 Fix program execution on Android 15 QPR2 Beta
2025-02-09 12:08:27 +08:00
Po Lu
563efd6838 Fix program execution on Android 15 QPR2 Beta
* exec/trace.c (process_vm_readv, process_vm_writev): New
function pointers.  Attempt to load them on recent Android
systems when `exec' was not linked with a sufficiently
up-to-date libc.
(read_memory, user_copy): Always use process_vm_readv and
process_vm_writev if available.
(handle_openat): Write trailing NULL byte of filename to user
buffer.
(exec_init): Attempt to dlsym process_vm_readv and
process_vm_writev.
2025-02-09 12:06:52 +08:00
Sebastián Monía
1294c5ed5f Use vtable in eww-list-bookmarks
* lisp/net/eww.el (eww-list-bookmarks): Move logic to...
(eww--bookmark-prepare, eww--bookmark-format-data) ... these, and use
'vtable'.
(eww-bookmark-kill, eww-bookmark-yank, eww-bookmark-browse)
(eww-next-bookmark, eww-previous-bookmark, eww-buffers-mode-map): Use
'vtable-current-object'.
2025-02-08 14:21:39 -08:00
Philip Kaludercic
eb36518244
;* doc/misc/dired-x.texi: Remove unnecessary paren (Bug#76148) 2025-02-08 22:40:25 +01:00
Philip Kaludercic
4cc8709ac2
Refresh package list without blocking
* lisp/emacs-lisp/package.el (package-refresh-contents): Run
asynchronously when invoked interactively.
* etc/NEWS: Mention the change.
2025-02-08 22:40:25 +01:00
Andreas Schwab
a0e1115caa Don't try to unregister tracker ID twice
* lisp/vc/diff-mode.el (diff-minor-mode): Clear
diff--track-changes after unregistering.
2025-02-08 19:39:03 +01:00
Michael Albinus
bdf77074bf * doc/misc/ert.texi (Helper Functions): New node. 2025-02-08 17:36:16 +01:00
João Távora
37c07f383b Eglot: auto-expand first level in type and call hierarchies
* lisp/progmodes/eglot.el (eglot--hierarchy-2): Use widget-apply-action.
2025-02-08 13:42:08 +00:00
Felicián Németh
3fde13a501 Eglot: do not activate unsupported menu items
* lisp/progmodes/eglot.el (eglot-menu): Do not activate items that
the server does not support.
2025-02-08 13:27:05 +00:00
Eli Zaretskii
36c91fdacc ; Update ldefs-boot.el 2025-02-08 07:40:44 -05:00
Eli Zaretskii
3cd9f62687 Merge from origin/emacs-30
ed9dd4705c ; * admin/authors.el (authors-aliases): Add aliases.
223ee56aae ; Avoid passive tense in Emacs manual
be4cf26c16 Fix gnus-score-find-score-files-function :type
143f1096da Improve documentation of 'file-name-concat'
2025-02-08 07:36:34 -05:00
Eli Zaretskii
ed9dd4705c ; * admin/authors.el (authors-aliases): Add aliases. 2025-02-08 14:06:00 +02:00
Eli Zaretskii
ad157a86ea ; * etc/NEWS: Fix last change (bug#76123). 2025-02-08 14:01:17 +02:00
shipmints
3123562866 Eliminate savehist duplicated symbols
* lisp/savehist.el (savehist-save): Do not save symbols
duplicated between 'savehist-minibuffer-history-variables'
and 'savehist-additional-variables'.  (Bug#76123)
* test/lisp/savehist-tests.el: New file.
2025-02-08 13:57:44 +02:00
Eli Zaretskii
223ee56aae ; Avoid passive tense in Emacs manual
* doc/lispref/variables.texi (Defining Variables): Avoid passive
tense (bug#76135).
2025-02-08 13:47:11 +02:00
Jared Finder
b023d43ee7 Cleanup tool-bar-mode documentation
* doc/emacs/frames.texi (Tool Bars): Downcase concept index
text.
* lisp/cus-start.el (standard): Copy custom :tag strings
from window-tool-bar-style's, which are more descriptive.
(Bug#75844)
2025-02-08 13:14:25 +02:00
Jared Finder
72bbbff7e8 Update window-tool-bar
Add support for the remaining tool bar item specs, new user
option `window-tool-bar-style', and add support for older
Emacs versions.

* doc/emacs/windows.texi (Window Tool Bar): Add documentation
for new user option `window-tool-bar-style'.
* lisp/window-tool-bar.el
(customize-package-emacs-version-alist): Add package-version to
Emacs version mapping.
(window-tool-bar-string): Do not show spacers after hidden
buttons.
(window-tool-bar--keymap-entry-to-string): Call new function
`window-tool-bar--style'.  Add handling for :visible, :filter,
:button, :vert-only, and :help item specs.  Show key bindings.
(window-tool-bar--last-command-triggers-refresh-p): Use "cannot"
in comment.
(window-tool-bar--allow-images): Delete this, it is replaced by
new user option `window-tool-bar-style'.
(window-tool-bar--use-images): Delete this, it is replaced by
new function `window-tool-bar--style'.
(window-tool-bar--turn-on): Move earlier in file, no changes.
(window-tool-bar-style): New user option supporting all values
`tool-bar-style' supports as well as inheriting from
tool-bar-style.
(window-tool-bar--style): New function to calculate active tool
bar style based on `window-tool-bar-style', `tool-bar-style',
and frame capabilities.
(global-window-tool-bar-mode, window-tool-bar-button)
(window-tool-bar-button-hover, window-tool-bar-button-disabled):
Retroactively add package-version.
(window-tool-bar-button-checked)
(window-tool-bar-button-checked-hover): New faces for :button
item spec.
(window-tool-bar--get-keymap): Call new function
`window-tool-bar--style'.  (Bug#75844)
2025-02-08 13:13:30 +02:00
Jostein Kjønigsen
535eec8144 lisp/progmodes/csharp-mode.el: Improve string-interpolation
Correctly fontify expressions inside string-interpolations.
(Bug#75580)
2025-02-08 12:54:25 +02:00
Eli Zaretskii
512187feb0 * lisp/mouse.el (mouse-skip-word): Avoid errors at EOB. (Bug#75965) 2025-02-08 12:41:36 +02:00
Björn Bidar
628e3cb22d Add 'nnregistry-request-group' function for 'gnus-refer-article'
nnregistry doesn't handle any servers or groups; however we have to
define the dummy function so Gnus-registry works as refer article
method, as the `gnus-check-group-server' function requires it.
The latter function is called when referring to articles to check the
source group first before actually requesting any articles.
* lisp/gnus/nnregistry.el (nnregistry-request-group): New deffoo.
(Bug#22414)
2025-02-08 11:14:48 +02:00
Nicolas Despres
77ff0df588 Prioritize split along the longest edge by default.
Currently, `split-window-sensibly' prefers to try to split
vertically first, disregarding the actual shape of the frame
or the user preferences.  This is a good default when Emacs
is taller than wider.  However, when Emacs is in full-screen
(landscape screen layout), trying to split vertically may not
be what the user expected, since there is plenty of space
available on the right.

Typical scenario: Emacs is in landscape layout, one buffer is
open in a window covering the entire frame.  Another buffer is
opened in a second window (C-x 4 f). Both splits are feasible
but users may prefer the horizontal one.

This patch preserves the behavior of the `split-height-threshold'
and `split-width-threshold' variables.  Splitting continues not
to be permitted if the edge length is below the threshold.

* lisp/window.el (split-window-sensibly): First tried split
direction follows user preferences.

* etc/NEWS: Add an entry for new variable
`split-window-preferred-direction'.
* doc/emacs/windows.texi: Document new variable.
2025-02-08 10:57:07 +02:00
F. Jason Park
028913c446 ; Make ERC test fixture more robust
* test/lisp/erc/erc-tests.el (erc-tests--assert-printed-in-subprocess):
Scan for sentinel before reading.
(erc--find-mode, erc--essential-hook-ordering): Use contrived :result
protocol expected by `erc-tests--assert-printed-in-subprocess'.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-create-subprocess): Divert stderr to messages buffer.
2025-02-07 20:24:18 -08:00
F. Jason Park
e9408918f4 More clearly define local module behavior in ERC
* doc/misc/erc.texi (Modules): Label all local modules as being such.
Move `querypoll' to the auxiliary section.  Rework entire "Local
Modules" portion.
* lisp/erc/erc-goodies.el (erc-keep-place-indicator-mode)
(erc-command-indicator-mode): Mention what buffer types they operate in.
* lisp/erc/erc-nicks.el (erc-nicks-mode): Mention the mode is enabled in
all buffers.
* lisp/erc/erc-notify.el (erc-querypoll-mode): Mention which buffers it
operates in.
* lisp/erc/erc-sasl.el (erc-sasl-mode): Disable completely in target
buffers so its mode variable is nil.
* lisp/erc/erc-services.el (erc-services-regain-mode): Disable in target
buffers.
* lisp/erc/erc.el (erc-open): When activating local modules, skip those
that have just been enabled by a fellow module.  Do this even though
their setup code is meant to be idempotent.
* test/lisp/erc/erc-scenarios-base-local-modules.el
(erc-scenarios-base-local-modules--toggle-helpers): Revise to assert
current behavior.  (Bug#57955)
2025-02-07 20:21:36 -08:00
Paul Eggert
0e4883f18e Update from Gnulib by running admin/merge-gnulib 2025-02-07 16:52:07 -08:00
Stefan Kangas
93206cbcea Remove leading '*' from docstrings in cc-vars.el
* lisp/progmodes/cc-vars.el (c-make-font-lock-extra-types-blurb):
Remove leading '*' from generated docstrings.  (Bug#75793)
2025-02-07 22:30:27 +01:00
Mauro Aranda
be4cf26c16 Fix gnus-score-find-score-files-function :type
* lisp/gnus/gnus-score.el (gnus-score-find-score-files-function): Delete
extra quotes.  (Bug#76118)
2025-02-07 22:04:51 +01:00
João Távora
7169a5d563 Eglot: fix bug in eglot--lookup-mode
When lookup in eglot-server-programs fails, fall back to a
half-decent (((foo-mode . "foo")) . nil) return value.  This
enables interactive M-x eglot for modes not yet registered in
e-s-p.

* lisp/progmodes/eglot.el (eglot--lookup-mode): Fallback when
lookup fails.
2025-02-07 20:34:03 +00:00
Stefan Kangas
0c0f5f5df2 Mark IRIX support in GUD as obsolete
* lisp/progmodes/gud.el (gud-irix-p, gud-dbx-use-stopformat-p)
(gud-irixdbx-marker-filter): Mark as obsolete.  We stopped supporting
IRIX in Emacs 26.1 (commit 6bc8689c04).
* lisp/progmodes/gud.el (dbx): Suppress obsoletion warnings.
2025-02-07 21:22:38 +01:00
Stephen Gildea
280b25e009 time-stamp: Better handling of some edge cases
* lisp/time-stamp.el (time-stamp-count): Require confirmation if large.
(time-stamp-once): Correctly handle a start regexp matching 0 chars.
* test/lisp/time-stamp-tests.el (time-stamp-custom-start): New test.
2025-02-07 09:18:04 -08:00
Robert Pluim
a62b58648a ; * src/keyboard.c (syms_of_keyboard): Fix previous change. 2025-02-07 15:55:28 +01:00
Michael Albinus
0065c9dbb8 Suppress unneded events in special-event-map
* src/keyboard.c (keys_of_keyboard): Don't add ns-put-working-text
and ns-unput-working-text to Vspecial_event_map unless on NS port.
2025-02-07 15:14:47 +01:00
Michael Albinus
8be3be7330 Use insert-special-event in Tramp
* lisp/net/tramp-gvfs.el (tramp-gvfs-monitor-process-filter):
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter)
(tramp-sh-inotifywait-process-filter): Use `insert-special-event'
if possible.
2025-02-07 14:41:58 +01:00
João Távora
1ef9de69b3 Eglot: add support for call and type hierarchies
* lisp/progmodes/eglot.el (eglot--lsp-interface-alist): Add new
interfaces.
(eglot-client-capabilities): Advertise support for callHierarchy
and typeHierarchy.
(eglot-ignored-server-capabilities): Add new providers.
(eglot--goto): New helper.
(eglot-menu): Add new menu items.
(eglot-handle-request window/showDocument): Use eglot--goto.
(button, tree-widget): Require them.
(eglot--hierarchy-item): New button type.
(eglot--hierarchy-interactive, eglot--hierarchy-children)
(eglot--hierarchy-label, eglot--hierarchy-1, eglot--hierarchy-2):
New internal functions.
(eglot--define-hierarchy-command): New macro.
(eglot-show-type-hierarchy, eglot-show-call-hierarchy)
(eglot-hierarchy-center-on-node): New commands.
(eglot--hierarchy-roots, eglot--hierarchy-specs): New local variables.
(eglot-hierarchy-label-map): New keymap.
(eglot-hierarchy-mode): New major mode.

* doc/misc/eglot.texi (Eglot Commands, Eglot Features): Describe
new feature.

* etc/EGLOT-NEWS (Changes in upcoming Eglot): Mention new feature.
2025-02-07 12:22:36 +00:00
Eli Zaretskii
f806b9cba6 ; * src/keyboard.c (Finsert_special_event): Don't use "//". 2025-02-07 13:37:56 +02:00
Michael Albinus
d41178368e New function insert-special-event and special event sleep-event
* doc/lispref/commands.texi (Misc Events): Add sleep-event.
(Special Events): New function insert-special-event.

* etc/NEWS: New function insert-special-event.  New event 'sleep-event'.
Fix typos.

* src/keyboard.c (Finsert_special_event): New defun.
(syms_of_keyboard): Declare Qsleep_event.  Define subroutine
Sinsert_special_event.  Add sleep-event to Vspecial_event_map.
(Bug#63620)
(kbd_buffer_get_event, make_lispy_event)
(init_while_no_input_ignore_events, is_ignored_event):
* src/termhooks.h (event_kind): Add SLEEP_EVENT.
2025-02-07 12:04:05 +01:00
Gerd Möllmann
92aecdfd9f ; Fix files-tests
* test/lisp/files-tests.el (files-tests--with-buffer-offer-save):
Override symbol function of read-key instead of read-event.
2025-02-07 11:27:06 +01:00
Juri Linkov
f6e6585f57 * lisp/progmodes/sh-script.el (bash-ts-mode): Improve treesit settings.
Add 'list' and 'sentence' things to treesit-thing-settings,
and move mistakenly added 'sentence' to 'text' (bug#73404).
Set 'treesit-defun-name-function' and 'treesit-simple-imenu-settings'.
Reset 'outline-regexp'.
2025-02-07 09:47:41 +02:00
Po Lu
1751739152 Prevent crash when requesting storage permissions on Android
* java/org/gnu/emacs/EmacsService.java (requestStorageAccess30):
Handle ActivityNotFoundException.
2025-02-07 11:11:51 +08:00
Tassilo Horn
be316dc1c7 ; Use an uninterned symbol in the inhibit-auto-revert expansion. 2025-02-06 20:07:09 +01:00
Michael Albinus
811d575336 ; Rename internal variable in inhibit-auto-revert
* lisp/autorevert.el (inhibit-auto-revert): Call internal variable
`iar-buf' in order not to mismatch with variables outside the macro.
2025-02-06 16:56:07 +01:00
Eli Zaretskii
143f1096da Improve documentation of 'file-name-concat'
* doc/lispref/files.texi (Directory Names):
* src/fileio.c (Ffile_name_concat): Advise not to use
'file-name-concat' unless necessary.  (Bug#76023)
2025-02-06 10:42:04 +02:00