# HG changeset patch # User Nick Roberts # Date 1234245107 0 # Node ID c1950714465b379d1374092e4c2183b0549df97a # Parent 50624469b15a2b11969f0d5db571d97114a664c6 (vc-dir-find-file-other-window): Allow mouse events. (vc-dir-mouse-map): New keymap. (vc-default-dir-printer): Use it locally. diff -r 50624469b15a -r c1950714465b lisp/vc-dir.el --- a/lisp/vc-dir.el Tue Feb 10 05:26:52 2009 +0000 +++ b/lisp/vc-dir.el Tue Feb 10 05:51:47 2009 +0000 @@ -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-nonmenu-event)) + (if event (posn-set-point (event-end event))) (find-file-other-window (vc-dir-current-file))) (defun vc-dir-isearch () @@ -1145,6 +1146,12 @@ (propertize "Please add backend specific headers here. It's easy!" 'face 'font-lock-warning-face))) +(defvar vc-dir-mouse-map + (let ((map (make-sparse-keymap))) + (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. @@ -1171,7 +1178,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 + 'keymap vc-dir-mouse-map)))) (defun vc-default-extra-status-menu (backend) nil)