emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 1bcf5d0: * lisp/vc/diff.el (diff-buffer-with-file):


From: Phil
Subject: [Emacs-diffs] master 1bcf5d0: * lisp/vc/diff.el (diff-buffer-with-file): Support indirect buffers.
Date: Sat, 28 Jul 2018 08:34:18 -0400 (EDT)

branch: master
commit 1bcf5d02da96784a04034b4c0aba8fdfa1413c4e
Author: Phil Sainty <address@hidden>
Commit: Phil Sainty <address@hidden>

    * lisp/vc/diff.el (diff-buffer-with-file): Support indirect buffers.
    
    (Bug#32195)
---
 lisp/vc/diff.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/diff.el b/lisp/vc/diff.el
index b850350..ac94586 100644
--- a/lisp/vc/diff.el
+++ b/lisp/vc/diff.el
@@ -226,8 +226,9 @@ With prefix arg, prompt for diff switches."
   "View the differences between BUFFER and its associated file.
 This requires the external program `diff' to be in your `exec-path'."
   (interactive "bBuffer: ")
-  (with-current-buffer (get-buffer (or buffer (current-buffer)))
-    (diff buffer-file-name (current-buffer) nil 'noasync)))
+  (let ((buf (get-buffer (or buffer (current-buffer)))))
+    (with-current-buffer (or (buffer-base-buffer buf) buf)
+      (diff buffer-file-name (current-buffer) nil 'noasync))))
 
 (provide 'diff)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]