emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp vc-dir.el


From: Nick Roberts
Subject: [Emacs-diffs] emacs/lisp vc-dir.el
Date: Sat, 31 Jan 2009 02:18:21 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Nick Roberts <nickrob>  09/01/31 02:18:21

Modified files:
        lisp           : vc-dir.el 

Log message:
        (vc-dir-mouse-map): New keymap.
        (vc-default-dir-printer): Use it locally.
        (vc-dir-find-file-other-window): Allow mouse events.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-dir.el?cvsroot=emacs&r1=1.31&r2=1.32

Patches:
Index: vc-dir.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-dir.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- vc-dir.el   29 Jan 2009 12:34:09 -0000      1.31
+++ vc-dir.el   31 Jan 2009 02:18:21 -0000      1.32
@@ -689,9 +689,10 @@
   (interactive)
   (find-file (vc-dir-current-file)))
 
-(defun vc-dir-find-file-other-window ()
+(defun vc-dir-find-file-other-window (&optional event)
   "Find the file on the current line, in another window."
-  (interactive)
+  (interactive (list last-input-event))
+  (if event (posn-set-point (event-end event)))
   (find-file-other-window (vc-dir-current-file)))
 
 (defun vc-dir-isearch ()
@@ -1143,6 +1144,13 @@
    (propertize "Please add backend specific headers here.  It's easy!"
               'face 'font-lock-warning-face)))
 
+;; Keep existing map.
+(defvar vc-dir-mouse-map
+  (let ((map vc-dir-mode-map))
+    (define-key map [mouse-2] 'vc-dir-find-file-other-window)
+    map)
+  "Local keymap for visiting a file.")
+
 (defun vc-default-dir-printer (backend fileentry)
   "Pretty print FILEENTRY."
   ;; If you change the layout here, change vc-dir-move-to-goal-column.
@@ -1169,7 +1177,8 @@
       (if isdir
          "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu"
        "File\nmouse-3: Pop-up menu")
-      'mouse-face 'highlight))))
+      'mouse-face 'highlight
+      'local-map vc-dir-mouse-map))))
 
 (defun vc-default-extra-status-menu (backend)
   nil)




reply via email to

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