From fe1919ab8660374570cb6e1a7763496711b14483 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sat, 10 Nov 2007 05:22:16 +0000 Subject: [PATCH] * vc.el (vc-diff-internal): Make the *vc-diff* buffer read only. * vc-svn.el (vc-svn-print-log, vc-svn-diff): * vc-mcvs.el (vc-mcvs-print-log, vc-mcvs-annotate-command): * vc-cvs.el (vc-cvs-print-log, vc-cvs-diff) (vc-cvs-annotate-command): * vc-arch.el (vc-arch-diff): Remove test to check if start-process is bound, it always is. --- lisp/ChangeLog | 11 +++++++++++ lisp/vc-arch.el | 2 +- lisp/vc-cvs.el | 7 +++---- lisp/vc-mcvs.el | 7 +++---- lisp/vc-svn.el | 5 ++--- lisp/vc.el | 4 ++++ 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 21fcc5a47de..377770cfdcf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2007-11-10 Dan Nicolaescu + + * vc.el (vc-diff-internal): Make the *vc-diff* buffer read only. + + * vc-svn.el (vc-svn-print-log, vc-svn-diff): + * vc-mcvs.el (vc-mcvs-print-log, vc-mcvs-annotate-command): + * vc-cvs.el (vc-cvs-print-log, vc-cvs-diff) + (vc-cvs-annotate-command): + * vc-arch.el (vc-arch-diff): Remove test to check if start-process + is bound, it always is. + 2007-11-10 Jason Rumney * term/w32-win.el (w32-initialize-window-system): Move SJIS font diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el index 3c4e4b4d791..ecaee28c6d2 100644 --- a/lisp/vc-arch.el +++ b/lisp/vc-arch.el @@ -395,7 +395,7 @@ Return non-nil if FILE is unchanged." (setq newvers nil)) (if newvers (error "Diffing specific revisions not implemented") - (let* ((async (and (not vc-disable-async-diff) (fboundp 'start-process))) + (let* ((async (not vc-disable-async-diff)) ;; Run the command from the root dir. (default-directory (vc-arch-root file)) (status diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 79a4263854d..d6573db9df2 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -503,7 +503,7 @@ The changes are between FIRST-REVISION and SECOND-REVISION." "Get change log associated with FILE." (vc-cvs-command buffer - (if (and (vc-stay-local-p files) (fboundp 'start-process)) 'async 0) + (if (vc-stay-local-p files) 'async 0) files "log")) (defun vc-cvs-wash-log () @@ -514,8 +514,7 @@ The changes are between FIRST-REVISION and SECOND-REVISION." (defun vc-cvs-diff (files &optional oldvers newvers buffer) "Get a difference report using CVS between two revisions of FILE." (let* ((async (and (not vc-disable-async-diff) - (vc-stay-local-p files) - (fboundp 'start-process))) + (vc-stay-local-p files))) (status (apply 'vc-cvs-command (or buffer "*vc-diff*") (if async 'async 1) files "diff" @@ -563,7 +562,7 @@ The changes are between FIRST-REVISION and SECOND-REVISION." "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. Optional arg REVISION is a revision to annotate from." (vc-cvs-command buffer - (if (and (vc-stay-local-p file) (fboundp 'start-process)) + (if (vc-stay-local-p file) 'async 0) file "annotate" (if revision (concat "-r" revision))) diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el index 0a2e69cefac..b5a81866eca 100644 --- a/lisp/vc-mcvs.el +++ b/lisp/vc-mcvs.el @@ -443,14 +443,13 @@ The changes are between FIRST-REVISION and SECOND-REVISION." ;; valid relative names. (vc-mcvs-command buffer - (if (and (vc-stay-local-p files) (fboundp 'start-process)) 'async 0) + (if (vc-stay-local-p files) 'async 0) files "log"))) (defun vc-mcvs-diff (files &optional oldvers newvers buffer) "Get a difference report using Meta-CVS between two revisions of FILES." (let* ((async (and (not vc-disable-async-diff) - (vc-stay-local-p files) - (fboundp 'start-process))) + (vc-stay-local-p files))) ;; Run the command from the root dir so that `mcvs filt' returns ;; valid relative names. (default-directory (vc-mcvs-root (car files))) @@ -468,7 +467,7 @@ The changes are between FIRST-REVISION and SECOND-REVISION." Optional arg REVISION is a revision to annotate from." (vc-mcvs-command buffer - (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) + (if (vc-stay-local-p file) 'async 0) file "annotate" (if revision (concat "-r" revision))) (with-current-buffer buffer (goto-char (point-min)) diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 76fdbe5162f..b83f8e0580f 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el @@ -391,7 +391,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (vc-delistify (mapcar 'file-relative-name files)) "\n")) (vc-svn-command buffer - (if (and (= (length files) 1) (vc-stay-local-p (car files)) (fboundp 'start-process)) 'async 0) + (if (and (= (length files) 1) (vc-stay-local-p (car files))) 'async 0) files "log" ;; By default Subversion only shows the log upto the working revision, ;; whereas we also want the log of the subsequent commits. At least @@ -422,8 +422,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (list "-x" (mapconcat 'identity (vc-switches nil 'diff) " ")))) (async (and (not vc-disable-async-diff) (vc-stay-local-p files) - (or oldvers newvers) ; Svn diffs those locally. - (fboundp 'start-process)))) + (or oldvers newvers)))) ; Svn diffs those locally. (apply 'vc-svn-command buffer (if async 'async 0) files "diff" diff --git a/lisp/vc.el b/lisp/vc.el index 474c41c30ae..5811b2f7d63 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1931,6 +1931,10 @@ returns t if the buffer had changes, nil otherwise." nil) (pop-to-buffer (current-buffer)) (diff-mode) + ;; 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) (vc-exec-after `(vc-diff-sentinel ,verbose ,rev1-name ,rev2-name)) ;; In the async case, we return t even if there are no differences ;; because we don't know that yet. -- 2.39.2