summaryrefslogtreecommitdiff
path: root/lisp/vc
diff options
context:
space:
mode:
authorDmitry Gutov <dmitry@gutov.dev>2023-06-24 05:57:18 +0300
committerDmitry Gutov <dmitry@gutov.dev>2023-06-24 05:57:32 +0300
commitfdc1a12ed1a2ceaebf21ec68752e85dd4527ceab (patch)
tree3800eaf4b2bbd427fa48a8bdfebb940be66654eb /lisp/vc
parentd507aa7336b0a295a1fde1676c1606ae7f836a95 (diff)
downloademacs-fdc1a12ed1a2ceaebf21ec68752e85dd4527ceab.tar.gz
emacs-fdc1a12ed1a2ceaebf21ec68752e85dd4527ceab.tar.bz2
emacs-fdc1a12ed1a2ceaebf21ec68752e85dd4527ceab.zip
Fix "vc-print-log does not erase buffer" and associated problems
* lisp/vc/vc.el (vc-deduce-fileset): Make sure to retain the buffer switch (if it did), bug#63949.
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/vc.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 1144a23f317..410fe5c01e1 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1121,10 +1121,15 @@ possible values of STATE are explained in `vc-state', and MODEL in
the returned list.
BEWARE: this function may change the current buffer."
- (with-current-buffer (or (buffer-base-buffer) (current-buffer))
- (vc-deduce-fileset-1 not-state-changing
- allow-unregistered
- state-model-only-files)))
+ (let (new-buf res)
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+ (setq res
+ (vc-deduce-fileset-1 not-state-changing
+ allow-unregistered
+ state-model-only-files))
+ (setq new-buf (current-buffer)))
+ (set-buffer new-buf)
+ res))
(defun vc-deduce-fileset-1 (not-state-changing
allow-unregistered