From fdc1a12ed1a2ceaebf21ec68752e85dd4527ceab Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 24 Jun 2023 05:57:18 +0300 Subject: [PATCH] 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. --- lisp/vc/vc.el | 13 +++++++++---- 1 file 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 -- 2.39.2