commit e719f62a50645dc096ba899fb576168c2e3aa6d2 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Thu Sep 25 09:50:39 2025 +0300 * lisp/minibuffer.el (minibuffer--nonselected-check): Simplify condition. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 252dcdcb07a..b1434868380 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -5636,8 +5636,8 @@ becomes selected." (when (overlayp minibuffer--nonselected-overlay) (delete-overlay minibuffer--nonselected-overlay))) (unless (eq (buffer-local-value 'completion-reference-buffer - (window-buffer (selected-window))) - (window-buffer (active-minibuffer-window))) + (window-buffer)) + (window-buffer window)) (with-current-buffer (window-buffer window) (let ((ov (make-overlay (point-min) (point-max)))) (overlay-put ov 'face 'minibuffer-nonselected) commit 202425f934a78aaee2bab294068dc86942a7c4d0 Author: Yuan Fu Date: Wed Sep 24 19:56:29 2025 -0700 Fix infloop in python-ts-mode string fontification (bug#79457) * lisp/progmodes/python.el (python--treesit-fontify-string): Make sure there's no infloop. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 22a4e2c2e5d..3f86c112265 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1122,12 +1122,13 @@ fontified." "body")) (throw 'break 'font-lock-doc-face)) - (let ((idx 0)) - (while (< idx cursor-idx) - (unless (equal (treesit-node-type - (treesit-node-child parent idx)) - "comment") - (throw 'break 'font-lock-string-face)))) + ;; If there's any non-comment sibling before + ;; cursor, the string isn't a docstring. + (dotimes (idx cursor-idx) + (unless (equal (treesit-node-type + (treesit-node-child parent idx)) + "comment") + (throw 'break 'font-lock-string-face))) (setq cursor parent))))) (ignore-interpolation (not (seq-some commit 77921ce458452312595696082379340802dc7bd4 Author: Alcor Date: Wed Sep 24 16:58:08 2025 -0400 (dabbrev-capf): Improve last fix for bug#61274 Copyright-paperwork-exempt: yes * lisp/dabbrev.el (dabbrev-completion): Don't call `dabbrev--reset-global-variables` any more. (dabbrev-capf): Call it here, unconditionally, instead. diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 00a73572fb1..8f8c691fe5d 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -391,7 +391,6 @@ 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))) @@ -400,8 +399,7 @@ then it searches *all* buffers." (defun dabbrev-capf () "Dabbrev completion function for `completion-at-point-functions'." - (or (stringp dabbrev--abbrev-char-regexp) - (dabbrev--reset-global-variables)) + (dabbrev--reset-global-variables) (let* ((abbrev (dabbrev--abbrev-at-point)) (beg (progn (search-backward abbrev) (point))) (end (progn (search-forward abbrev) (point))) commit cef3f8f11d69f31a71ed021f5ea8cd457f5f6184 Author: Juri Linkov Date: Wed Sep 24 20:46:14 2025 +0300 * lisp/minibuffer.el (minibuffer--nonselected-check): Fix condition. To detect the completions buffer check for the buffer-local value of 'completion-reference-buffer' in the newly selected window. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 8180a5451fa..252dcdcb07a 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -5594,7 +5594,7 @@ and make sexp navigation more intuitive. The list of prompts activating this mode in specific minibuffer interactions is customizable via `minibuffer-regexp-prompts'." :global t - :initialize 'custom-initialize-delay + :initialize #'custom-initialize-delay :init-value t (if minibuffer-regexp-mode (progn @@ -5635,7 +5635,9 @@ becomes selected." (with-current-buffer (window-buffer window) (when (overlayp minibuffer--nonselected-overlay) (delete-overlay minibuffer--nonselected-overlay))) - (unless (eq major-mode #'completion-list-mode) + (unless (eq (buffer-local-value 'completion-reference-buffer + (window-buffer (selected-window))) + (window-buffer (active-minibuffer-window))) (with-current-buffer (window-buffer window) (let ((ov (make-overlay (point-min) (point-max)))) (overlay-put ov 'face 'minibuffer-nonselected) commit d924520187387f7d72f5b5a6c96ebbf040e6e626 Author: Daniel Mendler Date: Mon Sep 22 12:01:23 2025 +0200 Improve minibuffer-nonselected-mode Use private names. Use hashed function symbols. Do not restrict the overlay to the miniwindow, since the minibuffer can be displayed by other windows, for example by packages using child frames or by vertico-buffer-mode (bug#79490). * lisp/minibuffer.el (minibuffer-nonselected-setup): Rename to minibuffer--nonselected-setup. Use hashed function symbols. Add docstring. (minibuffer-nonselected-check): Rename to minibuffer--nonselected-check. Use hashed function symbols. Do not restrict overlay to miniwindow. (minibuffer-nonselected-overlay): Rename to minibuffer--nonselected-overlay. (minibuffer-nonselected-mode): Use hashed function symbol for custom-initialize-delay. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ccd2314fac7..8180a5451fa 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -5624,30 +5624,30 @@ It's displayed on the minibuffer window when the minibuffer remains active, but the minibuffer window is no longer selected." :version "31.1") -(defvar-local minibuffer-nonselected-overlay nil) +(defvar-local minibuffer--nonselected-overlay nil) -(defun minibuffer-nonselected-check (window) +(defun minibuffer--nonselected-check (window) "Check if the active minibuffer's window is no longer selected. Use overlay to highlight the minibuffer window when another window is selected. But don't warn in case when the *Completions* window becomes selected." (if (eq window (selected-window)) (with-current-buffer (window-buffer window) - (when (overlayp minibuffer-nonselected-overlay) - (delete-overlay minibuffer-nonselected-overlay))) - (unless (eq major-mode 'completion-list-mode) + (when (overlayp minibuffer--nonselected-overlay) + (delete-overlay minibuffer--nonselected-overlay))) + (unless (eq major-mode #'completion-list-mode) (with-current-buffer (window-buffer window) (let ((ov (make-overlay (point-min) (point-max)))) (overlay-put ov 'face 'minibuffer-nonselected) - (overlay-put ov 'window window) (overlay-put ov 'evaporate t) - (setq minibuffer-nonselected-overlay ov)))))) + (setq minibuffer--nonselected-overlay ov)))))) -(defun minibuffer-nonselected-setup () +(defun minibuffer--nonselected-setup () + "Setup hooks for `minibuffer-nonselected-mode' to update the overlay." (add-hook 'window-buffer-change-functions - 'minibuffer-nonselected-check nil t) + #'minibuffer--nonselected-check nil t) (add-hook 'window-selection-change-functions - 'minibuffer-nonselected-check nil t)) + #'minibuffer--nonselected-check nil t)) (define-minor-mode minibuffer-nonselected-mode "Minor mode to warn about non-selected active minibuffer. @@ -5655,12 +5655,12 @@ Use the face `minibuffer-nonselected' to highlight the minibuffer window when the minibuffer remains active, but the minibuffer window is no longer selected." :global t - :initialize 'custom-initialize-delay + :initialize #'custom-initialize-delay :init-value t :version "31.1" (if minibuffer-nonselected-mode - (add-hook 'minibuffer-setup-hook #'minibuffer-nonselected-setup) - (remove-hook 'minibuffer-setup-hook #'minibuffer-nonselected-setup))) + (add-hook 'minibuffer-setup-hook #'minibuffer--nonselected-setup) + (remove-hook 'minibuffer-setup-hook #'minibuffer--nonselected-setup))) (provide 'minibuffer) commit 5e396874a9f377c83a322a2fd26e47ba179e3afc Author: Juri Linkov Date: Wed Sep 24 20:14:03 2025 +0300 * lisp/hl-line.el: Rename global-hl-line-modes to global-hl-line-buffers. (global-hl-line-buffers): Rename from recently added 'global-hl-line-modes', use :type 'buffer-predicate' and change the default value to a condition to not match completion-list-mode. (global-hl-line-highlight): Use 'buffer-match-p' instead of 'easy-mmode--globalized-predicate-p' (bug#79481). diff --git a/lisp/hl-line.el b/lisp/hl-line.el index bebccbf942d..541f3dc140a 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el @@ -135,31 +135,10 @@ the command `global-hl-line-mode' to turn Global Hl-Line mode on." :version "24.1" :group 'hl-line) -(defcustom global-hl-line-modes t - "Which major modes `hl-line-mode' is switched on in. -This variable can be either t (all major modes), nil (no major modes), -or a list of modes and (not modes) to switch use this minor mode or -not. For instance - - (c-mode (not message-mode mail-mode) text-mode) - -means \"use this mode in all modes derived from `c-mode', don't use in -modes derived from `message-mode' or `mail-mode', but do use in other -modes derived from `text-mode'\". An element with value t means \"use\" -and nil means \"don't use\". There's an implicit nil at the end of the -list." - :type - '(choice (const :tag "Enable in all major modes" t) - (repeat :tag "Rules (earlier takes precedence)..." - (choice - (const :tag "Enable in all (other) modes" t) - (symbol :value fundamental-mode :tag - "Enable in major mode") - (cons :tag "Don't enable in major modes" - (const :tag "Don't enable in..." not) - (repeat - (symbol :value fundamental-mode :tag - "Major mode")))))) +(defcustom global-hl-line-buffers '(not (derived-mode . completion-list-mode)) + "Whether the Global HL-Line mode should be enabled in a buffer. +The predicate is passed as argument to `buffer-match-p', which see." + :type '(buffer-predicate :tag "Predicate for `buffer-match-p'") :version "31.1") (defvar hl-line-range-function nil @@ -279,9 +258,8 @@ on `post-command-hook'." (defun global-hl-line-highlight () "Highlight the current line in the current window." - (require 'easy-mmode) (when (and global-hl-line-mode ; Might be changed outside the mode function. - (easy-mmode--globalized-predicate-p global-hl-line-modes)) + (buffer-match-p global-hl-line-buffers (current-buffer))) (unless (window-minibuffer-p) (unless (overlayp global-hl-line-overlay) (setq global-hl-line-overlay (hl-line-make-overlay))) ; To be moved. commit d769bae814d18613d0d7d68ecc70657cae60cbd9 Author: Juri Linkov Date: Wed Sep 24 20:07:22 2025 +0300 * lisp/wid-edit.el (buffer-predicate): Implement complete specification. Support all conditions of 'buffer-match-p' in the Customization UI, including recursive 'not', 'or' and 'and' (bug#79481). diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 311e39f4c0f..ee6679f9e63 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -4387,12 +4387,35 @@ is inline." ;;; Buffer predicates. (define-widget 'buffer-predicate 'lazy - "A buffer predicate." + "A buffer predicate for the condition argument of `buffer-match-p'." :tag "Buffer predicate" :type '(choice (const :tag "All buffers" t) (const :tag "No buffers" nil) - ;; FIXME: This should be expanded somehow. - sexp)) + (regexp :tag "Buffer name regexp") + (function :tag "Predicate function") + (cons :tag "Derived mode" + (const derived-mode) + (symbol derived-mode)) + (cons :tag "Major mode" + (const major-mode) + (symbol major-mode)) + (cons :tag "Category" + (const category) + (symbol category)) + (cons :tag "This command" + (const this-command) + (symbol this-command)) + (cons :tag "Not" + (const not) + (list (buffer-predicate :tag "not-condition"))) + (cons :tag "Or" + (const or) + (repeat :tag "List of or-conditions" + buffer-predicate)) + (cons :tag "And" + (const and) + (repeat :tag "List of and-conditions" + buffer-predicate)))) (provide 'wid-edit) commit 19426ea56c56ae00b26557126c9ee14378c466cb Author: Sean Whitton Date: Wed Sep 24 17:24:41 2025 +0100 VC: New cherry-pick-comment API function * lisp/vc/vc-git.el (vc-git-cherry-pick-comment): * lisp/vc/vc-hg.el (vc-hg-cherry-pick-comment): * lisp/vc/vc.el (vc-default-cherry-pick-comment): New functions (bug#79408). diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index be0731a90ca..09f3d293bbe 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -2155,6 +2155,25 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." (vc-git-command standard-output 1 nil "log" "--max-count=1" "--pretty=format:%B" rev))) +(defun vc-git-cherry-pick-comment (_files rev reverse) + ;; Don't just call `vc-git-get-change-comment' in order to make one + ;; fewer call out to Git. We have to resolve REV because even if it's + ;; already a hash it may be an abbreviated one. + (let (comment) + (with-temp-buffer + (vc-git-command t 0 nil "log" "-n1" "--pretty=format:%H%n%B" rev) + (goto-char (point-min)) + (setq rev (buffer-substring-no-properties (point) (pos-eol))) + (forward-line 1) + (setq comment (buffer-substring-no-properties (point) (point-max)))) + (if reverse + (format "Summary: %s\n(cherry picked from commit %s)\n" + comment rev) + (format "Summary: Revert \"%s\"\n\nThis reverts commit %s.\n" + (car (split-string comment "\n" t + split-string-default-separators)) + rev)))) + (defun vc-git--assert-allowed-rewrite (rev) (when (and (not (and vc-allow-rewriting-published-history (not (eq vc-allow-rewriting-published-history 'ask)))) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index edcde41fdd3..a646ba079dd 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1801,6 +1801,24 @@ Cannot delete first working tree because this would break other working trees")) (user-error "\ Cannot relocate first working tree because this would break other working trees"))) +(defun vc-hg-cherry-pick-comment (_files rev reverse) + (let (short long comment) + (with-temp-buffer + (vc-hg-command t 0 nil "log" "--limit=1" + (format "--rev=%s" rev) + "--template={node|short}\n{node}\n{desc}") + (goto-char (point-min)) + (setq short (buffer-substring-no-properties (point) (pos-eol))) + (forward-line 1) + (setq long (buffer-substring-no-properties (point) (pos-eol))) + (forward-line 1) + (setq comment (buffer-substring-no-properties (point) (point-max)))) + (if reverse + (format "Summary: Backed out changeset %s\n\n" short) + ;; The additional line is indeed separated from the original + ;; comment by just one line break, for 'hg graft'. + (format "Summary: %s\n(grafted from %s)\n" comment long)))) + (provide 'vc-hg) ;;; vc-hg.el ends here diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index efb28501c21..782f9ae12a2 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -688,6 +688,15 @@ ;; for REV the backend will attempt to check out a specific ;; revision, if possible without first checking out the default ;; branch. +;; +;; - cherry-pick-comment (files rev reverse) +;; +;; Return a suitable log message for cherry-picking REV onto another +;; branch. Typically this will be REV's original log message with +;; something appended (e.g. Git's "(cherry picked from commit ...)"). +;; If REVERSE, return a suitable log message for a commit that undoes +;; the effects of REV. FILES is for forward-compatibility; existing +;; implementations ignore it. ;;; Changes from the pre-25.1 API: ;; @@ -4837,6 +4846,14 @@ MOVE non-nil means to move instead of copy." (message "Changes %s to `%s'" (if move "moved" "applied") directory))) +(defun vc-default-cherry-pick-comment (files rev reverse) + (if reverse (format "Summary: Reverse-apply changes from revision %s\n\n" + rev) + (and-let* ((fn (vc-find-backend-function + (vc-responsible-backend default-directory) + 'get-change-comment))) + (format "Summary: %s\n" (string-trim (funcall fn files rev)))))) + ;; These things should probably be generally available commit 8368fcb38c1d6c01c78018058df635666f1e8248 Author: Sean Whitton Date: Wed Sep 24 16:07:51 2025 +0100 vc-git--checkin: Apply PATCH-STRING to working tree * lisp/vc/vc-git.el (vc-git--with-apply-temp-to-staging): Rename ... (vc-git--with-apply-temp): ... to this. New ARGS parameter. All uses changes. (vc-git--checkin): In POST function, apply PATCH-STRING to the working tree with 'git apply --3way --ours'. * lisp/vc/vc-hg.el (vc-hg--checkin): Document what the call to 'hg update' is for. * test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch): Delete completed FIXME and workaround. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index cc9f34d5301..be0731a90ca 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1122,8 +1122,8 @@ It is based on `log-edit-mode', and has Git-specific extensions." ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) comment))) -(defmacro vc-git--with-apply-temp-to-staging (temp &rest body) - (declare (indent 1) (debug (symbolp body))) +(cl-defmacro vc-git--with-apply-temp ((temp &rest args) &body body) + (declare (indent 1)) `(let ((,temp (make-nearby-temp-file ,(format "git-%s" temp)))) (unwind-protect (progn ,@body ;; This uses `file-local-name' to strip the @@ -1131,7 +1131,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 nil 0 nil "apply" "--cached" + (vc-git-command nil 0 nil "apply" + ,@(or args '("--cached")) (file-local-name ,temp))) (delete-file ,temp)))) @@ -1235,7 +1236,7 @@ It is an error to supply both or neither." ;; to have the Unix EOL format, because Git expects ;; that, even on Windows. (or pcsw vc-git-commits-coding-system) 'unix))) - (vc-git--with-apply-temp-to-staging patch + (vc-git--with-apply-temp (patch) (with-temp-file patch (insert patch-string))))) (when to-stash (vc-git--stash-staged-changes to-stash))) @@ -1246,8 +1247,29 @@ It is an error to supply both or neither." (lambda () (when (and msg-file (file-exists-p msg-file)) (delete-file msg-file)) + ;; If PATCH-STRING didn't come from C-x v = or C-x v D, we + ;; now need to update the working tree to include the + ;; changes from the commit we just created. + ;; If there are conflicts we want to favor the working + ;; tree's version and the version from the commit will just + ;; show up in the diff of uncommitted changes. + ;; + ;; 'git apply --3way --ours' is the way Git provides to + ;; achieve this. This requires that the index match the + ;; working tree and also implies the --index option, which + ;; means applying the changes to the index in addition to + ;; the working tree. These are both okay here because + ;; before doing this we know the index is empty (we just + ;; committed) and so we can just make use of it and reset + ;; 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))) + (vc-git-command nil 0 nil "reset")) (when to-stash - (vc-git--with-apply-temp-to-staging cached + (vc-git--with-apply-temp (cached) (with-temp-file cached (vc-git-command t 0 nil "stash" "show" "-p"))) (vc-git-command nil 0 nil "stash" "drop"))))) @@ -1391,7 +1413,7 @@ REV is ignored." (unwind-protect (progn (vc-git-command nil 0 nil "read-tree" "HEAD") - ;; See `vc-git--with-apply-temp-to-staging' + ;; See `vc-git--with-apply-temp' ;; regarding use of `file-local-name'. (vc-git-command nil 0 nil "apply" "--cached" (file-local-name cached)) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index ce1abbe3d88..edcde41fdd3 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -1255,23 +1255,30 @@ It is an error to supply both or neither." (cond (msg-file (cl-list* "-l" (file-local-name msg-file) (cdr args))) (args (cons "-m" args))))) - (post (lambda () - (when (and msg-file (file-exists-p msg-file)) - (delete-file msg-file)) - (when (and patch-file (file-exists-p patch-file)) - (delete-file patch-file)) - ;; When committing a patch we run 'hg import' and - ;; then 'hg update'. We have 'hg update' here in the - ;; always-synchronous `post' function because we - ;; assume that 'hg import' is the one that might be - ;; slow and so benefits most from `vc-async-checkin'. - ;; If in fact both the 'hg import' and the 'hg - ;; update' can be slow, then we need to make both of - ;; them part of the async command, possibly by - ;; writing out a tiny shell script (bug#79235). - (when patch-file - (vc-hg-command nil 0 nil "update" "--merge" - "--tool" "internal:local" "tip"))))) + (post + (lambda () + (when (and msg-file (file-exists-p msg-file)) + (delete-file msg-file)) + (when (and patch-file (file-exists-p patch-file)) + (delete-file patch-file)) + ;; If PATCH-STRING didn't come from C-x v = or C-x v D, we + ;; now need to update the working tree to include the + ;; changes from the commit we just created. + ;; If there are conflicts we want to favor the working + ;; tree's version and the version from the commit will just + ;; show up in the diff of uncommitted changes. + ;; + ;; When committing a patch we run two commands, 'hg import' + ;; and then 'hg update'. We have 'hg update' here in the + ;; always-synchronous `post' function because we assume + ;; that 'hg import' is the one that might be slow and so + ;; benefits most from `vc-async-checkin'. If in fact both + ;; the 'hg import' and the 'hg update' can be slow, then we + ;; need to make both of them part of the async command, + ;; possibly by writing out a tiny shell script (bug#79235). + (when patch-file + (vc-hg-command nil 0 nil "update" "--merge" + "--tool" "internal:local" "tip"))))) (if vc-async-checkin (let ((buffer (vc-hg--async-buffer))) (vc-wait-for-process-before-save diff --git a/test/lisp/vc/vc-tests/vc-tests.el b/test/lisp/vc/vc-tests/vc-tests.el index 26da67e20aa..637609d8717 100644 --- a/test/lisp/vc/vc-tests/vc-tests.el +++ b/test/lisp/vc/vc-tests/vc-tests.el @@ -881,15 +881,7 @@ This checks also `vc-backend' and `vc-responsible-backend'." ;; Should take the author, date but not the comment from ;; PATCH-STRING. (let ((patch-string (get-patch-string))) - ;; FIXME: We shouldn't need to branch here. Git should - ;; update the working tree after making the commit. - (cl-case backend - (Git (with-current-buffer buf - (vc-checkin (list file) backend) - (insert "Revert modification, second time") - (let (vc-async-checkin) - (log-edit-done)))) - (t (revert "Revert modification, second time"))) + (revert "Revert modification, second time") (vc-call-backend backend 'checkin-patch patch-string desc2)) (check author date desc2)) commit 190450f4f02422e08877316050da6a2240aa7d0d Author: Sean Whitton Date: Wed Sep 24 15:00:14 2025 +0100 vc-git--checkin: Restore dropping stash of staged changes * lisp/vc/vc-git.el (vc-git--checkin): Restore dropping stash of staged changes after applying it. This was accidentally lost when factoring out vc-git--with-apply-temp-to-staging. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index e7192e092d9..cc9f34d5301 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1249,7 +1249,8 @@ It is an error to supply both or neither." (when to-stash (vc-git--with-apply-temp-to-staging cached (with-temp-file cached - (vc-git-command t 0 nil "stash" "show" "-p"))))))) + (vc-git-command t 0 nil "stash" "show" "-p"))) + (vc-git-command nil 0 nil "stash" "drop"))))) (when msg-file (let ((coding-system-for-write (or pcsw vc-git-commits-coding-system)))