# HG changeset patch # User Nick Roberts # Date 1233368301 0 # Node ID e9aa71a1b711fb83dfc1d280c713e081d67cd54f # Parent 6066300ce2175bf34185ca2bbdbbb330258c5425 (vc-dir-mouse-map): New keymap. (vc-default-dir-printer): Use it locally. (vc-dir-find-file-other-window): Allow mouse events. diff -r 6066300ce217 -r e9aa71a1b711 lisp/vc-dir.el --- a/lisp/vc-dir.el Sat Jan 31 02:15:14 2009 +0000 +++ b/lisp/vc-dir.el Sat Jan 31 02:18:21 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-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)