emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small enhancement for add-log.el


From: Kim F. Storm
Subject: Re: Small enhancement for add-log.el
Date: Tue, 12 Oct 2004 00:23:13 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> If you want to visit a buffer in View mode,
> just visit it in View mode.  Again, I believe that the only problem is
> that there is something in the pcl-cvs interface that you do not like.

Ok, I agree that my proposal is not desireable.

What about the following patch to pcl-cvs that adds a "v" command in cvs-mode
(for cvs-mode-view-file):

Index: lisp/pcvs-defs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/pcvs-defs.el,v
retrieving revision 1.28
diff -u -r1.28 pcvs-defs.el
--- lisp/pcvs-defs.el   11 Oct 2004 14:58:54 -0000      1.28
+++ lisp/pcvs-defs.el   11 Oct 2004 22:15:32 -0000
@@ -374,7 +374,7 @@
     ("r" .     cvs-mode-remove)
     ("s" .     cvs-mode-status)
     ("t" .     cvs-mode-tag)
-    ;;("v" .   cvs-mode-diff-vendor)
+    ("v" .     cvs-mode-view-file)
     ("x" .     cvs-mode-remove-handled)
     ;; cvstree bindings
     ("+" .     cvs-mode-tree)

Index: lisp/pcvs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/pcvs.el,v
retrieving revision 1.71
diff -u -r1.71 pcvs.el
--- lisp/pcvs.el        2 Jul 2004 04:32:54 -0000       1.71
+++ lisp/pcvs.el        11 Oct 2004 22:21:34 -0000
@@ -1925,6 +1925,18 @@
   (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 @@
       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))
@@ -1968,6 +1980,8 @@
                    buf)
           (when (and cvs-find-file-and-jump (cvs-applicable-p fi 'diff-base))
             (goto-line (cvs-find-modif fi)))
+          (when view
+            (view-mode 1))
           buf))))))
 
 

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]