unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52826: vc-revert fails on non-default buffer name
@ 2021-12-27 17:53 Juri Linkov
  2021-12-28  0:32 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2021-12-27 17:53 UTC (permalink / raw)
  To: 52826

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.
-- 





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#52826: vc-revert fails on non-default buffer name
  2021-12-27 17:53 bug#52826: vc-revert fails on non-default buffer name Juri Linkov
@ 2021-12-28  0:32 ` Dmitry Gutov
  2021-12-28  8:47   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2021-12-28  0:32 UTC (permalink / raw)
  To: Juri Linkov, 52826

On 27.12.2021 20:53, Juri Linkov wrote:
> 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.

If this help, LGTM.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#52826: vc-revert fails on non-default buffer name
  2021-12-28  0:32 ` Dmitry Gutov
@ 2021-12-28  8:47   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2021-12-28  8:47 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 52826

close 52826 29.0.50
quit

> If this help, LGTM.

So pushed to master in a17a11df04.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-28  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 17:53 bug#52826: vc-revert fails on non-default buffer name Juri Linkov
2021-12-28  0:32 ` Dmitry Gutov
2021-12-28  8:47   ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).