]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix "vc-print-log does not erase buffer" and associated problems
authorDmitry Gutov <dmitry@gutov.dev>
Sat, 24 Jun 2023 02:57:18 +0000 (05:57 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Sat, 24 Jun 2023 02:57:32 +0000 (05:57 +0300)
* lisp/vc/vc.el (vc-deduce-fileset): Make sure to retain the
buffer switch (if it did), bug#63949.

lisp/vc/vc.el

index 1144a23f317e8afa294472f0dddbdb4b48e182aa..410fe5c01e18d7bf0b93fcf259b78a645a37ae75 100644 (file)
@@ -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