From: Kim F. Storm Date: Fri, 15 Oct 2004 23:38:04 +0000 (+0000) Subject: (cvs-mode-view-file, cvs-mode-view-file-other-window): Add. X-Git-Tag: ttn-vms-21-2-B4~4563 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d12757b78761972a3d777096e7b3071bc9cfd5e5;p=emacs.git (cvs-mode-view-file, cvs-mode-view-file-other-window): Add. (cvs-mode-find-file): Add optional `view' arg to enter view mode. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f8c0d9d23f3..f46bc155970 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2004-10-16 Kim F. Storm + * fringe.el (fringe-bitmaps): Only initialize when defined. + * pcvs.el (cvs-mode-view-file, cvs-mode-view-file-other-window): Add. (cvs-mode-find-file): Add optional `view' arg to enter view mode. 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)))