GNU bug report logs - #27435
patch for dired-mouse-find-file-other-window

Previous Next

Package: emacs;

Reported by: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Date: Wed, 21 Jun 2017 02:04:02 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
Subject: bug#27435: closed (Re: bug#27435: patch for dired-mouse-find-file-other-window)
Date: Fri, 08 Sep 2017 08:57:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#27435: patch for dired-mouse-find-file-other-window

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 27435 <at> debbugs.gnu.org.

-- 
27435: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27435
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
Cc: 27435-done <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window
Date: Fri, 08 Sep 2017 11:56:48 +0300
> Date: Sun, 03 Sep 2017 11:08:07 +0900 (JST)
> Cc: drew.adams <at> oracle.com, 27435 <at> debbugs.gnu.org, tkk <at> misasa.okayama-u.ac.jp
> From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
> 
> I attach Change Log and a patch relative to the latest Git version.
> 
> I hope this meets your comments!

Thanks, pushed.  One more nit: please always mention the bug number in
the log message.  (I added the missing reference this time.)

[Message part 3 (message/rfc822, inline)]
From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Cc: tkk <at> misasa.okayama-u.ac.jp
Subject: patch for dired-mouse-find-file-other-window
Date: Wed, 21 Jun 2017 10:41:00 +0900 (JST)
For now, mouse click on dired displays file (or directory) in
other-window.  I am sending a patch to display file (or directory)
using specified functions.

# Change log

2017-05-20  Tak Kunihiro  <tkk <at> misasa.okayama-u.ac.jp>

        Let user specify function to open file or directory in dired using mouse-2

        * doc/emacs/dired.texi (Navigation): Document support of customizing functions to be used by mouse-2.
        * lisp/dired.el (dired-mouse-find-file-other-window): Open file or directory by `dired-mouse-find-file-func' or `dired-mouse-find-dir-func'.
    (dired-mouse-find-file-func): Specify function to open file on `dired-mouse-find-file-other-window'.
    (dired-mouse-find-dir-func): Specify function to open directory on `dired-mouse-find-file-other-window'.

# NEWS

** Use can specify function to open file or directory in dired using mouse click.
You can specify function to open file or directory by
'dired-mouse-find-file-func' and 'dired-mouse-find-dir-func'.

# Code

diff --git a/dired.252.el b/dired.el
index 39dc29e..8c21388 100644
--- a/dired.252.el
+++ b/dired.el
@@ -2117,8 +2117,20 @@ directory in another window."
 ;; Don't override the setting from .emacs.
 ;;;###autoload (put 'dired-find-alternate-file 'disabled t)

+(defcustom dired-mouse-find-file-func 'find-file-other-window
+  "Function to open file by `dired-mouse-find-file-other-window'."
+  :group 'mouse
+  :type 'function
+  :version "26.1")
+(defcustom dired-mouse-find-dir-func 'dired-other-window
+  "Function to open directory by `dired-mouse-find-file-other-window'."
+  :group 'mouse
+  :type 'function
+  :version "26.1")
 (defun dired-mouse-find-file-other-window (event)
-  "In Dired, visit the file or directory name you click on."
+  "In Dired, visit the file or directory name you click on.
+To open file or directory, this uses
+`dired-mouse-find-file-func' or `dired-mouse-find-dir-func'."
   (interactive "e")
   (let (window pos file)
     (save-excursion
@@ -2134,9 +2146,9 @@ directory in another window."
                 (dired-goto-subdir file))
            (progn
              (select-window window)
-             (dired-other-window file)))
+             (funcall dired-mouse-find-dir-func file)))
       (select-window window)
-      (find-file-other-window (file-name-sans-versions file t)))))
+      (funcall dired-mouse-find-file-func (file-name-sans-versions file t)))))

 (defun dired-view-file ()
   "In Dired, examine a file in view mode, returning to Dired when done.

# Info

diff --git a/dired.252.texi b/dired.texi
index 0e62a9e..323d350 100644
--- a/dired.252.texi
+++ b/dired.texi
@@ -358,7 +358,9 @@ another window, but do not select that window (@code{dired-display-file
 @findex dired-mouse-find-file-other-window
 Visit the file whose name you clicked on
 (@code{dired-mouse-find-file-other-window}).  This uses another window
-to display the file, like the @kbd{o} command.
+to display the file, like the @kbd{o} command.  You can change which
+window to display the file by customizing the variables
+@code{dired-mouse-find-file-func} and @code{dired-mouse-find-dir-func}.

 @item v
 @kindex v @r{(Dired)}



This bug report was last modified 7 years and 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.