commit fa8e32f757198a3b883c8015c763572a2be2a707 (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Thu Sep 25 15:24:53 2025 -0400 (dabbrev-completion): Try and fix the test regressions * lisp/dabbrev.el (dabbrev-completion): Revert this part of last change, but additionally set `dabbrev--last-abbrev-location` so we know what the vars were reset for. (dabbrev-capf): Be more careful about when and how to reset the vars. (dabbrev--abbrev-at-point): Don't set `dabbrev--last-abbrev-location`, so it doesn't mess with the marker we set it to in `dabbrev-capf` or `dabbrev-completion`. diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 8f8c691fe5d..4b471eb794c 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -391,15 +391,32 @@ completions. If the prefix argument is 16 (which comes from \\[universal-argument] \\[universal-argument]), then it searches *all* buffers." (interactive "*P") + (dabbrev--reset-global-variables) (setq dabbrev--check-other-buffers (and arg t)) (setq dabbrev--check-all-buffers (and arg (= (prefix-numeric-value arg) 16))) + ;; Set it so `dabbrev-capf' won't reset the vars. + (setq dabbrev--last-abbrev-location (point-marker)) (let ((completion-at-point-functions '(dabbrev-capf))) (completion-at-point))) (defun dabbrev-capf () "Dabbrev completion function for `completion-at-point-functions'." - (dabbrev--reset-global-variables) + ;; Don't reset the vars if we're in the "same" completion, especially since + ;; they may have been set to different values, e.g. if the user passes + ;; a non-nil ARG to `dabbrev-completion'. + (unless (and (markerp dabbrev--last-abbrev-location) + (eq (current-buffer) + (marker-buffer dabbrev--last-abbrev-location)) + (= (point) dabbrev--last-abbrev-location)) + (dabbrev--reset-global-variables) + ;; FIXME: Contrary to `dabbrev-completion', the CAPF protocol doesn't + ;; have a way to control the scope of the search. We just default + ;; to confine it to the current buffer. + (setq dabbrev--check-other-buffers nil) + (setq dabbrev--check-all-buffers nil) + (setq dabbrev--last-abbrev-location (point-marker))) + (let* ((abbrev (dabbrev--abbrev-at-point)) (beg (progn (search-backward abbrev) (point))) (end (progn (search-forward abbrev) (point))) @@ -645,25 +662,24 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]." ;; Return abbrev at point (save-excursion ;; Record the end of the abbreviation. - (setq dabbrev--last-abbrev-location (point)) - ;; If we aren't right after an abbreviation, - ;; move point back to just after one. - ;; This is so the user can get successive words - ;; by typing the punctuation followed by M-/. - (save-match-data - (if (save-excursion - (forward-char -1) - (not (looking-at (or dabbrev-abbrev-char-regexp - "\\sw\\|\\s_")))) - (if (re-search-backward (or dabbrev-abbrev-char-regexp - "\\sw\\|\\s_") - nil t) - (forward-char 1) - (user-error "No possible abbreviation preceding point")))) - ;; Now find the beginning of that one. - (dabbrev--goto-start-of-abbrev) - (buffer-substring-no-properties - dabbrev--last-abbrev-location (point)))) + (let ((end (point))) + ;; If we aren't right after an abbreviation, + ;; move point back to just after one. + ;; This is so the user can get successive words + ;; by typing the punctuation followed by M-/. + (save-match-data + (if (save-excursion + (forward-char -1) + (not (looking-at (or dabbrev-abbrev-char-regexp + "\\sw\\|\\s_")))) + (if (re-search-backward (or dabbrev-abbrev-char-regexp + "\\sw\\|\\s_") + nil t) + (forward-char 1) + (user-error "No possible abbreviation preceding point")))) + ;; Now find the beginning of that one. + (dabbrev--goto-start-of-abbrev) + (buffer-substring-no-properties (point) end)))) (defun dabbrev--reset-global-variables () "Initialize all global variables." commit 06d87e44cb614b846f37eb25ccafce2065e2e9d2 Author: Elías Gabriel Pérez Date: Thu Sep 25 13:40:27 2025 -0400 (electric-indent-actions): Add missing NEWS * lisp/electric.el (electric-indent-actions): Fix docstring. diff --git a/etc/NEWS b/etc/NEWS index 602c375dc2f..a6f897c602f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -737,6 +737,12 @@ To use this, add a list to both electric pair user options: '("/*" . "*/")'. You can also specify to insert an extra space after the first string pair: '("/*" " */" t)'. +--- +** New user option 'electric-indent-actions'. +This user options specifies a list of actions to reindent. The possible +elements for this list are: 'yank', reindent the yanked text; +'before-save', indent the whole buffer before saving it. + +++ ** You can now use 'M-~' during 'C-x s' ('save-some-buffers'). Typing 'M-~' while saving some buffers means not to save the buffer and diff --git a/lisp/electric.el b/lisp/electric.el index 6ecdea57d6b..a1131499be6 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -196,9 +196,9 @@ Returns nil when we can't find this char." "List of actions to indent. The valid elements of this list can be: - - yank: Indent the yanked text only if point is not in a string or + - `yank': Indent the yanked text only if point is not in a string or comment and yanked region is longer than 1 line. - - save: Indent the whole buffer before saving it. + - `before-save': Indent the whole buffer before saving it. The indentation will not happen when the major mode is unable to reindent code reliably, such as in buffers where indentation is commit 9a86a093bc199919e7fff422eb664b78f4ce02d7 Author: Sean Whitton Date: Thu Sep 25 18:19:38 2025 +0100 vc-git--checkin: Ignore 'git apply --3way' exiting 1 This is expected to happen in some cases. * lisp/vc/vc-git.el (vc-git--with-apply-temp): New OKSTATUS parameter. (vc-git--checkin): Use it to ignore 'git apply --3way' exiting 1. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 9d655e34112..b97e0888a56 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1123,7 +1123,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." comment))) (cl-defmacro vc-git--with-apply-temp - ((temp &optional buffer &rest args) &body body) + ((temp &optional buffer okstatus &rest args) &body body) (declare (indent 1)) `(let ((,temp (make-nearby-temp-file ,(format "git-%s" temp)))) (unwind-protect (progn ,@body @@ -1132,7 +1132,8 @@ It is based on `log-edit-mode', and has Git-specific extensions." ;; because we've had at least one problem ;; report where relativizing the file name ;; meant that Git failed to find it. - (vc-git-command ,buffer 0 nil "apply" + (vc-git-command ,buffer ,(or okstatus 0) + nil "apply" ,@(or args '("--cached")) (file-local-name ,temp))) (delete-file ,temp)))) @@ -1266,7 +1267,7 @@ It is an error to supply both or neither." (when patch-string (vc-git-command nil 0 nil "add" "--all") (with-temp-buffer - (vc-git--with-apply-temp (patch t "--3way") + (vc-git--with-apply-temp (patch t 1 "--3way") (with-temp-file patch (insert patch-string))) ;; We could delete the following if we could also pass commit 69ac58b5d2a87be4d88543399f97486a31a95498 Author: Eli Zaretskii Date: Thu Sep 25 20:06:12 2025 +0300 ; Avoid byte-compiler warnings in python.el * lisp/progmodes/python.el (treesit-node-prev-sibling) (treesit-node-field-name-for-child): Declare. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 3f86c112265..f06d58a6c20 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -267,7 +267,9 @@ (declare-function treesit-node-start "treesit.c") (declare-function treesit-node-end "treesit.c") (declare-function treesit-node-parent "treesit.c") +(declare-function treesit-node-child "treesit.c") (declare-function treesit-node-prev-sibling "treesit.c") +(declare-function treesit-node-field-name-for-child "treesit.c") (add-to-list 'treesit-language-source-alist commit b2e35d1d2c52d9d00809550702f9f4628651cfe2 Author: Sean Whitton Date: Thu Sep 25 17:44:30 2025 +0100 vc-git--checkin: Avoid passing --ours to git-apply * lisp/vc/vc-git.el (vc-git--with-apply-temp): New BUFFER param. (vc-git--checkin): Avoid passing --ours to git-apply. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 09f3d293bbe..9d655e34112 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1122,7 +1122,8 @@ It is based on `log-edit-mode', and has Git-specific extensions." ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) comment))) -(cl-defmacro vc-git--with-apply-temp ((temp &rest args) &body body) +(cl-defmacro vc-git--with-apply-temp + ((temp &optional buffer &rest args) &body body) (declare (indent 1)) `(let ((,temp (make-nearby-temp-file ,(format "git-%s" temp)))) (unwind-protect (progn ,@body @@ -1131,7 +1132,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." ;; because we've had at least one problem ;; report where relativizing the file name ;; meant that Git failed to find it. - (vc-git-command nil 0 nil "apply" + (vc-git-command ,buffer 0 nil "apply" ,@(or args '("--cached")) (file-local-name ,temp))) (delete-file ,temp)))) @@ -1264,9 +1265,26 @@ It is an error to supply both or neither." ;; afterwards. (when patch-string (vc-git-command nil 0 nil "add" "--all") - (vc-git--with-apply-temp (patch "--3way" "--ours") - (with-temp-file patch - (insert patch-string))) + (with-temp-buffer + (vc-git--with-apply-temp (patch t "--3way") + (with-temp-file patch + (insert patch-string))) + ;; We could delete the following if we could also pass + ;; --ours to git-apply, but that is only available in + ;; recent versions of Git. --3way is much older. + (cl-loop + initially (goto-char (point-min)) + ;; git-apply doesn't apply Git's usual quotation and + ;; escape rules for printing file names so we can do + ;; this simple regexp processing. + ;; (Passing -z does not affect the relevant output.) + while (re-search-forward "^U " nil t) + collect (buffer-substring-no-properties (point) + (pos-eol)) + into paths + finally (when paths + (vc-git-command nil 0 paths + "checkout" "--ours")))) (vc-git-command nil 0 nil "reset")) (when to-stash (vc-git--with-apply-temp (cached) commit 3536f1aa3371ab254e6cf96c2a21512049998644 Author: Michael Albinus Date: Thu Sep 25 15:02:50 2025 +0200 Adapt tramp-tests.el * test/lisp/net/tramp-tests.el (tramp-test26-interactive-file-name-completion): Adapt test. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index e011b99be57..3432e6eb706 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -5045,11 +5045,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (when tramp-trace (when (get-buffer trace-buffer) (kill-buffer trace-buffer)) (dolist - (elt (mapcar #'intern (all-completions "tramp-" obarray #'functionp))) + (elt + (append + (mapcar #'intern (all-completions "tramp-" obarray #'functionp)) + '(completion-file-name-table read-file-name))) (unless (get elt 'tramp-suppress-trace) - (trace-function-background elt))) - (trace-function-background #'completion-file-name-table) - (trace-function-background #'read-file-name)) + (trace-function-background elt)))) (unwind-protect (dolist (syntax (if (tramp--test-expensive-test-p) @@ -5196,11 +5197,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (discard-input) (setq test (car test-and-result) unread-command-events - (append test '(tab tab return return)) + (append test (if noninteractive '(tab tab) + '(tab tab return))) completions nil - result - (read-file-name - "Prompt: " nil nil 'confirm nil predicate)) + result (read-file-name ": " nil nil nil nil predicate)) (if (or (not (get-buffer "*Completions*")) (string-match-p