summaryrefslogtreecommitdiff
path: root/lisp/vc-dir.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2009-02-10 05:51:47 +0000
committerNick Roberts <nickrob@snap.net.nz>2009-02-10 05:51:47 +0000
commitf8d5a47f5c86637154a70d9ad5883887d1322e7b (patch)
treeee25d1c3b129c040e55d03a8ac8d26ab7dbf0b12 /lisp/vc-dir.el
parent6922e96e5bd8011bc23b18b913a8288d547cc806 (diff)
(vc-dir-find-file-other-window): Allow mouse events.
(vc-dir-mouse-map): New keymap. (vc-default-dir-printer): Use it locally.
Diffstat (limited to 'lisp/vc-dir.el')
-rw-r--r--lisp/vc-dir.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el
index 1f91ff4d37..81be5f10cd 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-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 @@ 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)))
+(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 @@ 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
+ 'keymap vc-dir-mouse-map))))
(defun vc-default-extra-status-menu (backend)
nil)