GNU bug report logs - #77306
31.0.50; C-x v L from *vc-change-log* buffer leaves wrong default-directory

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Thu, 27 Mar 2025 11:15:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Bug is archived. No further changes may be made.

Full log


Message #28 received at 77306 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: dmitry <at> gutov.dev, 77306 <at> debbugs.gnu.org
Subject: Re: bug#77306: 31.0.50; C-x v L from *vc-change-log* buffer leaves
 wrong default-directory
Date: Thu, 03 Apr 2025 14:25:14 -0400
> Could we reformulate the command definitions so that they didn't need to
> bind default-directory?

We could do something like the patch below, I guess.


        Stefan


diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 2db2a017525..b0161270d4f 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -3095,7 +3095,6 @@ vc-print-root-log
     (t
      (list (when (> vc-log-show-limit 0) vc-log-show-limit)))))
   (let* ((backend (vc-deduce-backend))
-	 (default-directory default-directory)
 	 (with-diff (and (eq limit 1) revision))
 	 (vc-log-short-style (unless with-diff vc-log-short-style))
 	 rootdir)
@@ -3105,12 +3104,14 @@ vc-print-root-log
       (setq backend (vc-responsible-backend rootdir))
       (unless backend
         (error "Directory is not version controlled")))
-    (setq default-directory rootdir)
-    (vc-print-log-internal backend (list rootdir) revision revision limit
-                           (when with-diff 'with-diff))
-    ;; We're looking at the root, so displaying " from <some-file>" in
-    ;; the mode line isn't helpful.
-    (setq vc-parent-buffer-name nil)))
+    (with-temp-buffer
+      (setq default-directory rootdir)
+      (vc-print-log-internal backend (list rootdir) revision revision limit
+                             (when with-diff 'with-diff))
+      ;; We're looking at the root, so displaying " from <some-file>" in
+      ;; the mode line isn't helpful.
+      ;; FIXME: In this eval'd in the appropriate buffer?
+      (setq vc-parent-buffer-name nil))))
 
 ;;;###autoload
 (defun vc-print-branch-log (branch)





This bug report was last modified 45 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.