aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2012-10-20 20:04:45 +0800
committerChong Yidong2012-10-20 20:04:45 +0800
commit4c5d08a8685e51d704f05750cefc718810a289f2 (patch)
treec9cf6d0759f8c264552c817234de040d95ae0baa /lisp
parent045ef729040afa82576045f51a6738114b8f3064 (diff)
downloademacs-4c5d08a8685e51d704f05750cefc718810a289f2.tar.gz
emacs-4c5d08a8685e51d704f05750cefc718810a289f2.zip
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. Fixes: debbugs:12586
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/vc/vc.el18
2 files changed, 12 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8b17f91877d..7d532ba899f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12012-10-20 Chong Yidong <cyd@gnu.org> 12012-10-20 Chong Yidong <cyd@gnu.org>
2 2
3 * vc/vc.el (vc-diff-internal): Set up Diff mode even if there are
4 no changes to show (Bug#12586).
5
3 * eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body 6 * eshell/esh-cmd.el (eshell-rewrite-for-command): Copy the body
4 list explicitly (Bug#12571). 7 list explicitly (Bug#12571).
5 8
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 2da721b41d8..a909aca5bca 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1584,21 +1584,21 @@ Return t if the buffer had changes, nil otherwise."
1584 (let ((vc-disable-async-diff (not async))) 1584 (let ((vc-disable-async-diff (not async)))
1585 (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer)) 1585 (vc-call-backend (car vc-fileset) 'diff files rev1 rev2 buffer))
1586 (set-buffer buffer) 1586 (set-buffer buffer)
1587 (diff-mode)
1588 (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
1589 (set (make-local-variable 'revert-buffer-function)
1590 `(lambda (ignore-auto noconfirm)
1591 (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
1592 ;; Make the *vc-diff* buffer read only, the diff-mode key
1593 ;; bindings are nicer for read only buffers. pcl-cvs does the
1594 ;; same thing.
1595 (setq buffer-read-only t)
1587 (if (and (zerop (buffer-size)) 1596 (if (and (zerop (buffer-size))
1588 (not (get-buffer-process (current-buffer)))) 1597 (not (get-buffer-process (current-buffer))))
1589 ;; Treat this case specially so as not to pop the buffer. 1598 ;; Treat this case specially so as not to pop the buffer.
1590 (progn 1599 (progn
1591 (message "%s" (cdr messages)) 1600 (message "%s" (cdr messages))
1592 nil) 1601 nil)
1593 (diff-mode)
1594 (set (make-local-variable 'diff-vc-backend) (car vc-fileset))
1595 (set (make-local-variable 'revert-buffer-function)
1596 `(lambda (ignore-auto noconfirm)
1597 (vc-diff-internal ,async ',vc-fileset ,rev1 ,rev2 ,verbose)))
1598 ;; Make the *vc-diff* buffer read only, the diff-mode key
1599 ;; bindings are nicer for read only buffers. pcl-cvs does the
1600 ;; same thing.
1601 (setq buffer-read-only t)
1602 ;; Display the buffer, but at the end because it can change point. 1602 ;; Display the buffer, but at the end because it can change point.
1603 (pop-to-buffer (current-buffer)) 1603 (pop-to-buffer (current-buffer))
1604 ;; The diff process may finish early, so call `vc-diff-finish' 1604 ;; The diff process may finish early, so call `vc-diff-finish'