From: Juri Linkov <juri@linkov.net>
To: 19450@debbugs.gnu.org
Subject: bug#19450: 25.0.50; In vc-dir display file in other window
Date: Sat, 27 Dec 2014 03:10:47 +0200 [thread overview]
Message-ID: <87ppb5j3s8.fsf@mail.linkov.net> (raw)
This patch adds the standard keybinding `C-o' to vc-dir:
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 54496b9..c90bf1c 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -169,6 +169,9 @@ (defvar vc-dir-menu-map
(define-key map [ise]
'(menu-item "Isearch Files..." vc-dir-isearch
:help "Incremental search a string in the marked files"))
+ (define-key map [display]
+ '(menu-item "Display in Other Window" vc-dir-display-file
+ :help "Display the file on the current line, in another window"))
(define-key map [open-other]
'(menu-item "Open in Other Window" vc-dir-find-file-other-window
:help "Find the file on the current line, in another window"))
@@ -273,6 +276,7 @@ (defvar vc-dir-mode-map
(define-key map "e" 'vc-dir-find-file) ; dired-mode compatibility
(define-key map "\C-m" 'vc-dir-find-file)
(define-key map "o" 'vc-dir-find-file-other-window)
+ (define-key map "\C-o" 'vc-dir-display-file)
(define-key map "\C-c\C-c" 'vc-dir-kill-dir-status-process)
(define-key map [down-mouse-3] 'vc-dir-menu)
(define-key map [mouse-2] 'vc-dir-toggle-mark)
@@ -755,6 +759,13 @@ (defun vc-dir-find-file-other-window (&optional event)
(if event (posn-set-point (event-end event)))
(find-file-other-window (vc-dir-current-file)))
+(defun vc-dir-display-file (&optional event)
+ "Display the file on the current line, in another window."
+ (interactive (list last-nonmenu-event))
+ (if event (posn-set-point (event-end event)))
+ (display-buffer (find-file-noselect (vc-dir-current-file))
+ t))
+
(defun vc-dir-isearch ()
"Search for a string through all marked buffers using Isearch."
(interactive)
next reply other threads:[~2014-12-27 1:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-27 1:10 Juri Linkov [this message]
2014-12-27 8:46 ` bug#19450: 25.0.50; In vc-dir display file in other window Dmitry Gutov
2014-12-28 0:55 ` Juri Linkov
2014-12-28 1:26 ` Dmitry Gutov
2014-12-29 0:47 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ppb5j3s8.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=19450@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.