diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b17f91877dddb98a6df4c55147f2120f47173f1..7d532ba899f9658727b9985c5eeb4360087abbc4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-20 Chong Yidong + * 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). diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 2da721b41d8be2e6a9296043e9695e38135729ad..a909aca5bca98063832a6635722abf3c90f0110e 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1584,21 +1584,21 @@ Return t if the buffer had changes, nil otherwise." (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'