summaryrefslogtreecommitdiff
path: root/lisp/pcvs.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2004-10-15 23:38:04 +0000
committerKim F. Storm <storm@cua.dk>2004-10-15 23:38:04 +0000
commitd12757b78761972a3d777096e7b3071bc9cfd5e5 (patch)
treeb402847e45b8d267244a5b2194d8000108668a82 /lisp/pcvs.el
parent9d2475efb0d73d57035b7f1d20068704a0e9ebcd (diff)
(cvs-mode-view-file, cvs-mode-view-file-other-window): Add.
(cvs-mode-find-file): Add optional `view' arg to enter view mode.
Diffstat (limited to 'lisp/pcvs.el')
-rw-r--r--lisp/pcvs.el20
1 files changed, 17 insertions, 3 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 120acbbc2bc..0a666927c52 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -1925,6 +1925,18 @@ to hear about anymore."
(cvs-mode-find-file e 'dont-select))
+(defun cvs-mode-view-file (e)
+ "View the file."
+ (interactive (list last-input-event))
+ (cvs-mode-find-file e nil t))
+
+
+(defun cvs-mode-view-file-other-window (e)
+ "View the file."
+ (interactive (list last-input-event))
+ (cvs-mode-find-file e t t))
+
+
(defun cvs-find-modif (fi)
(with-temp-buffer
(call-process cvs-program nil (current-buffer) nil
@@ -1935,7 +1947,7 @@ to hear about anymore."
1)))
-(defun cvs-mode-find-file (e &optional other)
+(defun cvs-mode-find-file (e &optional other view)
"Select a buffer containing the file.
With a prefix, opens the buffer in an OTHER window."
(interactive (list last-input-event current-prefix-arg))
@@ -1963,8 +1975,10 @@ With a prefix, opens the buffer in an OTHER window."
(let ((buf (if rev (cvs-retrieve-revision fi rev)
(find-file-noselect (cvs-fileinfo->full-path fi)))))
(funcall (cond ((eq other 'dont-select) 'display-buffer)
- (other 'switch-to-buffer-other-window)
- (t 'switch-to-buffer))
+ (other
+ (if view 'view-buffer-other-window
+ 'switch-to-buffer-other-window))
+ (t (if view 'view-buffer 'switch-to-buffer)))
buf)
(when (and cvs-find-file-and-jump (cvs-applicable-p fi 'diff-base))
(goto-line (cvs-find-modif fi)))