]> git.eshelyaron.com Git - emacs.git/log
emacs.git
12 days agoRemove Emacs 23 compat code from ox-publish.el
Stefan Kangas [Fri, 28 Feb 2025 02:02:15 +0000 (03:02 +0100)]
Remove Emacs 23 compat code from ox-publish.el

* lisp/org/ox-publish.el (org-publish-timestamp-filename): Remove
Emacs 23 compat code.

(cherry picked from commit becdfb11a5b13bc773729236763e99e513806451)

12 days agoDon't use incf/decf in eldoc.el
Stefan Kangas [Fri, 28 Feb 2025 01:20:40 +0000 (02:20 +0100)]
Don't use incf/decf in eldoc.el

* lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Don't use incf or
decf.  This is a :core package and supports Emacs 26.3.  (Bug#76604)

(cherry picked from commit 64edd5a5eb832c2ca9f4495c17e880a86179f826)

12 days agoAdd test for apply-partially
Stefan Kangas [Thu, 27 Feb 2025 23:33:00 +0000 (00:33 +0100)]
Add test for apply-partially

* test/lisp/subr-tests.el (subr-test-apply-partially): New test.

(cherry picked from commit 4ea2197f726835951ea55e04b88d212778676da1)

12 days agoSupport alternative range function for tree-sitter range settings
Yuan Fu [Fri, 28 Feb 2025 01:18:28 +0000 (17:18 -0800)]
Support alternative range function for tree-sitter range settings

Some embedded parser needs to exclude child nodes from the
range, like markdown-inline.  So I added this keyword that
allows users to customize the range for the embedded parser.
This can also be potentially useful for markdown comments in
rust, for example, because we want to exclude the comment
starters (//) from the embedded markdown parser.

* lisp/treesit.el (treesit-query-range):
(treesit-query-range-by-language): Add new parameter RANGE-FN.
(treesit-range-settings): Add new field RANGE-FN.
(treesit-range-rules): Add new keyword RANGE-FN.
(treesit-range-fn-exclude-children): New function.
(treesit--update-ranges-non-local):
(treesit--update-ranges-local):
(treesit--update-range-1): Support the RANGE-FN field.

(cherry picked from commit 8a3e19f4b39be68c22e056d56adb86397e25a673)

12 days agoMake treesit-node-at take advantage of the embed-level property
Yuan Fu [Thu, 27 Feb 2025 12:06:36 +0000 (04:06 -0800)]
Make treesit-node-at take advantage of the embed-level property

* lisp/treesit.el (treesit-node-at): Select the local parser
with the highest embed-level.

(cherry picked from commit 8a45c2da226e188420956fd6269f72db3f437e38)

12 days agoRework range facility in treesit.el to support arbitrary nesting
Yuan Fu [Thu, 27 Feb 2025 11:10:47 +0000 (03:10 -0800)]
Rework range facility in treesit.el to support arbitrary nesting

Make use of the newly added embed-level parser property, we now
iterativeLy create/update embedded parsers at each embed level,
allowing arbitrary levels of nesting.

At the beginning, we start with the primary parser.  We query it
with each range settings, gets some ranges and their
corresponding language. Then we create the first level of
embedded parsers using the ranges and language we got.  This is
one iteration. For the next iteration/level, we start with the
embedded parsers we create/updated in the previous
iteration/level, and query each of them with each of the range
settings, creating/updating the next level of embedded parsers.
And we keep doing this until we don't get more matches from the
queries.

We now also support the :embed keyword in 'treesit-range-rules'
to be a function that returns a language.  This allows major
modes like markdown and org mode to support code blocks of which
the language isn't known ahead of time.

* lisp/treesit.el (treesit-primary-parser): Move to front.
(treesit-query-range-by-language): New function.
(treesit-range-rules): Allow :embed to be a function, update docstring.
(treesit-local-parsers-on): Update docstring.
(treesit--parser-at-level):
(treesit--update-ranges-non-local): New functions.
(treesit--update-ranges-local): Use the new logic, support
:embed being a function.
(treesit--update-range-1): New function, has the meat of
original treesit-update-ranges.
(treesit-update-ranges): Implements the iteration logic using
treesit--update-range-1 to do the actual work.

(cherry picked from commit 1314272bf398e068385572ca16d4dfcd55a48828)

12 days agoEnable treesit-query-capture to return grouped captures
Yuan Fu [Thu, 27 Feb 2025 11:07:34 +0000 (03:07 -0800)]
Enable treesit-query-capture to return grouped captures

This is needed for creating embedded parsers for embedded code
blocks of which language cannot be known ahead of time.  E.g.,
markdown and org mode's code block.

* src/treesit.c (Ftreesit_query_capture): Add parameter GROUPED.

(cherry picked from commit 625b2b02a3c9bad6d7abf57ea7f95ece29855906)

12 days agoAdd tree-sitter-parser-embed-level and parent-node
Yuan Fu [Thu, 27 Feb 2025 11:05:26 +0000 (03:05 -0800)]
Add tree-sitter-parser-embed-level and parent-node

Add parser properties embed-level and parent-node. They'll be
help us implement arbitrarily nested embeded parser, and
navigation across embedded and host parsers, respectively.

* src/treesit.c:
(Ftreesit_parser_embed_level):
(Ftreesit_parser_set_embed_level):
(Ftreesit_parser_parent_node):
(Ftreesit_parser_set_parent_node): New functions.

(cherry picked from commit 30e1508ef2d40e221736cea2c50c64941d7d2f0d)

12 days agoDon't overwrite non-local exit symbol and data (Bug#65796).
Philipp Stephani [Thu, 30 Jan 2025 15:12:49 +0000 (16:12 +0100)]
Don't overwrite non-local exit symbol and data (Bug#65796).

The previous approach would incorrectly invalidate the returned module
values if another non-local exit occurred while dealing with a non-local
exit.  See Bug#65796.  Instead, allocate the values from the usual
environment storage, and return statically-allocated objects if that
fails.

* src/emacs-module.c (struct emacs_env_private): Turn non-local exit
symbol and data into normal Lisp objects.
(initialize_environment): Initialize them.
(mark_module_environment): Prevent them from being garbage-collected.
(module_signal_or_throw, module_non_local_exit_signal_1)
(module_non_local_exit_throw_1): Adapt uses.
(value_to_lisp): No longer scan for them with module assertions enabled.
(module_out_of_memory_signal, module_out_of_memory_data): New
statically-allocated module values to return in case of allocation
failure.
(syms_of_module): Initialize them.
(module_non_local_exit_get): Allocate module values normally.  If that
fails, return statically-allocated values.

* doc/lispref/internals.texi (Module Nonlocal): Document new behavior.

(cherry picked from commit 32da093e524d5e28945557701f7c50d7c4a898cd)

12 days agoRecommend 'tab-bar-history-mode' over 'winner-mode'
Visuwesh [Thu, 20 Feb 2025 14:49:32 +0000 (20:19 +0530)]
Recommend 'tab-bar-history-mode' over 'winner-mode'

* lisp/winner.el (winner-mode):
* lisp/tab-bar.el (tab-bar-mode): Update the docstring to
suggest 'tab-bar-history-mode' instead of 'winner-mode' when
using 'tab-bar-mode' instead.  (Bug#76439)

(cherry picked from commit ea715b0183f6a19d491cad36eb18c2c9cf0f0dd3)

12 days agoFix CSS indentation, added support for CSS 'color_value'.
Vincenzo Pupillo [Wed, 19 Feb 2025 20:47:23 +0000 (21:47 +0100)]
Fix CSS indentation, added support for CSS 'color_value'.

* lisp/textmodes/mhtml-ts-mode.el
(mhtml-ts-mode--colorize-css-value): Added 'color_value' node, refactoring.
(mhtml-ts-mode--treesit-font-lock-settings): Added 'color_value' node.
(mhtml-ts-mode--treesit-indent-rules): Removed the old comment and
fixed the CSS indentation rule (bug#76597).

(cherry picked from commit 5f1a019d26f475f35fe8efc583749321affb6060)

12 days agoDocument :continue-only in use-package Info manual
Paul Nelson [Thu, 27 Feb 2025 09:30:13 +0000 (10:30 +0100)]
Document :continue-only in use-package Info manual

* doc/misc/use-package.texi (Binding to repeat-maps): Document
:continue-only (bug#74140).

(cherry picked from commit 3e1d7e0334d884a17887bd1b9ee6a9b9e3026a30)

12 days agoImprove 'treesit-outline-search'
Juri Linkov [Thu, 27 Feb 2025 17:21:45 +0000 (19:21 +0200)]
Improve 'treesit-outline-search'

* lisp/treesit.el (treesit-outline-search): Add optional arg
'recursive' to avoid infinite recursion when it gets stuck.

* lisp/textmodes/markdown-ts-mode.el (markdown-ts-mode):
Set buffer-local 'treesit-outline-predicate' to "section".

(cherry picked from commit dc1637fef7c658b6d865f3e71f3b95686e56542d)

12 days agoPrevent a todo-mode test from running with 'make check'
Stephen Berman [Thu, 27 Feb 2025 11:13:26 +0000 (12:13 +0100)]
Prevent a todo-mode test from running with 'make check'

* test/lisp/calendar/todo-mode-tests.el
(todo-test-add-and-delete-file): Tag this test as unstable, since
it has been reported to fail unreproducibly (bug#58473) or
reproducibly only on the ZFS filesystem (bug#76381) and the causes
are still unknown.

(cherry picked from commit 4cc5e4ec0bc6c11a19ca0244f60813619acd718d)

12 days agoPrevent a todo-mode test from running with 'make check'
Stephen Berman [Thu, 27 Feb 2025 11:03:24 +0000 (12:03 +0100)]
Prevent a todo-mode test from running with 'make check'

* test/lisp/calendar/todo-mode-tests.el
(todo-test-add-and-delete-file): Tag this test as unstable, since
it has been reported to fail unreproducibly (bug#58473) or
reproducibly only on the ZFS filesystem (bug#76381) and the causes
are still unknown.

(cherry picked from commit 13423cd0197fa69bd6246f0720471b265c328596)

12 days agoPrevent a todo-mode test from running with 'make check'
Stephen Berman [Thu, 27 Feb 2025 10:51:22 +0000 (11:51 +0100)]
Prevent a todo-mode test from running with 'make check'

* test/lisp/calendar/todo-mode-tests.el
(todo-test-add-and-delete-file): Tag this test as unstable, since
it has been reported to fail unreproducibly (bug#58473) or
reproducibly only on the ZFS filesystem (bug#76381) and the causes
are still unknown.

(cherry picked from commit f5f0ba38e0e22c9017d1c8482fbe4432a87ed8af)

12 days agoFix drag-and-drop treatment of reused tooltip frames
Po Lu [Thu, 27 Feb 2025 01:53:41 +0000 (09:53 +0800)]
Fix drag-and-drop treatment of reused tooltip frames

* src/androidfns.c (Fx_show_tip): Set `tip_window' to that of
any reused tooltip frame.

* src/haikufns.c (unwind_create_frame): Return whether the frame
was destroyed, as on X.
(unwind_create_tip_frame, haiku_create_frame, Fx_show_tip):
Synchronize with X.
(do_unwind_create_frame): New function.
(tip_window): Remove unused variable.

* src/nsfns.m (tip_window, unwind_create_tip_frame): Remove
unused variable `tip_window'.

* src/pgtkfns.c (pgtk_create_tip_frame): Rename to
pgtk_create_tip_frame.
(Fx_show_tip): Adjust accordingly.  Set `tip_window' to that of
any reused tooltip frame.

* src/w32fns.c (Fx_show_tip):

* src/xfns.c (Fx_show_tip): Set `tip_window' to that of any
reused tooltip frame.

(cherry picked from commit a4a458ffa4aaeb988ff4b6e6087c44dfdaf40a0b)

12 days agoAdd :continue-only directive to bind-keys and use-package
Paul Nelson [Sat, 22 Feb 2025 22:12:41 +0000 (23:12 +0100)]
Add :continue-only directive to bind-keys and use-package

* lisp/bind-key.el (bind-keys-form): Add :continue-only binding.
Fix indentation.

* lisp/use-package/use-package-bind-key.el
(use-package-normalize-binder): Add check for :continue-only.

* test/lisp/repeat-tests.el (repeat-tests-bind-keys):
Enable (and correct) test for :continue-only (bug#74140).

(cherry picked from commit 85a9b916db126add5a5e2bf4b2b9531ab998cad4)

12 days ago* src/dispnew.c (rect_intersect): Fix a typo (bug#76592)
Gerd Möllmann [Thu, 27 Feb 2025 05:56:02 +0000 (06:56 +0100)]
* src/dispnew.c (rect_intersect): Fix a typo (bug#76592)

(cherry picked from commit 3de9994b9e7acf2a05e6b661a7cd440b7cb0365b)

12 days ago; Whitespace fixes to silence git hooks
Stefan Kangas [Wed, 26 Feb 2025 17:11:22 +0000 (18:11 +0100)]
; Whitespace fixes to silence git hooks

(cherry picked from commit 8c165834913bb0dca214acc4b82ba1d9d4ac0a82)

12 days ago(define-ibuffer-op): Minor tweak to Shipmints's patch
Stefan Monnier [Wed, 26 Feb 2025 14:13:04 +0000 (09:13 -0500)]
(define-ibuffer-op): Minor tweak to Shipmints's patch

* lisp/ibuf-macs.el (define-ibuffer-op): Evaluate `(active-)opstring`
args when defining the operation rather than every time the operation
is used.  Move the `:autoload-end` marker back to the level of `progn`.

(cherry picked from commit 5815bd52279fdedc752f9f92ace86f8243fbd604)

12 days agoImprove 'define-ibuffer-op' macro (bug#76222)
shipmints [Mon, 24 Feb 2025 22:45:54 +0000 (17:45 -0500)]
Improve 'define-ibuffer-op' macro (bug#76222)

* lisp/ibuf-macs.el (define-ibuffer-op):
Change defun to defalias and place it before the macro-local lets.
* lisp/ibuffer.el:
(ibuffer-do-toggle-lock): Remove declare-function.
(ibuffer-do-toggle-read-only): Remove declare-function.
(ibuffer-do-save): Remove declare-function.
(ibuffer-do-delete): Remove declare-function.
(ibuffer-do-toggle-modified): Remove declare-function.
(ibuffer-do-kill-on-deletion-marks): Remove declare-function.

(cherry picked from commit 5d75c6e44da9f27d28ff60d5dee308f2247a1cf5)

12 days ago; * test/infra/android/test-controller.el: Fix typos.
Po Lu [Wed, 26 Feb 2025 13:22:03 +0000 (21:22 +0800)]
; * test/infra/android/test-controller.el: Fix typos.

(cherry picked from commit 7ae069b676a19d9a477d629403e2ff236a5303af)

12 days ago; New function for executing Android tests in batch mode
Po Lu [Wed, 26 Feb 2025 12:41:02 +0000 (20:41 +0800)]
; New function for executing Android tests in batch mode

* test/infra/android/test-controller.el
(ats-execute-tests-batch): New function.

(cherry picked from commit 67b444e2907da1a27fc2db64aae9b4dcf299f2d9)

12 days agoPort Eshell tests to Android
Po Lu [Wed, 26 Feb 2025 08:03:12 +0000 (16:03 +0800)]
Port Eshell tests to Android

* test/infra/android/test-controller.el (ats-run-test): Run
tests in a temp buffer.

* test/lisp/eshell/em-alias-tests.el (ert, em-alias)
(eshell-tests-helpers):

* test/lisp/eshell/em-basic-tests.el (em-basic)
(eshell-tests-helpers):

* test/lisp/eshell/em-cmpl-tests.el (em-unix)
(eshell-tests-helpers):

* test/lisp/eshell/em-dirs-tests.el (em-dirs)
(eshell-tests-helpers):

* test/lisp/eshell/em-extpipe-tests.el (ert-x)
(eshell-tests-helpers):

* test/lisp/eshell/em-glob-tests.el (ert, eshell-tests-helpers):

* test/lisp/eshell/em-hist-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/em-pred-tests.el (em-pred)
(eshell-tests-helpers):

* test/lisp/eshell/em-prompt-tests.el (em-prompt)
(eshell-tests-helpers):

* test/lisp/eshell/em-script-tests.el (em-script)
(eshell-tests-helpers):

* test/lisp/eshell/em-unix-tests.el (ert-x)
(eshell-tests-helpers):

* test/lisp/eshell/esh-arg-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-cmd-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-ext-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-io-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/esh-mode-tests.el (em-prompt)
(eshell-tests-helpers):

* test/lisp/eshell/esh-proc-tests.el (em-prompt)
(eshell-tests-helpers):

* test/lisp/eshell/esh-util-tests.el (esh-util)
(eshell-tests-helpers):

* test/lisp/eshell/esh-var-tests.el (eshell)
(eshell-tests-helpers):

* test/lisp/eshell/eshell-tests.el (esh-mode)
(eshell-tests-helpers): Load `eshell-tests-helpers' from the
resource directory.

* test/lisp/eshell/resources/eshell-tests-helpers.el: Move from
`test/lisp/eshell'.

(cherry picked from commit 3e496fc31746517440285c2cd9f2b4a09c227d7b)

12 days agoAvoid display bugs after editable-field widgets
Mauro Aranda [Wed, 26 Feb 2025 11:06:14 +0000 (08:06 -0300)]
Avoid display bugs after editable-field widgets

* lisp/wid-edit.el (widget-specify-button): Don't add an
invisible space before the button to avoid bugs that surface
with the widget-field face.  The Widget library is not
the one that puts a :box attribute for the button face, and we
can't control what library users put after editable-field
widgets.

(widget-specify-field): Rather, add the invisible space here,
after the newline.  That way, we protect whatever comes after
the editable-field widget.  (Bug#51550)

(cherry picked from commit 86dd455e9c7402737e2c0c45190fabbf1d3ee8c1)

12 days agoNew macro 'case'
Eshel Yaron [Fri, 28 Feb 2025 09:46:47 +0000 (10:46 +0100)]
New macro 'case'

2 weeks ago; * lisp/completion-preview.el: Add some commentary.
Eshel Yaron [Wed, 26 Feb 2025 20:14:37 +0000 (21:14 +0100)]
; * lisp/completion-preview.el: Add some commentary.

Clarify the relation of Completion Preview mode with
'completion-at-point' and in-buffer completion interfaces.

2 weeks ago(lisp-delete-backward): Fix handling of closing string quote
Eshel Yaron [Wed, 26 Feb 2025 19:47:28 +0000 (20:47 +0100)]
(lisp-delete-backward): Fix handling of closing string quote

2 weeks agoAdd 'help-echo' hint to completion preview
Eshel Yaron [Wed, 26 Feb 2025 19:41:09 +0000 (20:41 +0100)]
Add 'help-echo' hint to completion preview

* lisp/completion-preview.el
(completion-preview--propertize-for-mouse): New function.
* lisp/completion-preview.el (completion-preview--update)
(completion-preview--show)
(completion-preview-partial-insert)
(completion-preview-complete)
(completion-preview-next-candidate): Use it to propertize
completion preview text with mouse-related properties,
including a new 'help-echo' hint.

2 weeks agoSimplify 'completion-preview-active-mode' command tagging
Eshel Yaron [Wed, 26 Feb 2025 19:11:20 +0000 (20:11 +0100)]
Simplify 'completion-preview-active-mode' command tagging

* lisp/completion-preview.el (completion-preview-insert)
(completion-preview-insert-word)
(completion-preview-insert-sexp)
(completion-preview-complete)
(completion-preview-prev-candidate)
(completion-preview-next-candidate): Use 'interactive' to
associate command with 'completion-preview-active-mode'
instead of using a bespoke 'completion-predicate' property.
(completion-preview-active-p): Declare obsolete.

2 weeks agoscope.el: Improve cl-loop analysis
Eshel Yaron [Wed, 26 Feb 2025 18:50:28 +0000 (19:50 +0100)]
scope.el: Improve cl-loop analysis

2 weeks agoAvoid format-mode-line in eglot-mode-line-format
Eshel Yaron [Wed, 26 Feb 2025 11:04:08 +0000 (12:04 +0100)]
Avoid format-mode-line in eglot-mode-line-format

2 weeks ago; Skip commit ea12982ebedd89529c0265dec117db88e7e9ca40
Eshel Yaron [Wed, 26 Feb 2025 09:43:16 +0000 (10:43 +0100)]
; Skip commit ea12982ebedd89529c0265dec117db88e7e9ca40

2 weeks agoMake define-global-minor-mode alias obsolete
Stefan Kangas [Wed, 26 Feb 2025 05:37:52 +0000 (06:37 +0100)]
Make define-global-minor-mode alias obsolete

* lisp/emacs-lisp/easy-mmode.el (define-global-minor-mode): Make alias
for old name obsolete, just in time for its 20th anniversary.
* test/lisp/emacs-lisp/lisp-mode-tests.el (test-font-lock-keywords):
* lisp/progmodes/subword.el (global-subword-mode)
(global-superword-mode): Don't use above obsolete name.
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression)
(lisp-fdefs): Remove syntax highlighting for obsolete name.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Add comment mentioning the obsolete status of above alias.
* doc/lispref/loading.texi (Autoload): Don't document obsolete name.

(cherry picked from commit b4d1061b82a6accedc14770669f701945b209813)

2 weeks ago; Cleanup sexp things in 'lua-ts-mode'
john muhl [Mon, 24 Feb 2025 21:21:38 +0000 (15:21 -0600)]
; Cleanup sexp things in 'lua-ts-mode'

* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Remove some
nonsensical entries from 'treesit-thing-settings'.
* test/lisp/progmodes/lua-ts-mode-resources/movement.erts:
Add missing tests for 'backward-sexp'.  (Bug#76534)

(cherry picked from commit 8bc933b64e0582def4c19b4cc633eaabdff625ce)

2 weeks agoDon't enable minor modes in diff-add-log-current-defuns
Stefan Kangas [Wed, 26 Feb 2025 03:36:51 +0000 (04:36 +0100)]
Don't enable minor modes in diff-add-log-current-defuns

* lisp/vc/diff-mode.el (diff-add-log-current-defuns): Don't run mode
hooks when enabling major mode hooks.  That fails if, for example,
paredit-mode is on emacs-lisp-mode-hook and it signaled due to
unbalanced parens.

(cherry picked from commit 539772135222755255a3c8ca0cdda73dc4d742b2)

2 weeks agoAdapt a number of regression tests to Android
Po Lu [Wed, 26 Feb 2025 03:33:05 +0000 (11:33 +0800)]
Adapt a number of regression tests to Android

* test/infra/android/test-controller.el (ats-run-test): Strip
text properties from value string.  Inhibit text conversion.

* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--locate-symbols):

* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display)
(test-read-multiple-choice, test-read-multiple-choice-help):
Skip on Android in some wise or another.

(cherry picked from commit 2938afab3685f29c80d67f179ce8a935f6c27921)

2 weeks ago; Skip commit ecde11a83cfcfbb7c5ff1a7244464f53a7c68687
Eshel Yaron [Wed, 26 Feb 2025 09:41:45 +0000 (10:41 +0100)]
; Skip commit ecde11a83cfcfbb7c5ff1a7244464f53a7c68687

2 weeks ago; Improve Android testing facilities
Po Lu [Wed, 26 Feb 2025 02:35:00 +0000 (10:35 +0800)]
; Improve Android testing facilities

* test/infra/android/test-controller.el (ats-eval): Don't block
other processes.
(ats-run-test): Bind ert-remote-temporary-file-directory to nil
and always print messages into the output buffer.
(ats-upload-all-tests): New function.
(ats-run-all-tests): New argument SELECTOR.  Only execute
already uploaded tests.

(cherry picked from commit c2804f928097ddea4826b232e310417320bb5ce0)

2 weeks agoEnable auto-revert-tests to pass on Android
Po Lu [Wed, 26 Feb 2025 02:33:30 +0000 (10:33 +0800)]
Enable auto-revert-tests to pass on Android

* lisp/emacs-lisp/ert-x.el
(ert-remote-temporary-file-directory): Define to null-device on
Android.

* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Provide for
situations where the watch descriptor is recreated by the
polling timer after a file notification is received.

(cherry picked from commit c5853892c58be8e1c543177967850dceb1f4bcbc)

2 weeks agoGuarantee delivery of inotify special events
Po Lu [Wed, 26 Feb 2025 01:56:46 +0000 (09:56 +0800)]
Guarantee delivery of inotify special events

* src/inotify.c (inotifyevent_to_event): Always match events
that are not encompassed by IN_ALL_EVENTS and which the
documentation implies are always delivered to callbacks.

* test/src/inotify-tests.el (inotify-file-watch-stop-delivery):
New test.

(cherry picked from commit 928dc34e05fc04a9b8394df477beca2ef6d9fd1b)

2 weeks ago; Prefer incf/decf in image-dired
Stefan Kangas [Wed, 26 Feb 2025 02:15:37 +0000 (03:15 +0100)]
; Prefer incf/decf in image-dired

* lisp/image/image-dired-dired.el (image-dired-mark-tagged-files):
* lisp/image/image-dired.el (image-dired-gallery-generate):
Prefer incf/decf.

(cherry picked from commit 68f9a7aac1f5b9606ca6245e1dd74d09087752d4)

2 weeks ago; Skip commit 7fe90ca77d0c21165cb9d98d5c42d6b6c6275ef3
Eshel Yaron [Wed, 26 Feb 2025 09:41:18 +0000 (10:41 +0100)]
; Skip commit 7fe90ca77d0c21165cb9d98d5c42d6b6c6275ef3

2 weeks ago; Add missing require to wdired.el
Stefan Kangas [Wed, 26 Feb 2025 02:01:15 +0000 (03:01 +0100)]
; Add missing require to wdired.el

(cherry picked from commit dfcfb9792cfa9dacb890ab7e5b63e3adbe1cc6c0)

2 weeks agoPrefer incf to cl-incf in remaining files
Stefan Kangas [Sun, 23 Feb 2025 01:55:14 +0000 (02:55 +0100)]
Prefer incf to cl-incf in remaining files

* admin/syncdoc-type-hierarchy.el (syncdoc-make-type-table):
* admin/unidata/unidata-gen.el (unidata-gen-table-word-list):
* lisp/arc-mode.el (archive--summarize-descs):
* lisp/auth-source.el (auth-source-forget+):
* lisp/battery.el (battery-linux-proc-acpi, battery-linux-sysfs):
* lisp/calendar/parse-time.el (parse-time-tokenize):
* lisp/calendar/time-date.el (decoded-time-add)
(decoded-time--alter-month, decoded-time--alter-day):
* lisp/cedet/semantic/ede-grammar.el (project-compile-target):
* lisp/dired.el (dired-insert-set-properties):
* lisp/edmacro.el (edmacro-format-keys):
* lisp/epa-file.el (epa-file--replace-text):
* lisp/eshell/esh-cmd.el (eshell-for-iterate):
* lisp/eshell/esh-io.el (eshell-create-handles)
(eshell-duplicate-handles, eshell-protect-handles)
(eshell-copy-output-handle, eshell-buffered-print):
* lisp/font-lock.el (font-lock-fontify-keywords-region):
* lisp/help-fns.el:
* lisp/ibuf-ext.el (ibuffer-generate-filter-groups)
(ibuffer-insert-filter-group-before):
* lisp/ibuffer.el (ibuffer-confirm-operation-on, ibuffer-map-lines):
* lisp/image/image-dired-external.el (image-dired-thumb-queue-run):
* lisp/image/image-dired.el (image-dired-display-thumbs)
(image-dired-line-up):
* lisp/imenu.el (imenu--split):
* lisp/info-xref.el (info-xref-check-node, info-xref-check-all-custom):
* lisp/international/quail.el (quail-insert-decode-map):
* lisp/international/rfc1843.el (rfc1843-decode):
* lisp/mail/ietf-drums-date.el (ietf-drums-date--tokenize-string):
* lisp/mail/ietf-drums.el (ietf-drums-token-to-list):
* lisp/mail/rfc2047.el (rfc2047-qp-or-base64):
* lisp/mail/rfc2231.el (rfc2231-encode-string):
* lisp/mail/yenc.el (yenc-decode-region):
* lisp/mh-e/mh-e.el (mh-xargs):
* lisp/mh-e/mh-folder.el (mh-recenter):
* lisp/mh-e/mh-mime.el (mh-mime-part-index):
* lisp/mh-e/mh-search.el (mh-search):
* lisp/mh-e/mh-thread.el (mh-thread-current-indentation-level):
* lisp/mh-e/mh-utils.el (mh-sub-folders-parse):
* lisp/minibuffer.el (minibuffer--sort-by-position)
(completion-pcm--pattern-point-idx):
* lisp/mpc.el (mpc-cmd-find, mpc-cmd-move, mpc-select-extend)
(mpc-songs-refresh, mpc-songpointer-score)
(mpc-songpointer-refresh-hairy):
* lisp/msb.el (msb--mode-menu-cond, msb--most-recently-used-menu)
(msb--split-menus-2, msb--make-keymap-menu):
* lisp/net/pop3.el (pop3-send-streaming-command):
* lisp/net/puny.el
(puny-encode-complex, puny-decode-string-internal):
* lisp/net/shr-color.el (shr-color-hue-to-rgb):
* lisp/net/soap-client.el (soap-encode-xs-complex-type)
(soap-decode-xs-complex-type, soap-resolve-references-for-operation)
(soap-wsdl-resolve-references):
* lisp/play/5x5.el (5x5-made-move, 5x5-down, 5x5-right):
* lisp/play/decipher.el (key, decipher-mode-syntax-table)
(decipher-add-undo, decipher-complete-alphabet, decipher--analyze)
(decipher--digram-counts, decipher--digram-total):
* lisp/play/hanoi.el (hanoi-move-ring):
* lisp/play/snake.el (snake-reset-game, snake-update-game):
* lisp/profiler.el (profiler-calltree-depth, profiler-calltree-build-1)
(profiler-calltree-build-unified)
(profiler-calltree-compute-percentages):
* lisp/registry.el (registry-reindex):
* lisp/simple.el (completion-list-candidate-at-point):
* lisp/strokes.el (strokes-xpm-to-compressed-string):
* lisp/term.el (term-emulate-terminal, term--handle-colors-list):
* lisp/treesit.el (treesit-node-index, treesit-indent-region):
* lisp/url/url-cookie.el (url-cookie-parse-file-netscape):
* lisp/url/url-dav.el (url-dav-file-name-completion):
* lisp/url/url-queue.el (url-queue-setup-runners)
(url-queue-run-queue):
* lisp/wdired.el (wdired-finish-edit):
* lisp/wid-edit.el (widget-move):
* lisp/window-tool-bar.el (window-tool-bar-string):
* lisp/winner.el (winner-undo):
* lisp/xwidget.el (xwidget-webkit-isearch-forward)
(xwidget-webkit-isearch-backward): Prefer incf to cl-incf.

(cherry picked from commit fa0131723c3d59240c3bf9b6cd6c0d8abc4ef63f)

2 weeks agoPrefer incf to cl-incf in vc/*.el
Stefan Kangas [Wed, 26 Feb 2025 00:48:48 +0000 (01:48 +0100)]
Prefer incf to cl-incf in vc/*.el

* lisp/vc/diff-mode.el (diff-count-matches):
(diff-fixup-modifs, diff-add-log-current-defuns):
* lisp/vc/vc-hg.el (vc-hg--glob-to-pcre):
* lisp/vc/vc-hooks.el (vc-insert-file):
* lisp/vc/vc.el (vc-print-log-setup-buttons, vc-prepare-patch):
Prefer incf to cl-incf.

(cherry picked from commit e60103f130916a4632a108352360cb620c02e9f0)

2 weeks agoHandle multibyte mode line spec chars (bug#76517)
Pip Cet [Mon, 24 Feb 2025 20:46:49 +0000 (20:46 +0000)]
Handle multibyte mode line spec chars (bug#76517)

* src/xdisp.c (display_mode_element): Make 'c' an 'int'.  Use
'string_char_and_length' to fetch the character from a multibyte
string, not 'SREF'.

(cherry picked from commit 1f891898d490380ea59f21fa8ea4e7f7364a1a79)

2 weeks agoImprove 'send-mail-function' defcustom.
Robert Pluim [Fri, 21 Feb 2025 13:20:12 +0000 (14:20 +0100)]
Improve 'send-mail-function' defcustom.

* lisp/mail/sendmail.el (send-mail-function): Provide better
:doc for the available values.

(cherry picked from commit 6f3067324aa83c0e6a44193c81a443d2c98e43d8)

2 weeks agoRespect temporary-file-directory in Android test controller
Po Lu [Tue, 25 Feb 2025 15:20:31 +0000 (23:20 +0800)]
Respect temporary-file-directory in Android test controller

* test/infra/android/test-controller.el (ats-exec-script):
Respect temporary-file-directory.

(cherry picked from commit 5ea0cee19a7a4d88f92e6fab692a17ce295a6698)

2 weeks agoFix bug in Tramp argument computing
Michael Albinus [Tue, 25 Feb 2025 14:50:35 +0000 (15:50 +0100)]
Fix bug in Tramp argument computing

* lisp/net/tramp-sh.el (tramp-ssh-or-plink-options): Return always
a string.  (Bug#76553)

(cherry picked from commit c2d20946059bb78d7ab40060dbdc829c59a16bde)

2 weeks agoImplement commands for executing all tests on connected Android devices
Po Lu [Tue, 25 Feb 2025 14:34:43 +0000 (22:34 +0800)]
Implement commands for executing all tests on connected Android devices

* test/infra/android/test-controller.el (ats-upload-test):
Correct minor encoding error.  Transfer solitary files without
creating a tar archive, and handle `resources' directories.
(ats-list-tests-locally, ats-list-tests): Don't list files in
`resources' directories.  Insert test header locally, and
redisplay after insertion.
(ats-run-all-tests): New function.

(cherry picked from commit 55768eaaaac0702dea9bb686b932af24434c26cb)

2 weeks agoRemove unneded cl-extra require
Robert Pluim [Fri, 14 Feb 2025 15:57:36 +0000 (16:57 +0100)]
Remove unneded cl-extra require

* lisp/international/emoji.el: Remove cl-extra require.

(cherry picked from commit 4101df53cc4d0bb5a913ce374206845d49336a15)

2 weeks agoRemove wallpaper.el runtime dependency on cl-lib/cl-macs.
Robert Pluim [Fri, 14 Feb 2025 15:56:28 +0000 (16:56 +0100)]
Remove wallpaper.el runtime dependency on cl-lib/cl-macs.

* lisp/image/wallpaper.el: Don't require "cl-macs"
unconditionally, instead require "cl-lib", only when compiling.

(cherry picked from commit 6a2dc0bbd93c56b8d3e3bd178735026140b76c36)

2 weeks ago; Fix last change
Michael Albinus [Tue, 25 Feb 2025 11:40:33 +0000 (12:40 +0100)]
; Fix last change

* lisp/net/tramp-cmds.el (tramp-list-remote-buffers)
(tramp-list-remote-buffer-connections): Fix docstring.
(tramp-cleanup-bufferless-connections): Use `string-join'.

(cherry picked from commit c8985a6d9fe955c66bb24c910708957ed88afb55)

2 weeks agoFix a number of ERT tests for execution on Android
Po Lu [Tue, 25 Feb 2025 11:12:37 +0000 (19:12 +0800)]
Fix a number of ERT tests for execution on Android

* test/lib-src/emacsclient-tests.el (emacsclient-test-emacs):

* test/lisp/server-tests.el (server-tests/emacsclient): Don't
assume emacsclient is installed as emacsclient.

(cherry picked from commit 7da9d2d7464496ff684d28b0d37f286ddae70d65)

2 weeks ago; Improve Android regression test execution facilities
Po Lu [Tue, 25 Feb 2025 11:12:06 +0000 (19:12 +0800)]
; Improve Android regression test execution facilities

* test/infra/android/test-controller.el
(ats-associated-process): New variable.
(ats-start-server): Set coding system to `no-conversion'.
(ats-read-connection): If this buffer is associated with a
connection, return the same.
(ats-establish-connection): New arg INTERACTIVE.  Interactively,
open a Lisp interaction buffer with this connection as its
associated process.
(ats-connect): Provide this argument if called interactively.
(ats-eval): New argument RAW.  Request that encoded forms not be
decoded if specified, and decode results.
(ats-remote-eval-defuns, ats-remote-eval-print-sexp)
(ats-remote-eval-for-interaction)
(ats-remote-eval-print-last-sexp, ats-remote-eval-last-sexp)
(ats-remote-eval-defun, ats-remote-eval-region-or-buffer)
(ats-lisp-interaction-mode-map, ats-lisp-interaction-mode-menu)
(ats-lisp-interaction-mode, ats-open-lisp-interaction-buffer)
(ats-emacs-test-directory, ats-upload-test)
(ats-list-tests-locally, ats-list-tests, ats-run-test): New
functions and variables.

* test/infra/android/test-driver.el (ats-eval-do-decode): New
variable.
(ats-process-filter, ats-establish-connection)
(ats-initiate-connection): Adjust correspondingly.

(cherry picked from commit 93a185a1fb874ebbcfdac257b50a3d0700a93fb5)

2 weeks agoAdd tramp-cleanup-bufferless-connections (bug#76417)
shipmints [Tue, 25 Feb 2025 10:34:49 +0000 (11:34 +0100)]
Add tramp-cleanup-bufferless-connections (bug#76417)

* doc/misc/tramp.texi (Cleanup remote connections): Add
'tramp-cleanup-bufferless-connections'.

* etc/NEWS: Announce 'tramp-cleanup-bufferless-connections'.

* lisp/net/tramp-cmds.el:
(tramp-list-remote-buffer-connections): New function.
(tramp-cleanup-bufferless-connections): New command.
(tramp-list-remote-buffers): Account for 'buffer-file-name'.

(cherry picked from commit bea00a07990ebfbe420636363f8d3514571ae79d)

2 weeks ago* doc/misc/ert.texi (Helpers for Buffers): Fix wrong name.
Michael Albinus [Tue, 25 Feb 2025 08:57:30 +0000 (09:57 +0100)]
* doc/misc/ert.texi (Helpers for Buffers): Fix wrong name.

(cherry picked from commit cc8e8b2595ff2ad0c4e4d5805fed1657a5ad504a)

2 weeks agoFix tramp-find-executable
Michael Albinus [Tue, 25 Feb 2025 08:37:28 +0000 (09:37 +0100)]
Fix tramp-find-executable

* lisp/net/tramp-sh.el (tramp-find-executable): Use "command -pv",
it isbetter supported in different shells.  (Bug#76521)

(cherry picked from commit 53eec34da1bf2fb9381680734a99f3fb11225787)

2 weeks agoImprove menu-bar-item-at-x
Gerd Möllmann [Tue, 25 Feb 2025 08:23:58 +0000 (09:23 +0100)]
Improve menu-bar-item-at-x

* lisp/menu-bar.el (menu-bar-item-at-x): Handle case of duplicate keys
in the menu-bar definition.

(cherry picked from commit 41837050181a7cc313f1e9951136f4356601fc4a)

2 weeks agoPrefer incf to cl-incf in progmodes/*.el
Stefan Kangas [Tue, 25 Feb 2025 07:28:30 +0000 (08:28 +0100)]
Prefer incf to cl-incf in progmodes/*.el

* lisp/progmodes/bug-reference.el (bug-reference--overlay-bounds):
* lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset):
* lisp/progmodes/compile.el (compilation--note-type):
* lisp/progmodes/ebrowse.el (ebrowse-files-table)
(ebrowse-fill-member-table, ebrowse-find-pattern)
(ebrowse-draw-member-short-fn, ebrowse-gather-statistics):
* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--electric-pair-string-delimiter):
* lisp/progmodes/gdb-mi.el (gdb-thread-list-handler-custom):
* lisp/progmodes/grep.el (grep-filter):
* lisp/progmodes/hideif.el (hif-backward-comment, hif-__COUNTER__)
(hif-token-concatenation, hif-find-define):
* lisp/progmodes/js.el (js--pstate-is-toplevel-defun)
(js-beginning-of-defun, js-end-of-defun, js--pitems-to-imenu)
(js--imenu-to-flat, js-ts--syntax-propertize):
* lisp/progmodes/tcl.el (tcl--syntax-of-quote):
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts--syntax-propertize-captures): Prefer incf to cl-incf.

(cherry picked from commit d1d85e0f35d4cb22f2cdfda0672ca33f5bb87b21)

2 weeks ago; * .gitignore: Add new VCS ignores.
Po Lu [Mon, 24 Feb 2025 13:06:41 +0000 (21:06 +0800)]
; * .gitignore: Add new VCS ignores.

(cherry picked from commit 99d116a8f41c29193cb41d0cde24a7051237ecf4)

2 weeks ago; Begin integrating facilities for executing ERT tests on Android
Po Lu [Mon, 24 Feb 2025 13:06:30 +0000 (21:06 +0800)]
; Begin integrating facilities for executing ERT tests on Android

* test/infra/android/README:

* test/infra/android/bin/AtsStub.java (AtsStub):

* test/infra/android/bin/README:

* test/infra/android/test-controller.el (tramp)
(ats-adb-executable, ats-adb-host, ats-adb-infile, ats-cache)
(ats-adb-disable-stderr, ats-adb-device-regexp, ats-adb)
(ats-adb-process-filter, ats-start-adb, ats-enumerate-devices)
(ats-online-devices, ats-memoize, ats-ps-device, ats-getprop)
(ats-get-sdk-version, ats-package-list-regexp)
(ats-is-package-debuggable, ats-list-users, ats-get-package-aid)
(ats-aid-user-offset, ats-aid-isolated-start, ats-aid-app-start)
(ats-aid-to-uid, ats-uid-to-username, ats-verify-directory)
(ats-get-package-data-directory)
(ats-get-user-external-storage-directory, ats-transfer-padding)
(ats-exec-script, ats-exec-script-checked)
(ats-use-private-staging-directory, ats-get-staging-directory)
(ats-base64-available, ats-echo-n-e, ats-echo-c, ats-octab, c)
(ats-upload-encode-binary, ats-upload, ats-download)
(ats-create-empty-temporary, ats-run-jar)
(ats-supports-am-force-stop, ats-supports-am-force-stop-user)
(ats-kill-process-by-username-and-name)
(ats-portforward-local-type-regexp)
(ats-portforward-remote-type-regexp, ats-portforward-list-regexp)
(ats-portreverse-type-regexp, ats-portreverse-list-regexp)
(ats-reverse-list, ats-reverse-tcp, ats-forward-list)
(ats-forward-tcp, ats-is-tail-available, ats-java-int-min)
(ats-java-int-max, ats-java-long-min, ats-java-long-max)
(ats-intent-array-type, ats-fmt-array-element, ats-build-intent)
(ats-working-stub-file, ats-file-directory, ats-am-start-intent)
(ats-create-commfile, ats-watch-commfile, ats-server)
(ats-default-port, ats-accepting-connection)
(ats-address-to-hostname, ats-is-localhost-p)
(ats-server-sentinel, ats-server-log, ats-server-exists-p)
(ats-start-server, ats-await-connection-timeout)
(ats-await-connection, ats-forward-server-sentinel)
(ats-forward-server-filter, ats-reverse-server)
(ats-forward-server, ats-cancel-forward-server, ats-remote-port)
(ats-in-connection-context, ats-outstanding-reverse-connection)
(ats-terminate-reverse-safely, ats-disconnect-internal)
(ats-read-connection, ats-disconnect, ats-establish-connection)
(ats-connect, ats-eval, test-controller):

* test/infra/android/test-driver.el (ats-process)
(ats-connection-established, ats-header, ats-in-eval)
(ats-eval-as-printed, ats-eval-serial, ats-process-filter)
(ats-display-status-buffer, ats-establish-connection)
(ats-driver-log, ats-initiate-connection, test-driver): New
files.

(cherry picked from commit 08077788dbcc535e8840495d62cee79434766b3d)

2 weeks ago; Re-enable 'typescript-ts-mode' indentation tests
john muhl [Mon, 24 Feb 2025 23:31:15 +0000 (17:31 -0600)]
; Re-enable 'typescript-ts-mode' indentation tests

* test/lisp/progmodes/typescript-ts-mode-tests.el
(typescript-ts-mode-test-indentation): Remove unstable tag.
(Bug#76536)

(cherry picked from commit ae5674c758a26ce598cdca37d83d268b51fe53dd)

2 weeks agoMake cl-gensym obsolete in favor of built-in gensym
Stefan Kangas [Mon, 24 Feb 2025 23:12:00 +0000 (00:12 +0100)]
Make cl-gensym obsolete in favor of built-in gensym

* lisp/emacs-lisp/cl-macs.el (cl-gensym): Declare function
obsolete in favor of gensym, added in Emacs 26.1.  The only reason
for its existence is that it allows an integer argument, but
that's not really useful, so it's better to remove this complexity.
Ref: https://lists.gnu.org/r/emacs-devel/2017-09/msg00313.html
* doc/misc/cl.texi (Symbols, Creating Symbols, Efficiency Concerns)
(Obsolete Setf Customization): Don't document above obsolete function.
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause):
* lisp/emacs-lisp/edebug.el (edebug-make-form-wrapper):
* lisp/obsolete/cl.el (cl--function-convert, lexical-let):
* lisp/obsolete/thumbs.el (thumbs-temp-file):
* lisp/progmodes/eglot.el (eglot--lambda)
(eglot--when-live-buffer, eglot--when-buffer-window)
(eglot--collecting-xrefs, eglot--glob-parse):
* lisp/progmodes/flymake.el (flymake--run-backend):
* test/lisp/emacs-lisp/package-tests.el (with-package-test):
* test/lisp/progmodes/eglot-tests.el (eglot--guessing-contact):
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-read-buffer, elisp-shorthand-read-from-string): Prefer
plain gensym to cl-gensym in files that can depend on Emacs 26.1.
* lisp/jsonrpc.el (jsonrpc-lambda, jsonrpc-request): Prefer gensym to
cl-gensym only when defined, as this file supports Emacs 25.1
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-lib-test-gensym): Simplify
test as 'should' no longer uses cl-gensym.

(cherry picked from commit 60b071e224136207f7fa24983037522e637e7efa)

2 weeks agoUse cl-with-gensyms in a few more cases
Stefan Kangas [Mon, 24 Feb 2025 22:02:20 +0000 (23:02 +0100)]
Use cl-with-gensyms in a few more cases

* doc/misc/cl.texi (Macro Bindings):
* lisp/emacs-lisp/comp.el (comp--with-sp):
* lisp/emacs-lisp/subr-x.el (with-buffer-unmodified-if-unchanged):
* lisp/eshell/em-extpipe.el (eshell-extpipe--or-with-catch):
* lisp/international/mule-cmds.el (with-locale-environment):
* lisp/kmacro.el (kmacro-menu--marks-exist-p):
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-lib-test-remprop):
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-deduplicate):
* test/lisp/emacs-lisp/ert-tests.el (ert-test-special-operator-p):
* test/lisp/kmacro-tests.el (kmacro-tests-should-insert)
(kmacro-tests-should-match-message):
* test/lisp/replace-tests.el (replace-tests-with-undo): Use
cl-with-gensyms instead of bare gensym call.

(cherry picked from commit 1a22bc0fd672e2c71955faf81ff2cfd1c0c76be9)

2 weeks agoEglot: add out-of-box support for neocmakelsp
João Távora [Mon, 24 Feb 2025 19:12:21 +0000 (19:12 +0000)]
Eglot: add out-of-box support for neocmakelsp

* lisp/progmodes/eglot.el (eglot-server-programs): Add
neocmakelsp.

(cherry picked from commit 7bb53815d2bcc7af8bc613e67e2aeb4ec01db901)

2 weeks agoEglot: use eglot-advertise-cancellation in more situations
João Távora [Sun, 16 Feb 2025 18:27:48 +0000 (18:27 +0000)]
Eglot: use eglot-advertise-cancellation in more situations

The async requests frequently issued by ElDoc are a significant
source of request pile-up on the server side (for some servers).

With this change, Eglot will issue additional LSP
$/cancelRequest notifications for in-flight requests of certain
kinds in the pre-command hook.

This required a small change to the 'jsonrpc-async-request'
entrypoint.

This feature is experimental.

* lisp/jsonrpc.el (jsonrpc-async-request): No longer returns nil.

* lisp/progmodes/eglot.el (eglot--inflight-async-requests): New variable.
(eglot--cancel-inflight-async-requests): New function.
(eglot--async-request): New function.
(eglot--pre-command-hook): Call eglot--cancel-inflight-async-requests.
(eglot-signature-eldoc-function, eglot-hover-eldoc-function)
(eglot-highlight-eldoc-function, eglot-code-action-suggestion):
Use eglot--async-request.

(cherry picked from commit e4c911adeaa679a92fab58b196b27c502aaed2f3)

2 weeks ago; Skip commit 0ac0f355e50639fb2cdacb6cbfca696d5592a89e
Eshel Yaron [Wed, 26 Feb 2025 09:36:59 +0000 (10:36 +0100)]
; Skip commit 0ac0f355e50639fb2cdacb6cbfca696d5592a89e

2 weeks agoFix bad fontification of inactive widgets
Mauro Aranda [Mon, 24 Feb 2025 22:39:43 +0000 (19:39 -0300)]
Fix bad fontification of inactive widgets

* lisp/wid-edit.el (widget-specify-inactive): When a widget is
already inactive, still move the overlay to the desired
positions.  Improve docstring.  (Bug#69941)

* doc/misc/widget.texi (default): Document the need to call the
:deactivate function when modifying an inactive widget.

* test/lisp/wid-edit-tests.el
(widget-test-modification-of-inactive-widget): New test

(cherry picked from commit 363adcc69d322bdede1934b47e9dd1fbc3148ab9)

2 weeks ago; Set :version on recently changed user option
Stefan Kangas [Mon, 24 Feb 2025 21:37:17 +0000 (22:37 +0100)]
; Set :version on recently changed user option

* lisp/vc/vc-hooks.el (vc-directory-exclusion-list): Set :version.

(cherry picked from commit 60232a30e360c00fb303cb033d4aec15a9e41342)

2 weeks agoAdd Obsolete-since header to hashcash.el
Stefan Kangas [Tue, 11 Feb 2025 17:51:43 +0000 (18:51 +0100)]
Add Obsolete-since header to hashcash.el

* lisp/obsolete/hashcash.el: Add Obsolete-since header.  (Bug#76195)

(cherry picked from commit 706970fc25de34fd63c21bed13e31e96ae258a28)

2 weeks agoMove hashcash.el to lisp/obsolete
Stefan Kangas [Tue, 11 Feb 2025 17:49:25 +0000 (18:49 +0100)]
Move hashcash.el to lisp/obsolete

* lisp/mail/hashcash.el: Move from here...
* lisp/obsolete/hashcash.el: ...to here.  (Bug#76195)

(cherry picked from commit 074b32d53f7a8c590895d49faf0f157aa800544e)

2 weeks agoDrop hashcash support from Gnus and Message mode
Stefan Kangas [Tue, 11 Feb 2025 17:47:27 +0000 (18:47 +0100)]
Drop hashcash support from Gnus and Message mode

* lisp/gnus/gnus.el (gnus-install-group-spam-parameters): Remove
'spam-use-hashcash' option.
* lisp/gnus/message.el (message-generate-hashcash): Mark as
obsolete, default to nil unconditionally.
(message-send-mail, message-setup-1, message-resend): Don't
generate hashcash headers.
* lisp/gnus/spam.el (hashcash): Don't require.
(spam-use-hashcash):
(spam-check-hashcash): Mark as obsolete.
(spam-install-hooks): Don't install 'spam-use-hashcash' hook.
* doc/misc/message.texi (Mail Headers): Don't document above
obsoleted variable 'message-generate-hashcash'.
* doc/misc/gnus.texi (Hashcash): Delete section.
(Anti-spam Hashcash Payments): Delete subsection.
(Extending the Spam package): Don't mention Hashcash.  (Bug#76195)

(cherry picked from commit 250f4214752d223981259e453c55a8c5cabb111a)

2 weeks agoMake cl-declare obsolete
Stefan Kangas [Mon, 24 Feb 2025 21:21:46 +0000 (22:21 +0100)]
Make cl-declare obsolete

* lisp/emacs-lisp/cl-macs.el (cl-declare): Make obsolete.
* doc/misc/cl.texi (Declarations): Don't document above obsolete
macro.  (Bug#63288)

(cherry picked from commit 7d5fe06e79defb0669ef2ba34d644e0836e54a38)

2 weeks agoMove buffer related functions from ert-x.el to ert.el
Stefan Kangas [Mon, 24 Feb 2025 19:25:01 +0000 (20:25 +0100)]
Move buffer related functions from ert-x.el to ert.el

* lisp/emacs-lisp/ert-x.el (ert--text-button)
(ert--format-test-buffer-name, ert--test-buffers)
(ert--test-buffer-button, ert--test-buffer-button-action)
(ert--call-with-test-buffer, ert-with-test-buffer)
(ert-with-buffer-selected, ert-kill-all-test-buffers)
(ert-call-with-buffer-renamed, ert-buffer-string-reindented): Move
from here...
* lisp/emacs-lisp/ert.el (ert--text-button)
(ert--format-test-buffer-name, ert--test-buffers)
(ert--test-buffer-button, ert--test-buffer-button-action)
(ert--call-with-test-buffer, ert-with-test-buffer)
(ert-kill-all-test-buffers, ert-with-buffer-selected)
(ert-call-with-buffer-renamed, ert-with-buffer-renamed): ...to
here.
* doc/misc/ert.texi (Helpers for Buffers): Break out new section...
(Helper Functions): ...from here.
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): Move
obsolete definition to the end of the file.

* test/lisp/emacs-lisp/ert-x-tests.el
(ert--hash-table-to-alist, ert-test-test-buffers)
(ert-test-with-buffer-selected/current)
(ert-test-with-buffer-selected/selected)
(ert-test-with-buffer-selected/nil-buffer)
(ert-test-with-buffer-selected/modification-hooks)
(ert-test-with-buffer-selected/read-only)
(ert-test-with-buffer-selected/return-value)
(ert-test-with-test-buffer-selected/modification-hooks)
(ert-test-with-test-buffer-selected/read-only)
(ert-test-with-test-buffer-selected/return-value)
(ert-test-with-test-buffer-selected/buffer-name): Move tests from
here...
* test/lisp/emacs-lisp/ert-tests.el
(ert--hash-table-to-alist, ert-test-test-buffers)
(ert-test-with-buffer-selected/current)
(ert-test-with-buffer-selected/selected)
(ert-test-with-buffer-selected/nil-buffer)
(ert-test-with-buffer-selected/modification-hooks)
(ert-test-with-buffer-selected/read-only)
(ert-test-with-buffer-selected/return-value)
(ert-test-with-test-buffer-selected/selected)
(ert-test-with-test-buffer-selected/modification-hooks)
(ert-test-with-test-buffer-selected/read-only)
(ert-test-with-test-buffer-selected/return-value)
(ert-test-with-test-buffer-selected/buffer-name): ...to here.
* test/lisp/progmodes/hideshow-tests.el (ert-x):
* test/lisp/simple-tests.el (ert-x):
* test/lisp/whitespace-tests.el (ert-x): Don't require.

(cherry picked from commit c9e681aa0c75feaf1c0a5495b0d475698cbdb653)

2 weeks ago; Delete outdated comment from ert-x.el
Stefan Kangas [Mon, 24 Feb 2025 19:00:49 +0000 (20:00 +0100)]
; Delete outdated comment from ert-x.el

(cherry picked from commit d9f165b129f5c9c94a78bd4237be6c7171085d35)

2 weeks agoSupport selecting buffer in ert-with-test-buffer
Stefan Kangas [Mon, 24 Feb 2025 17:54:23 +0000 (18:54 +0100)]
Support selecting buffer in ert-with-test-buffer

* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer): Add new keyword
argument :selected to make the buffer current and selected.
(ert-with-test-buffer-selected): Make obsolete and redefine in
terms of ert-with-test-buffer.

* doc/misc/ert.texi (Helper Functions): Document above new
:selected keyword argument, and remove documentation of
ert-with-test-buffer-selected.

* test/lisp/emacs-lisp/ert-x-tests.el
(ert-test-with-test-buffer-selected/selected)
(ert-test-with-test-buffer-selected/modification-hooks)
(ert-test-with-test-buffer-selected/read-only)
(ert-test-with-test-buffer-selected/return-value)
(ert-test-with-test-buffer-selected/buffer-name):
* test/lisp/progmodes/hideshow-tests.el
(hideshow-tests-with-temp-buffer-selected):
* test/lisp/simple-tests.el (kill-whole-line-invisible)
(kill-whole-line-read-only, kill-whole-line-after-other-kill)
(kill-whole-line-buffer-boundaries)
(kill-whole-line-line-boundaries):
* test/lisp/whitespace-tests.el
(whitespace-tests--with-test-buffer, whitespace-tests--global): Use
ert-with-test-buffer instead of ert-with-test-buffer-selected.

(cherry picked from commit 13ca18e1f79f9c02ac46735b58bc5126f77f0a77)

2 weeks agoUse cl-with-gensyms in with-sqlite-transaction
Stefan Kangas [Sun, 23 Feb 2025 23:55:16 +0000 (00:55 +0100)]
Use cl-with-gensyms in with-sqlite-transaction

* lisp/sqlite.el (cl-lib): Require at compile-time.
(with-sqlite-transaction): Use cl-with-gensyms.

(cherry picked from commit 637c73d3a804f7e64736b87994e8974892529b00)

2 weeks agoPrefer incf to cl-incf in textmodes/*.el
Stefan Kangas [Mon, 24 Feb 2025 18:27:21 +0000 (19:27 +0100)]
Prefer incf to cl-incf in textmodes/*.el

* lisp/textmodes/css-mode.el (css--rgb-color):
* lisp/textmodes/reftex-dcr.el (reftex-view-regexp-match):
* lisp/textmodes/reftex-global.el (reftex-find-duplicate-labels)
(reftex-renumber-simple-labels, reftex-translate):
* lisp/textmodes/reftex-index.el (reftex-index-select-tag)
(reftex-index-phrases-info, reftex-query-index-phrase):
* lisp/textmodes/reftex-parse.el (reftex-where-am-I)
(reftex-what-macro, reftex-nth-arg, reftex-section-number):
* lisp/textmodes/reftex-ref.el (reftex-uniquify-label):
* lisp/textmodes/reftex-sel.el (reftex-insert-docstruct):
* lisp/textmodes/reftex.el (reftex-next-multifile-index)
(reftex-compile-variables, reftex-parse-args)
(reftex-select-external-document):
* lisp/textmodes/rst.el (rst-display-hdr-hierarchy)
(rst-toc-insert-children, rst-apply-indented-blocks)
(rst-enumerate-region, rst-convert-bullets-to-enumeration):
* lisp/textmodes/tex-mode.el (tex-count-words): Prefer incf to cl-incf.

(cherry picked from commit 0eada9e1d30b9072cdc1bf8388205773cd23986f)

2 weeks ago* lisp/msb.el (msb-mode-map): Use 'defvar-keymap'.
Robert Pluim [Thu, 20 Feb 2025 16:40:43 +0000 (17:40 +0100)]
* lisp/msb.el (msb-mode-map): Use 'defvar-keymap'.

(cherry picked from commit ee04b7da8059acb230fe32f508947ecb6a24b7e2)

2 weeks agoBetter support for nil enable-local-variables in vc-find-revision-no-save
Juri Linkov [Mon, 24 Feb 2025 17:51:13 +0000 (19:51 +0200)]
Better support for nil enable-local-variables in vc-find-revision-no-save

* lisp/vc/diff-mode.el (diff-syntax-fontify-props):
* lisp/vc/vc.el (vc-find-revision-no-save):
Use enable-local-variables as is only when it's one of these values:
:safe, :all, or nil.  Otherwise, for all remaining values that query,
use :safe.  Also use non-nil 'find-file' arg of 'normal-mode'.
https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg00897.html

(cherry picked from commit 24e8477aa2f5ef228107707078735ade31e5d1c3)

2 weeks ago; Fix thinko in subr-test-zerop
Stefan Kangas [Mon, 24 Feb 2025 17:38:28 +0000 (18:38 +0100)]
; Fix thinko in subr-test-zerop

* test/lisp/subr-tests.el (subr-test-zerop): Fix test.
Reported by Pip Cet <pipcet@protonmail.com>.

(cherry picked from commit 3f72af997308db3160f05ace47602f1f2b8afd9c)

2 weeks agoUse 'password-colon-equivalents' when matching "Re" variants
Robert Pluim [Fri, 14 Feb 2025 15:26:49 +0000 (16:26 +0100)]
Use 'password-colon-equivalents' when matching "Re" variants

* lisp/mail/mail-utils.el (mail--wrap-re-regexp): Use
'password-colon-equivalents'.

(cherry picked from commit 0c8ec155f60bdebaf2f7a86e57e7c559c5552821)

2 weeks agoAdd ".jj" to vc-directory-exclusion-list
Rudi Schlatte [Mon, 24 Feb 2025 17:04:46 +0000 (18:04 +0100)]
Add ".jj" to vc-directory-exclusion-list

* lisp/vc/vc-hooks.el (vc-directory-exclusion-list): Add ".jj", a
directory used by the jujutsu version control system.  (Bug#76524)

(cherry picked from commit bca04d3c580e3bd3d787274973d33ce95098d423)

2 weeks agoOptionally have 'display-buffer' reuse windows of indirect buffers
Martin Rudalics [Mon, 24 Feb 2025 09:17:10 +0000 (10:17 +0100)]
Optionally have 'display-buffer' reuse windows of indirect buffers

* lisp/window.el (window-indirect-buffer-p): New function.
(get-buffer-window-list): New argument INDIRECT.
(display-buffer-reuse-window): New alist entry 'reuse-indirect'
to reuse a window indirectly related to the BUFFER argument.
* doc/lispref/windows.texi (Buffers and Windows): Describe new
function 'window-indirect-buffer-p' and new argument INDIRECT of
'get-buffer-window-list'.
(Buffer Display Action Functions): Describe new action alist
entry 'reuse-indirect'.
* etc/NEWS: Announce new argument for 'get-buffer-window-list' and
new 'display-buffer' action alist entry 'reuse-indirect'.

(cherry picked from commit a205d554522340e23540bdda63c80965ddd64951)

2 weeks agoClarify semantics of 'frame-inhibit-implied-resize'
Martin Rudalics [Mon, 24 Feb 2025 08:47:30 +0000 (09:47 +0100)]
Clarify semantics of 'frame-inhibit-implied-resize'

* src/frame.c (frame_inhibit_implied_resize):
* doc/lispref/frames.texi (Implied Frame Resizing): Clarify
semantics of 'frame-inhibit-implied-resize'.

(cherry picked from commit be60601ae884214503c4f958a74cebc27e8381b6)

2 weeks ago; Fix 'typescript-ts-mode' indent test (bug#71998)
john muhl [Mon, 24 Feb 2025 02:03:39 +0000 (20:03 -0600)]
; Fix 'typescript-ts-mode' indent test (bug#71998)

* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
Set 'indent-tabs-mode' after changing the major mode.

(cherry picked from commit c9964e180f743a95579ca832d08bfc450a2dc639)

2 weeks agoFix typescript-ts-mode indentation tests (bug#71998)
Yuan Fu [Mon, 24 Feb 2025 06:04:32 +0000 (22:04 -0800)]
Fix typescript-ts-mode indentation tests (bug#71998)

* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
(JSX indentation): Add quote and remove semi-colon, so the code
is valid.

(cherry picked from commit 3d46f3e3ed50753766f87f995f9514dff9a6abed)

2 weeks agoHandle case of not knowing a frame when mouse moved
Gerd Möllmann [Mon, 24 Feb 2025 04:48:29 +0000 (05:48 +0100)]
Handle case of not knowing a frame when mouse moved

* lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): Don't call
display--update-for-mouse-movement if we don't have a frame.

(cherry picked from commit 02fbdbf4ff628fe4ee6112a57d63a14445726215)

2 weeks agoUse cl-with-gensyms in ert-with-message-capture
Stefan Kangas [Sun, 23 Feb 2025 23:45:20 +0000 (00:45 +0100)]
Use cl-with-gensyms in ert-with-message-capture

* lisp/emacs-lisp/ert-x.el (ert-with-message-capture): Use
cl-with-gensyms.

(cherry picked from commit 45f5f718a07bb126bbd71952c5fbd1c5f126df7d)

2 weeks agoPrefer incf to cl-incf in gnus/*.el
Stefan Kangas [Sun, 23 Feb 2025 20:25:55 +0000 (21:25 +0100)]
Prefer incf to cl-incf in gnus/*.el

* lisp/gnus/gnus-agent.el (gnus-agent-load-local)
(gnus-agent-expire-group-1, gnus-agent-update-files-total-fetched-for):
* lisp/gnus/gnus-art.el (gnus-article-header-rank):
* lisp/gnus/gnus-async.el (gnus-async-wait-for-article):
* lisp/gnus/gnus-cache.el (gnus-cache-update-file-total-fetched-for):
* lisp/gnus/gnus-registry.el (gnus-registry-import-eld):
* lisp/gnus/gnus-salt.el (gnus-pick-line-number, gnus-tree-minimize)
(gnus-generate-vertical-tree):
* lisp/gnus/gnus-spec.el (gnus-correct-substring):
* lisp/gnus/gnus-start.el (gnus-ask-server-for-new-groups, gnus-method-rank):
* lisp/gnus/gnus-sum.el (gnus-data-update-list)
(gnus-summary-number-of-articles-in-thread, gnus-build-sparse-threads)
(gnus-summary-prepare-threads, gnus-invisible-cut-children)
(gnus-summary-limit-children, gnus-expunge-thread)
(gnus-summary-refer-references, gnus-summary-update-mark)
(gnus-summary-hide-all-threads, gnus-summary-save-parts-1):
* lisp/gnus/gnus-topic.el (gnus-topic-articles-in-topic)
(gnus-topic-prepare-topic, gnus-topic-display-missing-topic)
(gnus-topic-update-topic-line):
* lisp/gnus/gnus-uu.el (gnus-uu-post-encoded):
* lisp/gnus/gnus-win.el (gnus-configure-frame):
* lisp/gnus/mail-source.el (mail-source-fetch-directory)
(mail-source-fetch-maildir, mail-source-fetch-imap):
* lisp/gnus/message.el (message-remove-header)
(message-remove-first-header, message-make-caesar-translation-table):
* lisp/gnus/mm-encode.el (mm-qp-or-base64):
* lisp/gnus/mml.el (mml-compute-boundary, mml-compute-boundary-1):
* lisp/gnus/nnatom.el (nnatom--read-links):
* lisp/gnus/nnbabyl.el (nnbabyl-retrieve-headers):
* lisp/gnus/nndoc.el (nndoc-oe-dbx-dissection, nndoc-dissect-buffer)
(nndoc-dissect-mime-parts-sub):
* lisp/gnus/nneething.el (nneething-retrieve-headers):
* lisp/gnus/nnheader.el (nnheader-generate-fake-message-id)
(nnheader-insert-head, nnheader-translate-file-chars):
* lisp/gnus/nnimap.el (nnimap-find-wanted-parts-1)
(nnimap-retrieve-group-data-early, nnimap-send-command):
* lisp/gnus/nnmail.el (nnmail-process-babyl-mail-format)
(nnmail-process-unix-mail-format, nnmail-process-mmdf-mail-format)
(nnmail-get-new-mail-1):
* lisp/gnus/nnmaildir.el (nnmaildir--scan):
* lisp/gnus/nnrss.el (nnrss-check-group):
* lisp/gnus/nnselect.el (nnselect-request-thread):
* lisp/gnus/nnspool.el (nnspool-retrieve-headers):
* lisp/gnus/nntp.el (nntp-retrieve-headers)
(nntp-finish-retrieve-group-infos, nntp-retrieve-groups)
(nntp-retrieve-articles, nntp-retrieve-headers-with-xover):
* lisp/gnus/nnvirtual.el (nnvirtual-create-mapping):
* lisp/gnus/nnweb.el (nnweb-google-parse-1, nnweb-google-create-mapping)
(nnweb-gmane-create-mapping):
* lisp/gnus/spam.el (spam-resolve-registrations-routine): Prefer incf to
cl-incf.

(cherry picked from commit ae8522af41bb67bf417b94ed54146a43fe2150ec)

2 weeks ago(Ftranspose_regions): Fix text-properties for len1==len2
Stefan Monnier [Sun, 23 Feb 2025 05:29:49 +0000 (00:29 -0500)]
(Ftranspose_regions): Fix text-properties for len1==len2

When `len1_byte == len2_byte`, the code presumed that len1==len2
as well in its handling of text-properties.  Fix that case.
While at it, try and reduce code duplication by hoisting common
code out of `if`s, and throw away the optimization for `len_mid == 0`
which only saved 3 trivial function calls.

* src/editfns.c (Ftranspose_regions): Shuffle the code a bit.

* test/src/editfns-tests.el (editfns-tests--transpose-equal-but-not):
New test.

(cherry picked from commit d84dbcb4504f6c53968a9f245b31676c90921b38)

2 weeks agoMark cdl.el as obsolete
Stefan Kangas [Sun, 23 Feb 2025 03:43:04 +0000 (04:43 +0100)]
Mark cdl.el as obsolete

* lisp/obsolete/cdl.el: Add Obsolete-since header.  It is fully
replaceable by shell-command and shell-command-on-region.

(cherry picked from commit 7972a3448d53c515b074e6681fe3a369ada642d6)

2 weeks agoMove cdl.el to obsolete/cdl.el
Stefan Kangas [Sun, 23 Feb 2025 13:55:40 +0000 (14:55 +0100)]
Move cdl.el to obsolete/cdl.el

* lisp/cdl.el: Move from here...
* lisp/obsolete/cdl.el: ...to here.

(cherry picked from commit 827694ff282e2b1b09b277a964db7b3fba776233)

2 weeks agoFix DocView's text conversion on tty Emacs
Manuel Giraud [Fri, 26 Jul 2024 15:37:02 +0000 (17:37 +0200)]
Fix DocView's text conversion on tty Emacs

* lisp/doc-view.el (doc-view-open-text): Defaults to first page
should `doc-view-current-page' return nil.  (Bug#72305)

(cherry picked from commit 93f62f10f7b28e0ceeb1464d918746fe2b2beae1)

2 weeks ago; Skip commit 71a4670a9fa238f920ce88b938f703b605ad2f48
Eshel Yaron [Wed, 26 Feb 2025 09:32:02 +0000 (10:32 +0100)]
; Skip commit 71a4670a9fa238f920ce88b938f703b605ad2f48

2 weeks ago; Fix last change
Eli Zaretskii [Sun, 23 Feb 2025 10:25:14 +0000 (12:25 +0200)]
; Fix last change

* src/frame.c (syms_of_frame) <frame-inhibit-implied-resize>:
* doc/lispref/frames.texi (Implied Frame Resizing): Don't use
passive voice.  (Bug#76275)

(cherry picked from commit 70b15c5174e147c25f4cf71f7c94ee72a8839393)

2 weeks agoOptionally inhibit implied resizing while frame is made (Bug#76275)
Martin Rudalics [Sun, 23 Feb 2025 10:01:20 +0000 (11:01 +0100)]
Optionally inhibit implied resizing while frame is made (Bug#76275)

* src/frame.c (frame_inhibit_resize): Handle new value 'force'
for 'frame-inhibit-implied-resize' (Bug#76275).
(frame_inhibit_implied_resize): New value 'force' to inhibit
implied resizing while a new frame is made.
* lisp/cus-start.el (frame-inhibit-implied-resize): Make new
value 'force' customizable.
* doc/lispref/frames.texi (Implied Frame Resizing): Describe new
value 'force' of 'frame-inhibit-implied-resize'.
* etc/NEWS: Announce new value 'force' of
'frame-inhibit-implied-resize'.

(cherry picked from commit 499da9e1a9f63d9a767a3cab1f7771799e1d3274)