]> git.eshelyaron.com Git - emacs.git/log
emacs.git
8 weeks ago; Improve the documentation of 'slice' display spec (bug#77384).
Eli Zaretskii [Sun, 30 Mar 2025 16:27:22 +0000 (19:27 +0300)]
; Improve the documentation of 'slice' display spec (bug#77384).

(cherry picked from commit 38fec86281efd78af24cc435307d55a00223db49)

8 weeks ago; * src/editfns.c (Fmessage): Mention 'inhibit-message' (bug#77257).
Eli Zaretskii [Sun, 30 Mar 2025 14:38:25 +0000 (17:38 +0300)]
; * src/editfns.c (Fmessage): Mention 'inhibit-message' (bug#77257).

(cherry picked from commit 3f05b455f7e52e70871f47810fe42f1f36fa783b)

8 weeks agorefactor-elisp: stub for cross-project renaming.
Eshel Yaron [Tue, 8 Apr 2025 05:31:47 +0000 (07:31 +0200)]
refactor-elisp: stub for cross-project renaming.

8 weeks ago(multi-isearch-read-files): Fix equality check.
Eshel Yaron [Tue, 8 Apr 2025 05:31:24 +0000 (07:31 +0200)]
(multi-isearch-read-files): Fix equality check.

8 weeks ago(emacs-lisp-mode): Add mode line trust indicator
Eshel Yaron [Tue, 8 Apr 2025 05:30:17 +0000 (07:30 +0200)]
(emacs-lisp-mode): Add mode line trust indicator

8 weeks ago(trusted-content-p): Check buffer-file-name, not truename
Eshel Yaron [Tue, 8 Apr 2025 05:29:50 +0000 (07:29 +0200)]
(trusted-content-p): Check buffer-file-name, not truename

8 weeks agoNew variable vc-followed-link
Eshel Yaron [Tue, 8 Apr 2025 05:29:32 +0000 (07:29 +0200)]
New variable vc-followed-link

8 weeks agoDrop vc-dav.el
Eshel Yaron [Tue, 8 Apr 2025 05:29:17 +0000 (07:29 +0200)]
Drop vc-dav.el

8 weeks agoPixel-align C-x 8 RET completions
Eshel Yaron [Mon, 7 Apr 2025 07:28:00 +0000 (09:28 +0200)]
Pixel-align C-x 8 RET completions

2 months agoDrop 'local-enable-local-variables'.
Eshel Yaron [Sat, 5 Apr 2025 09:54:06 +0000 (11:54 +0200)]
Drop 'local-enable-local-variables'.

2 months agohelp-at-pt.el: Clean up.
Eshel Yaron [Sat, 5 Apr 2025 09:35:40 +0000 (11:35 +0200)]
help-at-pt.el: Clean up.

2 months agoDon't propertize prompt in 'minibuffer--regexp-propertize' (Bug#77497)
Martin Rudalics [Fri, 4 Apr 2025 07:00:15 +0000 (09:00 +0200)]
Don't propertize prompt in 'minibuffer--regexp-propertize' (Bug#77497)

* lisp/minibuffer.el (minibuffer--regexp-propertize): Skip prompt
when propertizing user input (Bug#77497).

(cherry picked from commit ae6ac5cad857cca67bdceb94b870561d9265f981)

2 months agoAdd repeat-map for Python indentation commands
Paul Nelson [Mon, 31 Mar 2025 10:12:01 +0000 (12:12 +0200)]
Add repeat-map for Python indentation commands

* lisp/progmodes/python.el (python-indent-repeat-map): New
keymap for repeating Python indentation commands when using
'repeat-mode' (bug#77417).

(cherry picked from commit 67c89a675df936abbd2b3925adda8d21b31ae59a)

2 months agoFix C-x p p for remote directories with no Tramp connection
Visuwesh [Thu, 3 Apr 2025 13:17:36 +0000 (18:47 +0530)]
Fix C-x p p for remote directories with no Tramp connection

* lisp/progmodes/project.el (project-switch-project): Allow
Tramp to establish a new connection for remote directories.
(Bug#77425)

(cherry picked from commit 839ef39a5e4eb4905c21b1431c146df755fa4b7a)

2 months ago* doc/emacs/custom.texi (File Variables): Reorganize
Stephen Gildea [Thu, 3 Apr 2025 16:49:45 +0000 (09:49 -0700)]
* doc/emacs/custom.texi (File Variables): Reorganize

Reorganize the section on file-local variables to tighten the paragraphs
describing each syntax: line one and local variables section.

(cherry picked from commit 37262eac0525562ac03fe84e6f657de908808245)

2 months agoscope.el: Handle 'cl-symbol-macrolet'
Eshel Yaron [Thu, 3 Apr 2025 17:25:09 +0000 (19:25 +0200)]
scope.el: Handle 'cl-symbol-macrolet'

2 months ago* lisp/window.el (window-deletable-p): Improve tab handling.
Juri Linkov [Thu, 3 Apr 2025 16:28:41 +0000 (19:28 +0300)]
* lisp/window.el (window-deletable-p): Improve tab handling.

Use frame parameter 'tab-bar-lines' instead of 'tab-bar-mode'.
Remove 'window-dedicated-p' (bug#71386).  Doc fix.
Add 'frame' arg to 'window-list-1' (bug#59862).

(cherry picked from commit 79fd696d141f22676d72caf3ae21c9f79e59b91a)

2 months ago; Add a check for liveness to last change
Sean Whitton [Thu, 3 Apr 2025 08:44:10 +0000 (16:44 +0800)]
; Add a check for liveness to last change

(cherry picked from commit 91a75c0d460efb7490c7901ff8572adb14cd50db)

2 months agovc-setup-buffer: Fix leaving wrong default-directory
Sean Whitton [Thu, 3 Apr 2025 08:31:36 +0000 (16:31 +0800)]
vc-setup-buffer: Fix leaving wrong default-directory

* lisp/vc/vc-dispatcher.el (vc-setup-buffer): Use run-with-timer
to ensure the buffer-local value gets set (bug#77306).

(cherry picked from commit 4ace02755bc5cd5add8d88be5abf2de60a92e635)

2 months ago; Skip commit 12b06992dfc944dcd4104a3ae1ce60285b349095
Eshel Yaron [Thu, 3 Apr 2025 16:51:33 +0000 (18:51 +0200)]
; Skip commit 12b06992dfc944dcd4104a3ae1ce60285b349095

2 months ago; Skip commit 8db310ce8b4d453cda8114c3a06cd0f328f99a1b
Eshel Yaron [Thu, 3 Apr 2025 16:51:29 +0000 (18:51 +0200)]
; Skip commit 8db310ce8b4d453cda8114c3a06cd0f328f99a1b

2 months agoPacify gcc -Wclobbered in Freplace_region_contents
Paul Eggert [Wed, 2 Apr 2025 20:52:30 +0000 (13:52 -0700)]
Pacify gcc -Wclobbered in Freplace_region_contents

* src/editfns.c (Freplace_region_contents): Redo slightly to
pacify gcc -Wclobbered, by hoisting the eassume out of SCHARS and
into the caller later, where it’ll do more good anyway.

(cherry picked from commit 5039ad24a362d88ac43d79f9fa5a5ba11f0da61b)

2 months agocl-macs.el: Fix minor merge snafu (bug#77348)
Stefan Monnier [Wed, 2 Apr 2025 19:05:02 +0000 (15:05 -0400)]
cl-macs.el: Fix minor merge snafu (bug#77348)

* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Recover the changes
made in commit 476426168106 and accidentally undone by a later merge of
commit 63adf9dcf53a.

(cherry picked from commit 7cffcbb5137666f1c544e7b0c1a544e2bc660ddd)

2 months agoFix display of wide characters in display margins on TTY frames
Eli Zaretskii [Wed, 2 Apr 2025 17:25:09 +0000 (20:25 +0300)]
Fix display of wide characters in display margins on TTY frames

* src/xdisp.c (display_line): Remove incomplete glyph sequence of
the last multi-column character, if not all of its glyphs fit in
the marginal area.  (Bug#77452)

(cherry picked from commit df82855aeb0038c810a451272eb34ae88984e8f6)

2 months agoMore thorough fix for image slices on mode/header-line
Eli Zaretskii [Wed, 2 Apr 2025 13:12:03 +0000 (16:12 +0300)]
More thorough fix for image slices on mode/header-line

* src/xdisp.c (note_mode_line_or_margin_highlight): Remove
correction of DX and DY due to image slices, as this is now done
in 'mode_line_string'.
* src/dispnew.c (mode_line_string): Make DX and DY account for
image slices.  (Bug#77429)

(cherry picked from commit a9661e643b1235e82b7ba0c9c9c2cd8fa533b5a6)

2 months agoFix widget relationship in customize-themes
Mauro Aranda [Wed, 2 Apr 2025 11:10:18 +0000 (08:10 -0300)]
Fix widget relationship in customize-themes

* lisp/cus-theme.el (customize-themes): The theme button should
be a sibling of the checkbox widget, not a child.  (Bug#77096)

(cherry picked from commit 9cfc01056e1be0fada18b8cfbde6a6a511428edd)

2 months ago(custom--standard-value-p): New function
Stefan Monnier [Tue, 1 Apr 2025 22:06:31 +0000 (18:06 -0400)]
(custom--standard-value-p): New function

* lisp/cus-edit.el (custom-variable-state)
(custom-variable-mark-to-reset-standard): Use `custom--standard-value-p`.

* lisp/custom.el (custom--standard-value-p): New function.
(customize-mark-to-save, custom-push-theme, enable-theme): Use it.

* lisp/help-fns.el (describe-variable): Use `custom--standard-value`.
Extracted from `customize-mark-to-save` by with `ignore-errors`
replaced by `with-demoted-errors`.

(cherry picked from commit 71b3298c0e813ba1432e75370c460eea5caf72d5)

2 months agoAdd 'project-customize-dirlocals'
Elías Gabriel Pérez [Mon, 24 Mar 2025 03:35:32 +0000 (21:35 -0600)]
Add 'project-customize-dirlocals'

* etc/NEWS: Add command entry.
* lisp/menu-bar.el (menu-bar-project-menu): Add command entry to
project menu.
* lisp/progmodes/project.el (project-customize-dirlocals):
New command.  (Bug#77229)

(cherry picked from commit da6da5744b95451bdc3339c3a241892466a08551)

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