GNU bug report logs - #52826
vc-revert fails on non-default buffer name

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Mon, 27 Dec 2021 18:16:01 UTC

Severity: normal

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: 52826 <at> debbugs.gnu.org
Subject: bug#52826: vc-revert fails on non-default buffer name
Date: Mon, 27 Dec 2021 19:53:38 +0200
When such customization is used:

  (add-hook 'diff-mode-hook 'rename-uniquely)

that uniquely renames *vc-diff* to *vc-diff*<number>,
then 'vc-revert' completely breaks up because of the hard-coded buffer name.
This patch should fix it:

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 9fc9169821..5a99025289 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2785,7 +2785,7 @@ vc-revert
     (unwind-protect
 	(when (if vc-revert-show-diff
 		  (progn
-		    (setq diff-buffer (generate-new-buffer-name "*vc-diff*"))
+		    (setq diff-buffer (generate-new-buffer "*vc-diff*"))
 		    (vc-diff-internal vc-allow-async-revert vc-fileset
 				      nil nil nil diff-buffer))
 		;; Avoid querying the user again.
-- 




This bug report was last modified 3 years and 147 days ago.

Previous Next


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