]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 months agofunction-put: signal error with non-symbol
Stefan Kangas [Tue, 1 Apr 2025 19:25:33 +0000 (21:25 +0200)]
function-put: signal error with non-symbol

* lisp/subr.el (function-get): Signal an error if given a non-symbol
for consistency with 'get'.
* test/lisp/subr-tests.el (subr-butlast): Test for the above.

(cherry picked from commit a4ec9ca12969018cdf15b8cc713b3ba054326f99)

2 months agoNew treesit generic mode 'liquid-generic-ts-mode' (bug#77255)
Juri Linkov [Tue, 1 Apr 2025 17:17:17 +0000 (20:17 +0300)]
New treesit generic mode 'liquid-generic-ts-mode' (bug#77255)

* lisp/treesit.el (treesit-replace-font-lock-feature-settings):
Check the query language in addition to checking the feature.
(treesit-font-lock-fontify-region): Use treesit-font-lock-setting-*
accessors.

* lisp/treesit-x.el (treesit-generic-mode-setup): Append new
font-lock rules to an existing treesit-font-lock-settings
possibly inherited from the parent.
(treesit-generic-mode-setup): Use treesit-merge-font-lock-feature-list
to merge with an existing feature list inherited from the parent.
(liquid-generic-ts-mode): New treesit generic mode.
(alpinejs-generic-ts-setup): New treesit generic setup.

(cherry picked from commit 87da719b6c4a53a31c67f3a9646b68cb15a1ffe7)

2 months agoMove a vc option to a preloaded file
Mauro Aranda [Tue, 1 Apr 2025 17:16:02 +0000 (14:16 -0300)]
Move a vc option to a preloaded file

Since vc-resolve-conflicts is referenced in backend files, which only
require vc at runtime, move it to vc-hooks to avoid a void
variable error.  (Bug#3860)

* lisp/vc/vc.el (vc-resolve-conflicts): Move from here...
* lisp/vc/vc-hooks.el (vc-resolve-conflicts): ...to here.

(cherry picked from commit 883355cef7c758067b49f50ab98cc5516da55155)

2 months agoFix :map property on sliced images on mode line and header line
Eli Zaretskii [Tue, 1 Apr 2025 15:40:59 +0000 (18:40 +0300)]
Fix :map property on sliced images on mode line and header line

* src/xdisp.c (note_mode_line_or_margin_highlight): Fix coordinates
for image slices wrt ':map' keyword when the image is on the mode
line or header line.  (Bug#77429)

(cherry picked from commit 975d58c4c8d22555a702c418bb68225e6fc630d0)

2 months agoAdded a check to see if the 'speedbar-buffer' is still alive
Vincenzo Pupillo [Mon, 31 Mar 2025 19:49:36 +0000 (21:49 +0200)]
Added a check to see if the 'speedbar-buffer' is still alive

Fix suggested by Rudi Schlatte <rudi@constantly.at>.
* lisp/speedbar.el (speedbar-frame-or-window): Added an additional check
to see if 'speedbar-buffer' is still alive (bug#77405).

(cherry picked from commit 31e744e581bfaf2c75d01204cc07d2da886ae252)

2 months ago; * doc/misc/cl.texi (Structures): Fix references and markup.
Eli Zaretskii [Tue, 1 Apr 2025 11:19:54 +0000 (14:19 +0300)]
; * doc/misc/cl.texi (Structures): Fix references and markup.

(cherry picked from commit 4f6fa90ec5c8fa2d5709a9ba375dbfa8f0029115)

2 months agoSuppress error in non-file buffer
Ikumi Keita [Fri, 28 Mar 2025 13:18:42 +0000 (22:18 +0900)]
Suppress error in non-file buffer

* lisp/textmodes/reftex.el (reftex--suppress-nonfile-error): New
variable.
(reftex-TeX-master-file): Don't signal error in non-file buffer.
(AUCTeX bug#76615)

(cherry picked from commit 905712690097addb201b02bd936aa26361316723)

2 months ago; Skip commit bdee2481728f57053690f0dd76c943ddd5f343d9
Eshel Yaron [Thu, 3 Apr 2025 16:49:54 +0000 (18:49 +0200)]
; Skip commit bdee2481728f57053690f0dd76c943ddd5f343d9

2 months agoFix typo in test of read-only cl-defstruct slot.
Earl Hyatt [Sat, 29 Mar 2025 21:30:48 +0000 (17:30 -0400)]
Fix typo in test of read-only cl-defstruct slot.

* test/lisp/emacs-lisp/cl-macs-tests.el (mystruct)
(cl-lib-struct-accessors): Use ":read-only" instead of ":readonly".

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-struct-accessors):
Test using `setf' on read-only accessor to make sure the correct keyword
is used.

(cherry picked from commit 6f311883d246df87fa3ed9c24dbb39078e3fd69f)

2 months agoAdd cl-with-accessors
Earl Hyatt [Thu, 13 Mar 2025 03:01:49 +0000 (23:01 -0400)]
Add cl-with-accessors

* lisp/emacs-lisp/cl-macs.el (cl-with-accessors): New macro.
* doc/misc/cl.texi (Structures): Mention the new macro.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-lib-struct-with-accessors):
New Test.
* etc/NEWS (New macro 'cl-with-accessors'.): Mention the macro.

This macro is useful when making repeated use of a structures accessor
functions, such as reading from a slot and then writing to a slot.  It
is similar to 'with-slots' from EIEIO, but uses accessor functions
instead of slot names.

(cherry picked from commit e04d1dafc700813c835ae4e45af4e104c49e8875)

2 months ago(project-forget-project): Add minibuffer-action
Eshel Yaron [Thu, 3 Apr 2025 16:46:08 +0000 (18:46 +0200)]
(project-forget-project): Add minibuffer-action

2 months agoNew variable completion-max-replace-secs
Eshel Yaron [Thu, 3 Apr 2025 16:45:50 +0000 (18:45 +0200)]
New variable completion-max-replace-secs

2 months ago; Update lisp/ldefs-boot.el
Eshel Yaron [Thu, 3 Apr 2025 12:02:18 +0000 (14:02 +0200)]
; Update lisp/ldefs-boot.el

2 months agoNew function project-read-project-by-name
Eshel Yaron [Thu, 3 Apr 2025 12:01:41 +0000 (14:01 +0200)]
New function project-read-project-by-name

2 months agoClean up flymake-log calls
Eshel Yaron [Thu, 3 Apr 2025 12:01:25 +0000 (14:01 +0200)]
Clean up flymake-log calls

2 months agoelisp-mode.el: Optimize xref-backend-references
Eshel Yaron [Thu, 3 Apr 2025 09:14:02 +0000 (11:14 +0200)]
elisp-mode.el: Optimize xref-backend-references

2 months ago(elisp-completion-at-point): Complete feature names
Eshel Yaron [Thu, 3 Apr 2025 09:12:31 +0000 (11:12 +0200)]
(elisp-completion-at-point): Complete feature names

2 months agoFlymake: minor clean up
Eshel Yaron [Thu, 3 Apr 2025 09:11:50 +0000 (11:11 +0200)]
Flymake: minor clean up

2 months agoImprove logic of tab handling when quitting windows (bug#71386)
Juri Linkov [Mon, 31 Mar 2025 17:40:17 +0000 (20:40 +0300)]
Improve logic of tab handling when quitting windows (bug#71386)

* lisp/window.el (window-deletable-p): Add tab logic that returns
the symbol 'tab' for a set of predefined conditions.
(window--delete): Call 'tab-bar-close-tab' when 'window-deletable-p'
returns the symbol 'tab'.
(quit-restore-window): Remove tab logic and merge it with frame logic.

* test/lisp/tab-bar-tests.el (tab-bar-tests-close-other-tabs-default)
(tab-bar-tests-close-other-tabs-with-arg): Clean up tabs afterwards.
(tab-bar-tests-quit-restore-window): New test.

(cherry picked from commit a97a61b630624f5a6ec917db92e2985c56b20aa0)

2 months ago(insert-kbd-macro): Polish
Stefan Monnier [Mon, 31 Mar 2025 16:01:18 +0000 (12:01 -0400)]
(insert-kbd-macro): Polish

* lisp/macros.el (insert-kbd-macro): Straighten control flow, use `pp`
and `keymap-global-set`.

(cherry picked from commit 513a05dd8761aebc14ffe4ee0a8a6e96feb10531)

2 months agolisp/macros.el (insert-kbd-macro): Fix anonymous case (bug#77317)
Stefan Monnier [Mon, 31 Mar 2025 15:36:20 +0000 (11:36 -0400)]
lisp/macros.el (insert-kbd-macro): Fix anonymous case (bug#77317)

(cherry picked from commit 10eb57169da01f3f96a5954aa42673d10086824f)

2 months agojapan-util.el: Cosmetic changes
Stefan Monnier [Mon, 31 Mar 2025 14:21:58 +0000 (10:21 -0400)]
japan-util.el: Cosmetic changes

* lisp/language/japan-util.el (<toplevel>): Use `pcase-dolist` and `when`.
(japanese-string-conversion): Use `point-min`.

(cherry picked from commit b148e98de37e43dd28207b696994e72808683291)

2 months agoFix replace-region in japan-util.el
Eli Zaretskii [Mon, 31 Mar 2025 13:55:49 +0000 (16:55 +0300)]
Fix replace-region in japan-util.el

* lisp/language/japan-util.el (japanese-replace-region): Allow
STRING to be a character in addition  to a string.  Un-obsolete
it.
(japanese-katakana-region, japanese-hiragana-region)
(japanese-hankaku-region, japanese-zenkaku-region): Call
'japanese-replace-region' instead of 'replace-region-contents'.
(Bug#77397)

(cherry picked from commit fa5cd6b4d917ea6468a4950bff5b8b122468c7ec)

2 months ago; Twice mention 'tab' value in buffer display doc-strings (Bug#71386)
Martin Rudalics [Mon, 31 Mar 2025 07:46:17 +0000 (09:46 +0200)]
; Twice mention 'tab' value in buffer display doc-strings (Bug#71386)

* lisp/window.el (display-buffer-record-window)
(window--display-buffer): Mention value 'tab' for TYPE argument
(Bug#71386).

(cherry picked from commit 1ed1cc83491311517ba46dff73fdc4383ffd4102)

2 months ago; Skip commit 10991877c8d6e47837b8a8d25c44dab7803b9030
Eshel Yaron [Mon, 31 Mar 2025 08:55:59 +0000 (10:55 +0200)]
; Skip commit 10991877c8d6e47837b8a8d25c44dab7803b9030

2 months agoRespect narrowed buffers when parsing JSON (bug#77325)
Pip Cet [Fri, 28 Mar 2025 02:33:19 +0000 (02:33 +0000)]
Respect narrowed buffers when parsing JSON (bug#77325)

* src/json.c (Fjson_insert): Simplify 'memcpy' argument.
(Fjson_parse_buffer): Only read to ZV, not all the way to Z.
* test/src/json-tests.el (with-all-gap-positions-in-temp-buffer):
New macro.
(json-parse-buffer/restricted): New test.

(cherry picked from commit 67e34f0ed8f6d3bbc78187a18f71010c70e10426)

2 months agoFix display of overlay arrow immediately after invisible text
Eli Zaretskii [Sun, 30 Mar 2025 07:29:57 +0000 (10:29 +0300)]
Fix display of overlay arrow immediately after invisible text

* src/xdisp.c (overlay_arrow_at_row): Allow the overlay arrow's
marker position to be anywhere between the row's start and end
charpos.  This keeps the overlay arrow on display even when the
preceding text is invisible.  (Bug#54843)

(cherry picked from commit 209b7e7444df5cb164679c0e55f46cba424ad13c)

2 months agolisp/emacs-lisp/cl-macs.el (cl-labels): Fix docstring (bug#77348)
Stefan Monnier [Sun, 30 Mar 2025 04:44:50 +0000 (00:44 -0400)]
lisp/emacs-lisp/cl-macs.el (cl-labels): Fix docstring (bug#77348)

(cherry picked from commit e6b4c0bcebf4376f60e7801be5f998b42c1e6b06)

2 months agoTighten the criteria for a defun in typescript-ts-mode (bug#77369)
Yuan Fu [Sun, 30 Mar 2025 04:15:02 +0000 (21:15 -0700)]
Tighten the criteria for a defun in typescript-ts-mode (bug#77369)

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--defun-predicate): New function.
(typescript-ts-base-mode): Use new predicate.

(cherry picked from commit 651418895d507001f161e2e22ca9b85647bca19b)

2 months agosrc/insdel.c (replace_range): Remove comment
Stefan Monnier [Sun, 30 Mar 2025 04:10:12 +0000 (00:10 -0400)]
src/insdel.c (replace_range): Remove comment

It should have been removed in commit b16afa45bb6a.

(cherry picked from commit e1b15d58b508da279162c585b6b3783f9e267427)

2 months agoDon't obsolete the _command_ replace-buffer-contents
Po Lu [Sun, 30 Mar 2025 02:24:45 +0000 (10:24 +0800)]
Don't obsolete the _command_ replace-buffer-contents

* lisp/subr.el (replace-buffer-contents): Don't obsolete
function.  Its purpose is to serve as a command and such
obsoletion was unnecessary to begin with.

(cherry picked from commit 468778f390fa521773634094845749ab766fdcfd)

2 months agotime-stamp source commentary: point to manual section
Stephen Gildea [Sat, 29 Mar 2025 23:48:58 +0000 (16:48 -0700)]
time-stamp source commentary: point to manual section

* lisp/time-stamp.el: Add an Info link in the commentary,
now that the manual has more to say.
* doc/emacs/files.texi (Time Stamps for One File): Expand one
consistent example.

(cherry picked from commit 5d620aefae267a12b4046606f85e6f2865d729da)

2 months agoOrg: Use new `replace-region-contents`
Stefan Monnier [Fri, 28 Mar 2025 04:49:33 +0000 (00:49 -0400)]
Org: Use new `replace-region-contents`

* lisp/org/org-compat.el (org-replace-buffer-contents): Delete function.
(org-replace-region-contents): New function.
* lisp/org/org-src.el (org-edit-src-save, org-edit-src-exit): Use it.

(cherry picked from commit 6bcf41c311b220e84f4eb423700f36ac1ddfffa7)

2 months agoUse `replace-region-contents` to replace insert+delete
Stefan Monnier [Fri, 28 Mar 2025 05:01:17 +0000 (01:01 -0400)]
Use `replace-region-contents` to replace insert+delete

* lisp/minibuffer.el (completion--replace):
* lisp/emacs-lisp/cl-lib.el (cl--set-buffer-substring):
* lisp/subr.el (replace-string-in-region):
Use `replace-region-contents` instead of insert+delete.

* lisp/help-fns.el (help-fns--signature):
Use `replace-region-contents` instead of `cl--set-buffer-substring`.

* lisp/language/japan-util.el (japanese-replace-region):
Rewrite using `replace-region-contents` and mark obsolete.
(japanese-katakana-region, japanese-hankaku-region):
Use `replace-region-contents` instead.

* lisp/progmodes/flymake-proc.el (flymake-proc--replace-region):
Rewrite using `replace-region-contents` and mark obsolete.
(flymake-proc--check-patch-master-file-buffer):
Use `replace-region-contents` instead.

(cherry picked from commit 1d07a6d7e34677be1653b1d4d464ff00cabfa102)

2 months agoReplace uses of `replace-buffer-contents`
Stefan Monnier [Fri, 28 Mar 2025 04:48:28 +0000 (00:48 -0400)]
Replace uses of `replace-buffer-contents`

* lisp/vc/vc.el (vc-diff-restore-buffer):
* lisp/progmodes/python.el (python--do-isort):
* lisp/progmodes/eglot.el (eglot--apply-text-edits):
* lisp/files.el (revert-buffer-insert-file-contents-delicately):
* lisp/json.el (json-pretty-print): Use `replace-region-contents`.

(cherry picked from commit 468c2aebae0ee13273f4b06e92f4188c4c46d2b3)

2 months agosrc/insdel.c (adjust_markers_for_replace): Fix insertion case
Stefan Monnier [Sat, 29 Mar 2025 20:40:19 +0000 (16:40 -0400)]
src/insdel.c (adjust_markers_for_replace): Fix insertion case

test/src/editfns-tests.el (editfns-tests--insert-via-replace): New test

(cherry picked from commit 57da44fa702782e19cd9d60ea63ec2fd9ca48521)

2 months ago(replace-region-contents): Improve and promote (bug#76313)
Stefan Monnier [Fri, 28 Mar 2025 04:46:53 +0000 (00:46 -0400)]
(replace-region-contents): Improve and promote (bug#76313)

Swap the role of `replace-region-contents` and `replace-buffer-contents`,
so `replace-region-contents` is the main function, implemented in C,
and `replace-buffer-contents` is a mere wrapper (marked as obsolete).
Also remove the need to rely on narrowing and on describing the
new text as a function.
Finally, allow MAX-SECS==0 to require a cheap replacement, and
add an INHERIT argument.

* src/editfns.c: Include `coding.h`.
(Freplace_region_contents): Rename from `Freplace_buffer_contents`.
Change calling convention to that of `replace-region-contents`.
Add more options for the SOURCE argument.  Add INHERIT argument.
Skip the costly algorithm if MAX-SECS is 0.
* src/insdel.c (replace_range): Allow NEW to be a buffer.

* lisp/subr.el (replace-buffer-contents): New implementation.
* lisp/emacs-lisp/subr-x.el (replace-region-contents): Delete.

* doc/lispref/text.texi (Replacing): Document new API for
`replace-region-contents`.  Remove documentation of
`replace-buffer-contents`.

* test/src/editfns-tests.el (replace-buffer-contents-1)
(replace-buffer-contents-2, replace-buffer-contents-bug31837):
Use `replace-region-contents`.
(editfns--replace-region): Delete.
(editfns-tests--replace-region): Use `replace-region-contents`.
Adds tests for new types of SOURCE args.

(cherry picked from commit 7c82cc8b975175aebbad1c43ec1cd98b3232f482)

2 months ago; Skip commit b98fe25c2ee2ac2d82b337c49d1aa1dfed2417eb
Eshel Yaron [Mon, 31 Mar 2025 08:38:44 +0000 (10:38 +0200)]
; Skip commit b98fe25c2ee2ac2d82b337c49d1aa1dfed2417eb

2 months ago; * admin/notes/java: Document substitutes for `goto' in Java.
Po Lu [Sat, 29 Mar 2025 14:37:39 +0000 (22:37 +0800)]
; * admin/notes/java: Document substitutes for `goto' in Java.

(cherry picked from commit 04bd6497300789cd90b365299885517d92292648)

2 months agoFix minor issues in documentation of `use-package'
Dominik Schrempf [Thu, 27 Mar 2025 14:54:52 +0000 (15:54 +0100)]
Fix minor issues in documentation of `use-package'

(Bug#77311)

Copyright-paperwork-exempt: yes
(cherry picked from commit 7a976d1aaf7f555146ea890cc086edefe3f8ef58)

2 months agoUse 'hash-table-contains-p' in a few places
Stefan Kangas [Sat, 29 Mar 2025 12:50:21 +0000 (13:50 +0100)]
Use 'hash-table-contains-p' in a few places

This replaces open coded versions of the common idiom
    (not (eq (gethash key table 'missing) 'missing))
with
    (hash-table-contains-p key table)
in files where we can rely on features in Emacs 31.

* lisp/emacs-lisp/map.el (map-contains-key):
* lisp/external-completion.el (external-completion-table):
* lisp/mh-e/mh-utils.el (mh-sub-folders)
(mh-remove-from-sub-folders-cache):
* lisp/net/ange-ftp.el (ange-ftp-hash-entry-exists-p):
* lisp/password-cache.el (password-in-cache-p, password-cache-add):
* lisp/pcmpl-x.el (pcmpl-x-tlmgr-action-options):
* lisp/xdg.el (xdg-mime-apps): Use 'hash-table-contains-p'.

(cherry picked from commit f60fc1287d499e8c93857b1b96e8bd2467b22c8d)

2 months agoNew function 'hash-table-contains-p'
Stefan Kangas [Sat, 29 Mar 2025 13:59:26 +0000 (14:59 +0100)]
New function 'hash-table-contains-p'

This function tests whether a given key is present in a hash table.
Emacs Lisp has long lacked a standard way to do this, leading users to
write one of:

    (not (eq (gethash key table 'missing) 'missing))
or
    (gethash key table)

This idiom is error-prone (when 'missing' or 'nil' are valid values),
and it obscures intent.  The new function avoids such pitfalls,
improves readability, and makes the intent explicit:

    (hash-table-contains-p key table)

The name 'hash-table-contains-p' exists in other Lisp dialects (e.g.,
SRFI-125), and follows the precedent of 'seq-contains-p'.  Other
alternatives considered include `hash-table-has-key-p` and
`hash-table-key-exists-p`, but none were clearly better.

This was previously discussed in 2018, and all comments were positive,
but the proposed patch (implementing it in C) was never pushed:
https://lists.gnu.org/r/emacs-devel/2018-02/msg00424.html

* lisp/subr.el (hash-table-contains-p): New function.
* lisp/emacs-lisp/shortdoc.el (hash-table):
* doc/lispref/hash.texi (Other Hash): Document the new function.
* test/lisp/subr-tests.el (hash-table-contains-p): New test.

(cherry picked from commit dd0dd87e3aaf3116c400fba858cbe35ced15f04e)

2 months agoRemove redundant constant nil argument to gethash
Stefan Kangas [Sat, 29 Mar 2025 11:34:37 +0000 (12:34 +0100)]
Remove redundant constant nil argument to gethash

* lisp/cedet/ede/files.el (ede--directory-project-from-hash):
* lisp/emacs-lisp/edebug.el (edebug-unwrap*):
* lisp/emacs-lisp/testcover.el (testcover--copy-object1):
* lisp/net/zeroconf.el (zeroconf-get-service, zeroconf-resolve-service)
(zeroconf-register-service-browser, zeroconf-service-browser-handler)
(zeroconf-register-service-resolver):
* lisp/url/url-history.el (url-have-visited-url): Remove redundant
constant nil argument to gethash.

(cherry picked from commit 14cf4d538350fd2b1eda35101f5bb585f55e4659)

2 months ago; * lisp/treesit-x.el : Call 'treesit-declare-unavailable-functions'.
Eli Zaretskii [Sat, 29 Mar 2025 13:16:51 +0000 (09:16 -0400)]
; * lisp/treesit-x.el : Call 'treesit-declare-unavailable-functions'.

(cherry picked from commit bfabae993113aa0a35298950355333497bc0d485)

2 months ago; Fix a merge snafu.
Eli Zaretskii [Sat, 29 Mar 2025 12:54:30 +0000 (08:54 -0400)]
; Fix a merge snafu.

(cherry picked from commit 988111937b44433490d20593c2a1e543575ae940)

2 months ago'uniquify' user option setters and automatic buffer refresh (bug#77157)
shipmints [Fri, 21 Mar 2025 17:59:03 +0000 (13:59 -0400)]
'uniquify' user option setters and automatic buffer refresh (bug#77157)

Use 'customize', 'setopt', or 'uniquify--set-option' instead of
'setq' to benefit.

* lisp/uniquify.el (uniquify--buffer-refresh): New function.
(uniquify--set-option): New function.
(uniquify-buffer-name-style): Add :initialize and :set forms.
(uniquify-ignore-buffers-re): Add :initialize and :set forms.
(uniquify-min-dir-content): Add :initialize and :set forms.
(uniquify-separator): Add :initialize and :set forms.
(uniquify-strip-common-suffix): Add :initialize and :set forms.
(uniquify-dirname-transform): Add :initialize and :set forms.

(cherry picked from commit 3e228c9eea56cf25234b99e1411114baa732f53f)

2 months agoFix compiler warnings in mhtml-ts-mode.el (bug#77017).
Vincenzo Pupillo [Sat, 22 Mar 2025 11:30:30 +0000 (12:30 +0100)]
Fix compiler warnings in mhtml-ts-mode.el (bug#77017).

* lisp/textmodes/mhtml-ts-mode.el:
Added variable and function declarations to prevent compiler
warnings.
(mhtml-ts-mode): Require 'html-ts-mode' after checking that
the html parser is available.

(cherry picked from commit 7a8e2e572902094ec7f7e3839d0224a3408e196a)

2 months agoPHP should be in the PATH, either locally or remotely. (bug#76242).
Vincenzo Pupillo [Fri, 14 Mar 2025 20:11:22 +0000 (21:11 +0100)]
PHP should be in the PATH, either locally or remotely. (bug#76242).

* lisp/progmodes/php-ts-mode.el
(php-ts-mode-php-default-executable): Renamed from
'php-ts-mode-php-executable'.
(php-ts-mode--executable): New function that returns the absolute
filename of the PHP executable, local or remote, based on
'default-directory'.
(php-ts-mode--anchor-prev-sibling): Replaced 'when-let' with
“when-let*.”
(php-ts-mode--indent-defun): Replaced 'when-let' with
'when-let*'.
(php-ts-mode-run-php-webserver): Use the new function
(php-ts-mode-php-default-executable).
(run-php): Use the new function (php-ts-mode-php-default-executable).

(cherry picked from commit 99ff59bd66cc07df40b14cb0a8acf22d440581e5)

2 months ago; Skip commit d94d6c0f02f90ad099b926ecccfea2fe1d23659e
Eshel Yaron [Mon, 31 Mar 2025 08:33:47 +0000 (10:33 +0200)]
; Skip commit d94d6c0f02f90ad099b926ecccfea2fe1d23659e

2 months ago; Fix last change (bug#77081)
Eli Zaretskii [Sat, 29 Mar 2025 11:01:35 +0000 (14:01 +0300)]
; Fix last change (bug#77081)

* lisp/electric.el (electric-block-comment-mode): Fix whitespace.

* etc/NEWS: Move entry to its proper place; fix punctuation.

(cherry picked from commit e9a07417ab280ea627594fa4328c5a0b2de6fd7c)

2 months agoNew minor mode: `electric-block-comment-mode'
Elías Gabriel Pérez [Mon, 17 Mar 2025 18:56:52 +0000 (12:56 -0600)]
New minor mode: `electric-block-comment-mode'

This minor lets you automatically closing block comments after
typing `block-comment-start'.  Thus, typing "/*" in c-mode and
its derivatives automatically inserts "*/".  (Bug#77081)

* etc/NEWS: Add minor-mode item.
* lisp/electric.el
(electric-block-comment-post-self-insert-function): New function.
(electric-block-comment-mode): New minor mode definition.

(cherry picked from commit 989f9f01f731c0dd0382bad50f1c45894d69c3ea)

2 months ago; * lisp/emacs-lisp/eldoc.el (eldoc-help-at-pt): Add :version tag (bug#77227).
Eli Zaretskii [Sat, 29 Mar 2025 10:52:31 +0000 (13:52 +0300)]
; * lisp/emacs-lisp/eldoc.el (eldoc-help-at-pt): Add :version tag (bug#77227).

(cherry picked from commit 2dd871a358e5aeea7ea343e06497760ac36464cc)

2 months agoNew Eldoc function `eldoc-show-help-at-pt'
Daniel Mendler [Sat, 22 Mar 2025 09:29:45 +0000 (10:29 +0100)]
New Eldoc function `eldoc-show-help-at-pt'

Show `help-at-pt' string via Eldoc as an alternative to the
`help-at-pt-display-when-idle' timer.  The help-at-pt timer
competes with Eldoc for the echo area, such that the two
mechanisms do not work well together.  Therefore when using
Eldoc, the setting `eldoc-help-at-pt' may be preferable.
* lisp/emacs-lisp/eldoc.el (eldoc-help-at-pt): New customization option.
(eldoc-show-help-at-pt): New Eldoc function.
(eldoc-documentation-functions): Register the new function.
* lisp/help-at-pt.el (help-at-pt-display-when-idle): Mention
`eldoc-help-at-pt' in the docstring.
* doc/emacs/help.texi: Document `eldoc-help-at-pt'.
* etc/NEWS: Announce the change.  (Bug#77169)

(cherry picked from commit ab71699e5f2502aff6c65dd195611cfbbe2f2255)

2 months agoImprove message handling on server stop
Jens Schmidt [Sat, 8 Mar 2025 17:13:54 +0000 (18:13 +0100)]
Improve message handling on server stop

* lisp/server.el (server-stop): Use a clearer signal message if there is
an existing, external Emacs server.
(server-start): Use a different warning if one attempts to only
stop (and not restart) an external server.
(server-unload-function): Silently stop the server if unloading its
library.  (Bug#76870)

(cherry picked from commit b832d37410c955b30adfb89e17339e406eeefa01)

2 months agoAvoid warning when loading 'go-ts-mode'
Eli Zaretskii [Sat, 29 Mar 2025 10:36:02 +0000 (13:36 +0300)]
Avoid warning when loading 'go-ts-mode'

* lisp/progmodes/go-ts-mode.el (treesit-ready-p): Silence the
warning if the gomod language library is not installed.
(Bug#77213)

(cherry picked from commit 26873d5028ed8aa0e2fc56c7d6ed3b43ff976d3c)

2 months ago; Skip commit 0b2e3db910987f31175698b1728f41988d83e5ec
Eshel Yaron [Mon, 31 Mar 2025 08:32:28 +0000 (10:32 +0200)]
; Skip commit 0b2e3db910987f31175698b1728f41988d83e5ec

2 months ago; Fix last change
Eli Zaretskii [Sat, 29 Mar 2025 10:22:11 +0000 (13:22 +0300)]
; Fix last change

* lisp/files.el (auto-mode-alist):
* etc/NEWS: Fix last change.  (Bug#77138)

(cherry picked from commit cedefabfcfbe283fd539d8d290db550069807126)

2 months agoAdd major mode for highlighting npmrc files (Bug#77138)
Konstantin Kharlamov [Thu, 20 Mar 2025 16:17:32 +0000 (19:17 +0300)]
Add major mode for highlighting npmrc files (Bug#77138)

* etc/NEWS: mention the new mode.
* lisp/textmodes/conf-mode.el (conf-npmrc-mode-syntax-table): New
variable.
* lisp/textmodes/conf-mode.el (conf-npmrc-mode): New major mode
derived from conf-mode for highlighting .npmrc files.
* lisp/files.el (auto-mode-alist): Associate the new mode with .npmrc
files.

(cherry picked from commit 891f51fe118597ffe58d5d817fff693db3188639)

2 months agoDo not redundantly dump constant forwarding objects
Po Lu [Sat, 29 Mar 2025 06:45:38 +0000 (14:45 +0800)]
Do not redundantly dump constant forwarding objects

* src/pdumper.c (dump_fwd_int, dump_fwd_bool, dump_fwd_obj): Do
not redundantly dump constant forwarding descriptors; restrict
to dumping the objects being forwarded to.
(dump_fwd_buffer_obj): Copy from the dump file into bss rather
than load buffer forwarding descriptors from the dump file
itself.
(dump_fwd_kboard_obj): Delete function.
(dump_fwd): Don't return offset of dumped objects.
(dump_blv): Adjust correspondingly.
(dump_pre_dump_symbol): Improve documentation.  Record offset of
forwarding objects in relation to `emacs_basis' rather than the
dump file.
(dump_symbol): Restore forwarding descriptors to their original
values as static variables in Emacs.  This reduces the size of
dump files by an insignificant 2kb but facilitates certain kinds
of watchpoints on platforms where ASLR cannot be disabled, e.g.,
Android.

(cherry picked from commit 2b7a72b1177a057813f40aacc24fd0cd71f5903a)

2 months ago; Skip commit 8a986e7075dc83c0b87f0928ba767215c3c6a377
Eshel Yaron [Mon, 31 Mar 2025 08:31:29 +0000 (10:31 +0200)]
; Skip commit 8a986e7075dc83c0b87f0928ba767215c3c6a377

2 months ago; Skip commit 8acbde02a03b4cdf8dcfba0472e9eb4a440028f6
Eshel Yaron [Mon, 31 Mar 2025 08:31:13 +0000 (10:31 +0200)]
; Skip commit 8acbde02a03b4cdf8dcfba0472e9eb4a440028f6

2 months ago; Fix package-version values
Eli Zaretskii [Thu, 27 Mar 2025 11:52:22 +0000 (13:52 +0200)]
; Fix package-version values

* lisp/textmodes/rst.el (rst-compile-toolsets):
* lisp/which-key.el (which-key-idle-delay): Fix package-version.

(cherry picked from commit a702f29a00b0362b6060bbf4c83edcdc61b5fe32)

2 months ago; * lisp/which-key.el (which-key-idle-delay): Fix package-version.
Eli Zaretskii [Thu, 27 Mar 2025 11:49:10 +0000 (13:49 +0200)]
; * lisp/which-key.el (which-key-idle-delay): Fix package-version.

(cherry picked from commit a1fbc51dc715bf9eaa89b165f902eef9dd819077)

2 months ago; Skip commit 9a07d64f5c734f08baa741d763640943a7b407e7
Eshel Yaron [Mon, 31 Mar 2025 08:29:27 +0000 (10:29 +0200)]
; Skip commit 9a07d64f5c734f08baa741d763640943a7b407e7

2 months ago; Improve type specifier documentation
Stefan Kangas [Tue, 25 Mar 2025 22:16:11 +0000 (23:16 +0100)]
; Improve type specifier documentation

* doc/lispref/functions.texi (Declare Form): Clarify wording for
precision and consistency; note consequences of incorrect declarations.
* doc/lispref/objects.texi (Type Specifiers): Mention use by the native
compiler; tighten wording.

(cherry picked from commit b3881ac443f2ab279aba3d9687792c71d97554d0)

2 months ago; Improve documentation of "function types"
Eli Zaretskii [Tue, 25 Mar 2025 12:37:17 +0000 (14:37 +0200)]
; Improve documentation of "function types"

* doc/lispref/functions.texi (Declare Form):
* doc/lispref/objects.texi (Type Specifiers): Improve wording and
indexing.

(cherry picked from commit 6a3e2b88d26db4f703c566cf9b508f8c83ea8850)

2 months agoFlymake: remove unneeded 'require'
Eshel Yaron [Mon, 31 Mar 2025 08:23:04 +0000 (10:23 +0200)]
Flymake: remove unneeded 'require'

2 months agoRemove 'checkdoc-minor-mode'
Eshel Yaron [Mon, 31 Mar 2025 08:22:51 +0000 (10:22 +0200)]
Remove 'checkdoc-minor-mode'

2 months ago; Fix build
Eshel Yaron [Sun, 30 Mar 2025 15:24:53 +0000 (17:24 +0200)]
; Fix build

2 months agoscope.el: 'nnoo-define-basics' is unsafe.
Eshel Yaron [Sun, 30 Mar 2025 15:17:18 +0000 (17:17 +0200)]
scope.el: 'nnoo-define-basics' is unsafe.

2 months agoelisp-mode.el: Improve xref-backend-references impl.
Eshel Yaron [Sat, 29 Mar 2025 20:49:00 +0000 (21:49 +0100)]
elisp-mode.el: Improve xref-backend-references impl.

2 months agoscope.el: Fix some errors
Eshel Yaron [Sat, 29 Mar 2025 20:48:32 +0000 (21:48 +0100)]
scope.el: Fix some errors

2 months ago(minibuffer-add-completion-predicate): Evaluate non-symbols.
Eshel Yaron [Sat, 29 Mar 2025 20:45:24 +0000 (21:45 +0100)]
(minibuffer-add-completion-predicate): Evaluate non-symbols.

2 months ago(macroexp-quote): Add optional argument Q.
Eshel Yaron [Sat, 29 Mar 2025 20:44:38 +0000 (21:44 +0100)]
(macroexp-quote): Add optional argument Q.

2 months ago* lisp/help.el (where-is): Remove prefix arg, clean up.
Eshel Yaron [Sat, 29 Mar 2025 20:42:15 +0000 (21:42 +0100)]
* lisp/help.el (where-is): Remove prefix arg, clean up.

2 months ago; (find-function-search-for-symbol): Be cautious with macros.
Eshel Yaron [Fri, 28 Mar 2025 16:57:35 +0000 (17:57 +0100)]
; (find-function-search-for-symbol): Be cautious with macros.

2 months ago; Time Stamps doc: expand the explanation of the examples
Stephen Gildea [Fri, 28 Mar 2025 14:04:03 +0000 (07:04 -0700)]
; Time Stamps doc: expand the explanation of the examples

* doc/emacs/files.texi (Time Stamps): Divide into three sections.
* doc/emacs/emacs.texi: Add new nodes to menu.
* lisp/time-stamp.el: Change reference to new node.

(cherry picked from commit 7527e395499e7ef24249b286dda87d7feb04fb8e)

2 months agoRemove a use of a PUA Unicode character (bug#77328)
Gerd Möllmann [Fri, 28 Mar 2025 13:44:35 +0000 (14:44 +0100)]
Remove a use of a PUA Unicode character (bug#77328)

* lisp/progmodes/eglot.el (eglot-code-action-indicator): Use
U+1F4A1 ELECTRIC LIGHT BULB instead of a PUA character.

(cherry picked from commit 638ec3cd66e51f9287dbea8e8c9d037bfa28ad0e)

2 months ago; Skip commit da9a3f558d1f9cbe44e5e791028234c5a593d945
Eshel Yaron [Fri, 28 Mar 2025 16:57:17 +0000 (17:57 +0100)]
; Skip commit da9a3f558d1f9cbe44e5e791028234c5a593d945

2 months agoMiscellaneous corrections
Po Lu [Fri, 28 Mar 2025 08:10:12 +0000 (16:10 +0800)]
Miscellaneous corrections

* src/buffer.h (BUF_PTR_BYTE_POS): Fix comment.

* src/profiler.c (add_sample): Use BASE_EQ.

(cherry picked from commit ed3d8bb298bf4c7ef39a08392ace3271686cd5c0)

2 months ago; Skip commit 9720e1a96ed78fb86b24787f9986f14bad108c96
Eshel Yaron [Fri, 28 Mar 2025 16:57:10 +0000 (17:57 +0100)]
; Skip commit 9720e1a96ed78fb86b24787f9986f14bad108c96

2 months ago; Skip commit 01f4a0cb6cb15fbbc28e64abd94cb38604a24672
Eshel Yaron [Fri, 28 Mar 2025 16:56:49 +0000 (17:56 +0100)]
; Skip commit 01f4a0cb6cb15fbbc28e64abd94cb38604a24672

2 months ago; Skip commit 364c3dbc12e7b6d41ab449dd495c96d08874310e
Eshel Yaron [Fri, 28 Mar 2025 16:56:42 +0000 (17:56 +0100)]
; Skip commit 364c3dbc12e7b6d41ab449dd495c96d08874310e

2 months ago; Skip commit 59fd8c26be2f7724a5c8cb583383f2025171c660
Eshel Yaron [Fri, 28 Mar 2025 16:30:26 +0000 (17:30 +0100)]
; Skip commit 59fd8c26be2f7724a5c8cb583383f2025171c660

2 months ago; Silence compilation warning
Eshel Yaron [Fri, 28 Mar 2025 16:30:11 +0000 (17:30 +0100)]
; Silence compilation warning

2 months agoHandle better changed default-directory in shell-command
Michael Albinus [Thu, 27 Mar 2025 16:48:20 +0000 (17:48 +0100)]
Handle better changed default-directory in shell-command

* lisp/simple.el (shell-command): Kill buffer-local values of
`shell-file-name' and `shell-command-switch', there could be left
connection-local values.  (Bug#76888)

(cherry picked from commit 37b8acf3781a65d397a946f621893b07a0960de0)

2 months ago; Reorder initialization of module environment functions.
Philipp Stephani [Thu, 27 Mar 2025 13:07:39 +0000 (14:07 +0100)]
; Reorder initialization of module environment functions.

* src/emacs-module.c (initialize_environment): Reorder assignments to
match declaration order in emacs-module.h.

(cherry picked from commit f22af15aef96c95de35a37ee72d2055579d5b297)

2 months agow32: fail gracefully when using invalid glyphs on DWrite
Cecilio Pardo [Thu, 27 Mar 2025 12:26:00 +0000 (13:26 +0100)]
w32: fail gracefully when using invalid glyphs on DWrite

* src/w32dwrite.c (text_extents_internal): Return false instead
of crashing with bad glyph indexes.  (Bug#77196)

(cherry picked from commit 33a46ff565296b491e808aa63d1dbaa2d994bbb5)

2 months agolisp/help-fns.el (help-fns--signature): Pretty print type
Stefan Monnier [Thu, 27 Mar 2025 12:59:06 +0000 (08:59 -0400)]
lisp/help-fns.el (help-fns--signature): Pretty print type

(cherry picked from commit 0cbe17cdb6b44606cfb831358ed83cdbf22a01e3)

2 months agopeg.texi: Fix bug#76555 even a bit more
Yue Yi [Wed, 26 Mar 2025 02:22:08 +0000 (22:22 -0400)]
peg.texi: Fix bug#76555 even a bit more

* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix other part of the grammar of `define-peg-ruleset` example.

(cherry picked from commit ba409f37125a4cf8b99718f9252f7804229663a2)

2 months agopeg.texi: Fix bug#76555 even a bit more
Yue Yi [Wed, 26 Mar 2025 02:20:50 +0000 (22:20 -0400)]
peg.texi: Fix bug#76555 even a bit more

* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix grammar of `define-peg-ruleset` example.

(cherry picked from commit 1d7fe589fad13595a0923bbd23939166f0ad639c)

2 months agoPEG: Fix bug#76555
Stefan Monnier [Wed, 26 Mar 2025 02:17:05 +0000 (22:17 -0400)]
PEG: Fix bug#76555

* doc/lispref/peg.texi (Parsing Expression Grammars):
Fix `define-peg-ruleset` example.

* lisp/progmodes/peg.el (define-peg-rule): Fix indent rule.

(cherry picked from commit 1db7aaceb9fe9b78838ad06199e3fbba830737e9)

2 months agoC++ Mode: Fix some indentation bugs. FIxes bug#19867
Alan Mackenzie [Thu, 27 Mar 2025 10:24:48 +0000 (10:24 +0000)]
C++ Mode: Fix some indentation bugs.  FIxes bug#19867

1. Fix closing paren aligning with trailing comment on line
with matching open paren.
2. Fix indentation of first identifier inside a comma separated
list aligning with the type rather than the subsequent
identifiers.
3. Fix lambda expressions inside a brace list aligning like a
single statement.

* lisp/progmodes/cc-align.el (c-lineup-arglist): Take into
account any preceding comments when lining up the arguments in
the arglist.
(c-lineup-arglist-intro-after-paren): Handle comments properly,
and don't line up the closing parenthesis with a trailing
comment on the first line.
(c-lineup-item-after-paren-at-boi): Also allow a paren to count
as being at BOI when it is preceded only by open parens on that
line.
(c-lineup-runin-statements, c-lineup-ObjC-method-call): Hanle
comments better.

* lisp/progmodes/cc-engine.el (c-forward-comments) Introduce an
optional limit parameter.  Use this limit in calls from
cc-align.el and cc-mode.el.
(c-just-after-func-arglist-p): Handle the presence of a
protection keyword such as "public".
(c-at-bracelist-p): Renamed from c-inside-bracelist-p, after
dropping the accept-in-paren parameter, having removed its
functionality.
(c-looking-at-statement-block-1): New function, based on the
old c-looking-at-statement-block.  Enhanced to handle C++
lambda expressions, and to return the symbol `maybe' when the
contents of a brace delimited block fail to determine whether
it is a statement block.
(c-looking-at-statement-block): Enhanced to examine the context
of a brace delimited block when the contents are ambiguous.
(c-looking-at-c++-lambda-expression): Check the character after
point is a < before calling c-forward-<>-arglist.
(c-add-stmt-syntax): Make the context more accurate by calling
c-looking-at-statement-block.
(c-guess-basic-syntax, CASE 5D.5): Replace the syntactic symbol
topmost-intro-cont with the new symbol class-field-cont,
additionally determining the position of the enclosing brace as
an extra anchor point.
(c-guess-basic-syntax, CASE 5V): New case for an identifier
following a type inside class braces.
(c-guess-basic-syntax, CASE 9): Use
c-looking-at-statement-block to detect a brace list more
accurately.

* lisp/progmodes/cc-fonts.el (c-get-fontification-context):
Rename the call to c-inside-bracelist-p to c-at-bracelist-p.

* lisp/progmodes/cc-langs.el (c-protection-kwds): Add an entry
for java-mode.
(c-stmt-block-only-keywords-regexp): Prevent this regexp also
matching a character preceding the keyword.

* /lisp/progmodes/cc-mode.el (c-before-change-include-<>)
(c-after-change-include-<>): Use the new limit argument to
c-forward-comments.

* lisp/progmodes/cc-styles.el (c-style-alist, "gnu" and "java"
styles): Change the offset for arglist-close to
c-lineup-arglist-close-under-paren.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Introduce the
new syntactic symbol class-field-cont, giving it default
offset +.

* doc/misc/cc-mode.texi (Syntactic Symbols, Class Symbols):
Document the new syntactic symbol class-field-cont.

(cherry picked from commit 555ec43a32ea8f3675c5a9d73ca30609eeaa9013)

2 months ago* lisp/treesit-x.el: Remove unnecessary treesit-generic-mode.
Juri Linkov [Thu, 27 Mar 2025 07:33:45 +0000 (09:33 +0200)]
* lisp/treesit-x.el: Remove unnecessary treesit-generic-mode.

(treesit-generic-mode-list): Remove variable.
(define-treesit-generic-mode): Remove docstring text about hook
that is already added by 'define-derived-mode'.
(treesit-generic-mode): Remove command.

(cherry picked from commit 27c41d026f79ebc46fc8fe202836be0fd375bc1b)

2 months agoDon't write to bottom-right cell on ttys with AutoWrap (bug#77233)
Gerd Möllmann [Thu, 27 Mar 2025 05:10:46 +0000 (06:10 +0100)]
Don't write to bottom-right cell on ttys with AutoWrap (bug#77233)

* src/term.c (tty_write_glyphs): Handle case of writing only one
character in the last column.

(cherry picked from commit 1883a5c7174eeede8fe307e73014628edca6b614)

2 months agoSignal user-error in info--ensure-not-in-directory-node
Stefan Kangas [Wed, 26 Mar 2025 20:39:18 +0000 (21:39 +0100)]
Signal user-error in info--ensure-not-in-directory-node

* lisp/info.el (info--ensure-not-in-directory-node): Change from 'error'
to 'user-error' to reduce 'debug-on-error' frustration.

(cherry picked from commit c00170e92c5c3f68734e0e2d632d6efdcbb9c969)

2 months agoFix vertical cursor motion with wide images and line numbers
Eli Zaretskii [Wed, 26 Mar 2025 17:04:16 +0000 (19:04 +0200)]
Fix vertical cursor motion with wide images and line numbers

* src/xdisp.c (produce_image_glyph): When cropping an image that
exceeds the window's right edge, account for the screen estate
taken by line-number display.  (Bug#77217)

(cherry picked from commit 1e68351d56918cd4d7883bcff629f794660a3134)

2 months ago; Remove obsolete file `java/incrementing-version-code'.
Po Lu [Wed, 26 Mar 2025 12:46:54 +0000 (20:46 +0800)]
; Remove obsolete file `java/incrementing-version-code'.

(cherry picked from commit 8f7790a95ecd88efec97417f1a3b51ba9da5e287)

2 months ago; Fix OOM kill in ert-tests
Eli Zaretskii [Wed, 26 Mar 2025 12:31:41 +0000 (14:31 +0200)]
; Fix OOM kill in ert-tests

* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Mark it 'unstable', as it
might run out of memory on GNU/Linux and on Windows.

(cherry picked from commit 3d5def2677c62aa017b675ced18c9bac2697c439)

2 months ago; Fix 'ert-tests' on MS-Windows
Eli Zaretskii [Wed, 26 Mar 2025 12:22:30 +0000 (14:22 +0200)]
; Fix 'ert-tests' on MS-Windows

* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Skip the test on MS-Windows.

(cherry picked from commit f1715f6411d665442397835ab792ef39051f859a)