GNU bug report logs -
#12586
24.2.50; "q" in empty vc-diff buffer causes error
Previous Next
Reported by: Eric Hanchrow <eric.hanchrow <at> gmail.com>
Date: Sat, 6 Oct 2012 16:46:01 UTC
Severity: minor
Tags: patch
Found in version 24.2.50
Done: Chong Yidong <cyd <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
This patch seems to fix the problem.
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 47800bd..c66c4db 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1590,21 +1590,22 @@ 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)
- (if (and (zerop (buffer-size))
- (not (get-buffer-process (current-buffer))))
+ (let ((pop (not
+
;; Treat this case specially so as not to pop the buffer.
- (progn
- (message "%s" (cdr messages))
- nil)
- (diff-mode)
+ (and (zerop (buffer-size))
+ (not (get-buffer-process (current-buffer)))))))
+
(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)
+
+ (let ((result (if (not pop)
+ (progn
+ (message "%s" (cdr messages))
+ nil)
+
;; 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'
@@ -1616,6 +1617,14 @@ Return t if the buffer had changes, nil otherwise."
;; because we don't know that yet.
t)))
+ ;; Make the *vc-diff* buffer read only, the diff-mode key
+ ;; bindings are nicer for read only buffers. pcl-cvs does the
+ ;; same thing.
+ (diff-mode)
+ (setq buffer-read-only t)
+
+ result))))
+
(defun vc-read-revision (prompt &optional files backend default initial-input)
(cond
((null files)
This bug report was last modified 12 years and 303 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.