unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19450: 25.0.50; In vc-dir display file in other window
@ 2014-12-27  1:10 Juri Linkov
  2014-12-27  8:46 ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2014-12-27  1:10 UTC (permalink / raw)
  To: 19450

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)





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#19450: 25.0.50; In vc-dir display file in other window
  2014-12-27  1:10 bug#19450: 25.0.50; In vc-dir display file in other window Juri Linkov
@ 2014-12-27  8:46 ` Dmitry Gutov
  2014-12-28  0:55   ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2014-12-27  8:46 UTC (permalink / raw)
  To: Juri Linkov, 19450

On 12/27/2014 03:10 AM, Juri Linkov wrote:

> +(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))

Why not use `vc-dir-find-file-other-window'?






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#19450: 25.0.50; In vc-dir display file in other window
  2014-12-27  8:46 ` Dmitry Gutov
@ 2014-12-28  0:55   ` Juri Linkov
  2014-12-28  1:26     ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2014-12-28  0:55 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 19450

>> +(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))
>
> Why not use `vc-dir-find-file-other-window'?

`vc-dir-display-file' is intended to provide consistency with
all other similar commands:

dired-display-file
occur-mode-display-occurrence
Buffer-menu-switch-other-window
...





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#19450: 25.0.50; In vc-dir display file in other window
  2014-12-28  0:55   ` Juri Linkov
@ 2014-12-28  1:26     ` Dmitry Gutov
  2014-12-29  0:47       ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2014-12-28  1:26 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 19450

On 12/28/2014 02:55 AM, Juri Linkov wrote:

> `vc-dir-display-file' is intended to provide consistency with
> all other similar commands:

Ok, that makes sense.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#19450: 25.0.50; In vc-dir display file in other window
  2014-12-28  1:26     ` Dmitry Gutov
@ 2014-12-29  0:47       ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2014-12-29  0:47 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 19450-done

>> `vc-dir-display-file' is intended to provide consistency with
>> all other similar commands:
>
> Ok, that makes sense.

So let it be.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-29  0:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-27  1:10 bug#19450: 25.0.50; In vc-dir display file in other window Juri Linkov
2014-12-27  8:46 ` Dmitry Gutov
2014-12-28  0:55   ` Juri Linkov
2014-12-28  1:26     ` Dmitry Gutov
2014-12-29  0:47       ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).