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: Sat, 26 Aug 2017 15:27:47 +0900 (JST) Message-ID: <20170826.152747.1961624282102985626.tkk@misasa.okayama-u.ac.jp> References: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> <20170718.133803.63761803157557694.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 1503728958 5701 195.159.176.226 (26 Aug 2017 06:29:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 26 Aug 2017 06:29:18 +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 Sat Aug 26 08:29:11 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 1dlUae-0000l0-Qz for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Aug 2017 08:29:05 +0200 Original-Received: from localhost ([::1]:56240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlUal-0006de-AU for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Aug 2017 02:29:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlUaf-0006dT-Bi for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlUac-0003Ci-M6 for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47091) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dlUac-0003Ce-Iz for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dlUac-0005M5-C1 for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:29: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: Sat, 26 Aug 2017 06:29: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 X-Debbugs-Original-Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp Original-Received: via spool by 27435-submit@debbugs.gnu.org id=B27435.150372888420497 (code B ref 27435); Sat, 26 Aug 2017 06:29:02 +0000 Original-Received: (at 27435) by debbugs.gnu.org; 26 Aug 2017 06:28:04 +0000 Original-Received: from localhost ([127.0.0.1]:55767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlUZg-0005KW-HL for submit@debbugs.gnu.org; Sat, 26 Aug 2017 02:28:04 -0400 Original-Received: from mxl065v65.mxlogic.net ([208.81.65.65]:47874 helo=s14p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlUZe-0005K1-1x for 27435@debbugs.gnu.org; Sat, 26 Aug 2017 02:28:03 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1834) over TLS secured channel with ESMTP id be411a95.0.53063.00-384.112093.s14p02o142.mxlogic.net (envelope-from ); Sat, 26 Aug 2017 00:27:56 -0600 (MDT) X-MXL-Hash: 59a114ec752d9180-7e3c28bc1a2ffaabef1037af1d1973f1d3fcb145 Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 45d3_8ab7_815d7129_221b_4717_b664_4d657ebd7e93; Sat, 26 Aug 2017 15:27:50 +0900 Original-Received: from localhost (p219225-ipngn200207tottori.tottori.ocn.ne.jp [153.182.218.225]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id C75FA4C0B34; Sat, 26 Aug 2017 15:27:50 +0900 (JST) In-Reply-To: <20170718.133803.63761803157557694.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: 10.1 X-NAI-Spam-Rules: 6 Rules triggered TS_MSG_REP_80_512=10, RCVD_BAD_SIP=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_FAIL=0, RV6102=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6102> : inlines <6038> : streams <1760221> : uri <2489955> X-AnalysisOut: [v=2.2 cv=DI//22Fb c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=KeK] X-AnalysisOut: [AF7QvOSUA:10 a=AYW51igV99_lQwYeHGoA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017082601); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] 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:136215 Archived-At: I have sent a patch to let mouse click on dired to open file (or directory) in this-window not in other-window, 8 weeks ago. This patch does not change default, and (I think) lets dired respond to what non-expert expects, with following two local lines. (setq dired-mouse-find-dir-func (lambda (file) (interactive) (dired-find-alternate-file))) (setq dired-mouse-find-file-func 'find-file) Please respond to the patch (including rejection). > 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)}