emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110601: Fix *vc-diff* buffer's behav


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110601: Fix *vc-diff* buffer's behavior for empty diffs.
Date: Sat, 20 Oct 2012 20:04:45 +0800
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110601
fixes bug: http://debbugs.gnu.org/12586
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-10-20 20:04:45 +0800
message:
  Fix *vc-diff* buffer's behavior for empty diffs.
  
  * vc/vc.el (vc-diff-internal): Set up Diff mode even if there are
  no changes to show.
modified:
  lisp/ChangeLog
  lisp/vc/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-20 11:54:24 +0000
+++ b/lisp/ChangeLog    2012-10-20 12:04:45 +0000
@@ -1,5 +1,8 @@
 2012-10-20  Chong Yidong  <address@hidden>
 
+       * vc/vc.el (vc-diff-internal): Set up Diff mode even if there are
+       no changes to show (Bug#12586).
+
        * eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
        list explicitly (Bug#12571).
 

=== modified file 'lisp/vc/vc.el'
--- a/lisp/vc/vc.el     2012-09-27 06:59:21 +0000
+++ b/lisp/vc/vc.el     2012-10-20 12:04:45 +0000
@@ -1584,21 +1584,21 @@
     (let ((vc-disable-async-diff (not async)))
       (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer))
     (set-buffer buffer)
+    (diff-mode)
+    (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
+    (set (make-local-variable 'revert-buffer-function)
+        `(lambda (ignore-auto noconfirm)
+           (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
+    ;; Make the *vc-diff* buffer read only, the diff-mode key
+    ;; bindings are nicer for read only buffers. pcl-cvs does the
+    ;; same thing.
+    (setq buffer-read-only t)
     (if (and (zerop (buffer-size))
              (not (get-buffer-process (current-buffer))))
         ;; Treat this case specially so as not to pop the buffer.
         (progn
           (message "%s" (cdr messages))
           nil)
-      (diff-mode)
-      (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
-      (set (make-local-variable 'revert-buffer-function)
-          `(lambda (ignore-auto noconfirm)
-             (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
-      ;; Make the *vc-diff* buffer read only, the diff-mode key
-      ;; bindings are nicer for read only buffers. pcl-cvs does the
-      ;; same thing.
-      (setq buffer-read-only t)
       ;; Display the buffer, but at the end because it can change point.
       (pop-to-buffer (current-buffer))
       ;; The diff process may finish early, so call `vc-diff-finish'


reply via email to

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