summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2009-01-31 02:18:21 +0000
committerNick Roberts <nickrob@snap.net.nz>2009-01-31 02:18:21 +0000
commitf2f8e1b8b0bb137793afe86e7931358c941631e2 (patch)
treebaca34143ee829a3c84cdadb360bd42b83c497e2
parentf11e5363a66ad5513bb342e2359498cdeb3a8f8a (diff)
downloademacs-f2f8e1b8b0bb137793afe86e7931358c941631e2.tar.gz
(vc-dir-mouse-map): New keymap.
(vc-default-dir-printer): Use it locally. (vc-dir-find-file-other-window): Allow mouse events.
-rw-r--r--lisp/vc-dir.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el
index 249ceec75f9..6818b3a99d8 100644
--- a/lisp/vc-dir.el
+++ b/lisp/vc-dir.el
@@ -689,9 +689,10 @@ that share the same state."
(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 @@ Interactively, a prefix argument means to ask for the backend."
(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 @@ Interactively, a prefix argument means to ask for the backend."
(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)