GNU bug report logs - #63949
30.0.50; `vc-print-log´ does not erase buffer when called from *vc-change-log* buffer, at least for CVS logs

Previous Next

Package: emacs;

Reported by: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>

Date: Wed, 7 Jun 2023 21:06:01 UTC

Severity: normal

Found in version 30.0.50

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 63949 <at> debbugs.gnu.org
Subject: Re: bug#63949: 30.0.50; `vc-print-log´ does not erase buffer when called from *vc-change-log* buffer, at least for CVS logs
Date: Sun, 18 Jun 2023 05:42:44 +0300
On 16/06/2023 22:33, Jens Schmidt wrote:
> On 2023-06-10  19:23, Eli Zaretskii wrote:
> 
>> I'd also like to hear Dmitry's views on these issues.  He was until 
>> now silent in this discussion, AFAICT.
> 
> @Dmitry: What's your view on these issues?  Just making the handling of
> VC parent buffer more documented and "more consistent", whatever that
> means, or do you prefer some particular direction?

I think the appropriate thing here is to back out of the change that 
caused the regression (d494833d47968fcd97ba549654a259d6fb6c2eee, as 
we've found out) and then try to re-fix it some other way (in master?).

Or maybe adjust the current code such as when vc-deduce-fileset-1 does 
change the current buffer, vc-deduce-fileset retains that change.

For example, using this ugly-ish (100% untested) patch:

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 91d3f6f70d3..91aae40a677 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1121,10 +1121,13 @@ vc-deduce-fileset
 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)
+    (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+      (vc-deduce-fileset-1 not-state-changing
+                           allow-unregistered
+                           state-model-only-files)
+      (setq new-buf (current-buffer)))
+    (set-buffer new-buf)))

 (defun vc-deduce-fileset-1 (not-state-changing
                             allow-unregistered

The fact that some backends do call vc-setup-buffer inside 
vc-xx-print-log and some dont', also bears investigation. But the 
question I would like to have answered is, can we drop this call from 
all of them? Rather than trying to add it everywhere.




This bug report was last modified 1 year and 312 days ago.

Previous Next


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