From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#27435: patch for dired-mouse-find-file-other-window Date: Tue, 18 Jul 2017 13:38:03 +0900 (JST) Message-ID: <20170718.133803.63761803157557694.tkk@misasa.okayama-u.ac.jp> References: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1500354226 24183 195.159.176.226 (18 Jul 2017 05:03:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2017 05:03:46 +0000 (UTC) Cc: tkk@misasa.okayama-u.ac.jp To: 27435@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 18 07:03:42 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXKfb-0005mR-7M for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jul 2017 07:03:39 +0200 Original-Received: from localhost ([::1]:53977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXKfd-0002zw-JD for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jul 2017 01:03:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXKcB-0000CY-0O for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 01:00:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXKc7-0006hd-3h for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 01:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXKc7-0006h4-0X for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 01:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dXKc6-0001S8-M6 for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 01:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jul 2017 05:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27435 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15003539855529 (code B ref -1); Tue, 18 Jul 2017 05:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Jul 2017 04:59:45 +0000 Original-Received: from localhost ([127.0.0.1]:45197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXKbp-0001R7-H3 for submit@debbugs.gnu.org; Tue, 18 Jul 2017 00:59:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXKbo-0001Qu-98 for submit@debbugs.gnu.org; Tue, 18 Jul 2017 00:59:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXKbi-0006VP-0W for submit@debbugs.gnu.org; Tue, 18 Jul 2017 00:59:39 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34528) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXKbh-0006VI-TP for submit@debbugs.gnu.org; Tue, 18 Jul 2017 00:59:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXKbg-0008Dh-DF for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 00:59:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXKbd-0006T6-CF for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 00:59:36 -0400 Original-Received: from mxl069v66.mxlogic.net ([208.81.69.66]:17473 helo=s18p02o143.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXKbc-0006Pr-Mp for bug-gnu-emacs@gnu.org; Tue, 18 Jul 2017 00:59:33 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o143.mxlogic.net(mxl_mta-8.5.0-1834) with ESMTP id 4b59d695.7fed40dda700.117543.00-533.264669.s18p02o143.mxlogic.net (envelope-from ); Mon, 17 Jul 2017 22:59:32 -0600 (MDT) X-MXL-Hash: 596d95b478581b36-bb17d09970b7601040424ed1e63be55730c06d79 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o143.mxlogic.net(mxl_mta-8.5.0-1834) over TLS secured channel with ESMTP id 0b09d695.0.117124.00-398.263547.s18p02o143.mxlogic.net (envelope-from ); Mon, 17 Jul 2017 22:38:09 -0600 (MDT) X-MXL-Hash: 596d90b173778c98-22c1cd9df563901476fb76cddbfb1c73e9a9e137 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 0988_8044_bab11c58_9b95_4071_8b76_743af5117283; Tue, 18 Jul 2017 13:38:04 +0900 Original-Received: from localhost (p1570088-omed01.osaka.ocn.ne.jp [153.250.17.87]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id BAB784C0B3A; Tue, 18 Jul 2017 13:38:04 +0900 (JST) In-Reply-To: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.6 X-NAI-Spam-Rules: 5 Rules triggered TS_MSG_REP_20=0.6, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6073=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6073> : inlines <5978> : streams <1754669> : uri <2465042> X-AnalysisOut: [v=2.2 cv=GOR4KqFK c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=G3g] X-AnalysisOut: [G6ho9WtcA:10 a=AYW51igV99_lQwYeHGoA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017071714); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134700 Archived-At: Is the patch I sent 4 weeks ago NG? From: Tak Kunihiro 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 > > 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)}