From 70f994f6d098c6830cab1fb396d46c42782e7527 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 31 Jan 2022 20:46:06 +0200 Subject: [PATCH] * lisp/vc/vc.el (vc-diff-internal): Assume revert-buffer is in current buffer. Support the case when reverting is in the buffer with a name other than the default name "*vc-diff*". Then don't try to switch to the buffer "*vc-diff*" with an assumption that revert-buffer is always performed in the current buffer (bug#28852). --- lisp/vc/vc.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0096a5fcb3f..a6124acadd2 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1798,10 +1798,9 @@ Return t if the buffer had changes, nil otherwise." (coding-system-for-read (if files (vc-coding-system-for-diff (car files)) 'undecided)) (orig-diff-buffer-clone - (if (and (get-buffer buffer) revert-buffer-in-progress-p) - (with-current-buffer buffer - (clone-buffer - (generate-new-buffer-name " *vc-diff-clone*") nil))))) + (if revert-buffer-in-progress-p + (clone-buffer + (generate-new-buffer-name " *vc-diff-clone*") nil)))) ;; On MS-Windows and MS-DOS, Diff is likely to produce DOS-style ;; EOLs, which will look ugly if (car files) happens to have Unix ;; EOLs. -- 2.39.5