From unknown Mon Jun 23 18:28:45 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#27435 <27435@debbugs.gnu.org> To: bug#27435 <27435@debbugs.gnu.org> Subject: Status: patch for dired-mouse-find-file-other-window Reply-To: bug#27435 <27435@debbugs.gnu.org> Date: Tue, 24 Jun 2025 01:28:45 +0000 retitle 27435 patch for dired-mouse-find-file-other-window reassign 27435 emacs submitter 27435 Tak Kunihiro severity 27435 wishlist tag 27435 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 20 22:03:30 2017 Received: (at submit) by debbugs.gnu.org; 21 Jun 2017 02:03:31 +0000 Received: from localhost ([127.0.0.1]:58640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNUzS-00010I-M1 for submit@debbugs.gnu.org; Tue, 20 Jun 2017 22:03:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNUzQ-000106-M9 for submit@debbugs.gnu.org; Tue, 20 Jun 2017 22:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNUzK-0003Cd-9a for submit@debbugs.gnu.org; Tue, 20 Jun 2017 22:03:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNUzK-0003CZ-6Q for submit@debbugs.gnu.org; Tue, 20 Jun 2017 22:03:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNUzI-0004gb-RN for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:03:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNUzF-0003B0-PN for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:03:20 -0400 Received: from mxl065v67.mxlogic.net ([208.81.65.67]:37238 helo=s14p02o144.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNUzF-00039p-8K for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:03:17 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o144.mxlogic.net(mxl_mta-8.5.0-1789) with ESMTP id 4e3d9495.7f4e5d7fb700.256791.00-579.557825.s14p02o144.mxlogic.net (envelope-from ); Tue, 20 Jun 2017 20:03:16 -0600 (MDT) X-MXL-Hash: 5949d3e47976971b-37bd18695b2da5522ff02729adb303af93a30922 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o144.mxlogic.net(mxl_mta-8.5.0-1789) over TLS secured channel with ESMTP id 0bec9495.0.256385.00-375.556896.s14p02o144.mxlogic.net (envelope-from ); Tue, 20 Jun 2017 19:41:05 -0600 (MDT) X-MXL-Hash: 5949ceb14c215d1c-7da5761d7b16134a8c10462d86773aa5fe215195 Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 7fca_3a33_7859ea3c_022d_4756_94e9_00936ecc91f1; Wed, 21 Jun 2017 10:41:00 +0900 Received: from localhost (unknown [172.24.2.234]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id AAA354C0AF0; Wed, 21 Jun 2017 10:41:01 +0900 (JST) Date: Wed, 21 Jun 2017 10:41:00 +0900 (JST) Message-Id: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> To: bug-gnu-emacs@gnu.org Subject: patch for dired-mouse-find-file-other-window From: Tak Kunihiro X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6052=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6052> : inlines <5938> : streams <1750814> : uri <2447462> X-AnalysisOut: [v=2.2 cv=V/oN6avi c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=LWS] X-AnalysisOut: [FodeU3zMA:10 a=vjyJgskHlLV86ca94-4A:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5100000000; CM=0.500; MH=0.510(2017062006); 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit Cc: tkk@misasa.okayama-u.ac.jp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) 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)} From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 18 00:59:45 2017 Received: (at submit) by debbugs.gnu.org; 18 Jul 2017 04:59:45 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 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 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 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 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 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 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 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 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) Date: Tue, 18 Jul 2017 13:38:03 +0900 (JST) Message-Id: <20170718.133803.63761803157557694.tkk@misasa.okayama-u.ac.jp> To: bug-gnu-emacs@gnu.org Subject: Re: patch for dired-mouse-find-file-other-window From: Tak Kunihiro In-Reply-To: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> References: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit Cc: tkk@misasa.okayama-u.ac.jp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) 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)} From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 02:28:22 2017 Received: (at submit) by debbugs.gnu.org; 26 Aug 2017 06:28:22 +0000 Received: from localhost ([127.0.0.1]:55770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlUZx-0005L0-TM for submit@debbugs.gnu.org; Sat, 26 Aug 2017 02:28:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49242) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlUZw-0005Ko-4l for submit@debbugs.gnu.org; Sat, 26 Aug 2017 02:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlUZp-00033u-SN for submit@debbugs.gnu.org; Sat, 26 Aug 2017 02:28:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43769) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlUZp-00033q-P2 for submit@debbugs.gnu.org; Sat, 26 Aug 2017 02:28:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlUZo-0006bc-7f for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlUZl-00033G-1O for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:28:12 -0400 Received: from mxl065v65.mxlogic.net ([208.81.65.65]:35968 helo=s14p02o142.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dlUZk-00030y-II for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2017 02:28:08 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1834) with ESMTP id 8f411a95.7f4a4b5fe700.53065.00-552.112101.s14p02o142.mxlogic.net (envelope-from ); Sat, 26 Aug 2017 00:28:08 -0600 (MDT) X-MXL-Hash: 59a114f82743a4bd-68cc573f0a5aaf66ff908fe4252ed1830934bb56 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 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 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) Date: Sat, 26 Aug 2017 15:27:47 +0900 (JST) Message-Id: <20170826.152747.1961624282102985626.tkk@misasa.okayama-u.ac.jp> To: bug-gnu-emacs@gnu.org Subject: Re: patch for dired-mouse-find-file-other-window From: Tak Kunihiro In-Reply-To: <20170718.133803.63761803157557694.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> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) 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)} From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 04:09:56 2017 Received: (at 27435) by debbugs.gnu.org; 26 Aug 2017 08:09:57 +0000 Received: from localhost ([127.0.0.1]:55884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlWAG-0007fE-MW for submit@debbugs.gnu.org; Sat, 26 Aug 2017 04:09:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlWAF-0007f1-4x for 27435@debbugs.gnu.org; Sat, 26 Aug 2017 04:09:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlWA4-0003v8-I4 for 27435@debbugs.gnu.org; Sat, 26 Aug 2017 04:09:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlWA4-0003v3-F0; Sat, 26 Aug 2017 04:09:44 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4450 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dlWA3-0000B4-Rx; Sat, 26 Aug 2017 04:09:44 -0400 Date: Sat, 26 Aug 2017 11:09:34 +0300 Message-Id: <83ziam698h.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-reply-to: <20170826.152747.1961624282102985626.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sat, 26 Aug 2017 15:27:47 +0900 (JST)) Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window References: <20170621.104100.1058355568954942364.tkk@misasa.okayama-u.ac.jp> <20170718.133803.63761803157557694.tkk@misasa.okayama-u.ac.jp> <20170826.152747.1961624282102985626.tkk@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sat, 26 Aug 2017 15:27:47 +0900 (JST) > From: Tak Kunihiro > Cc: tkk@misasa.okayama-u.ac.jp > > 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). It is "wishlist" bug report, so lack of response generally means there's not much interest in the proposal. Can you describe a use case where you need to customize the function used to visit a file from Dired? (Btw, we use "visit a file", not "open a file" in our terminology, so at least that aspect in the doc strings of your patch should be amended.) Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 05:28:09 2017 Received: (at 27435) by debbugs.gnu.org; 26 Aug 2017 09:28:09 +0000 Received: from localhost ([127.0.0.1]:55989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlXNx-00012V-Ac for submit@debbugs.gnu.org; Sat, 26 Aug 2017 05:28:09 -0400 Received: from mxl069v66.mxlogic.net ([208.81.69.66]:26733 helo=s18p02o143.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlXNu-00012L-3Z for 27435@debbugs.gnu.org; Sat, 26 Aug 2017 05:28:07 -0400 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 02f31a95.0.145928.00-388.287201.s18p02o143.mxlogic.net (envelope-from ); Sat, 26 Aug 2017 03:28:02 -0600 (MDT) X-MXL-Hash: 59a13f226497ecf1-e41aa653b7c25f36c1c0fc5c8dcdc551ad5f62be Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 4794_20c5_6023e21e_0115_4a0e_9107_9b46a7bc435f; Sat, 26 Aug 2017 18:27:54 +0900 Received: from localhost (p219225-ipngn200207tottori.tottori.ocn.ne.jp [153.182.218.225]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id E0BFA4C0A9E; Sat, 26 Aug 2017 18:27:54 +0900 (JST) Date: Sat, 26 Aug 2017 18:26:58 +0900 (JST) Message-Id: <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> To: eliz@gnu.org Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window From: Tak Kunihiro In-Reply-To: <83ziam698h.fsf@gnu.org> References: <20170718.133803.63761803157557694.tkk@misasa.okayama-u.ac.jp> <20170826.152747.1961624282102985626.tkk@misasa.okayama-u.ac.jp> <83ziam698h.fsf@gnu.org> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 <1760239> : uri <2490022> X-AnalysisOut: [v=2.2 cv=E6K9neVl 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=vGk2VsPmdfzh2YW93noA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017082605); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Thank you for the response! > Can you describe a use case where you need to customize the function > used to visit a file from Dired? On dired I use `RET', `o', and `C-o' on different occasions and I prefer mouse click to work as `RET' instead of `C-o'. This is especially true when there are more than three windows in a frame. The patch lets mouse click on dired visit a file or directory in not in with following customization. (setq dired-mouse-find-file-func 'find-file) > (Btw, we use "visit a file", not "open a file" in our terminology, so > at least that aspect in the doc strings of your patch should be > amended.) I revised phrases from "open a file" to "visit a file". I hope now this patch is ready for consideration and applied. # Change log 2017-08-26 Tak Kunihiro Let user specify function to visit a 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): Visit a file or directory by `dired-mouse-find-file-func' or `dired-mouse-find-dir-func'. (dired-mouse-find-file-func): Specify function to visit a file on `dired-mouse-find-file-other-window'. (dired-mouse-find-dir-func): Specify function to visit a directory on `dired-mouse-find-file-other-window'. # NEWS ** Use can specify function to visit a file or directory in dired using mouse click. You can specify function to visit a 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 visit a 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 visit a 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 visit the 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)} From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 06:27:59 2017 Received: (at 27435) by debbugs.gnu.org; 26 Aug 2017 10:27:59 +0000 Received: from localhost ([127.0.0.1]:56063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlYJr-00056J-Kk for submit@debbugs.gnu.org; Sat, 26 Aug 2017 06:27:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54284) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlYJp-000566-9i for 27435@debbugs.gnu.org; Sat, 26 Aug 2017 06:27:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlYJh-0003Pl-4C for 27435@debbugs.gnu.org; Sat, 26 Aug 2017 06:27:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlYJh-0003Pa-0B; Sat, 26 Aug 2017 06:27:49 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4536 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dlYJg-00044l-DP; Sat, 26 Aug 2017 06:27:48 -0400 Date: Sat, 26 Aug 2017 13:27:39 +0300 Message-Id: <83o9r262uc.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-reply-to: <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sat, 26 Aug 2017 18:26:58 +0900 (JST)) Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window References: <20170718.133803.63761803157557694.tkk@misasa.okayama-u.ac.jp> <20170826.152747.1961624282102985626.tkk@misasa.okayama-u.ac.jp> <83ziam698h.fsf@gnu.org> <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sat, 26 Aug 2017 18:26:58 +0900 (JST) > Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp > From: Tak Kunihiro > > > Can you describe a use case where you need to customize the function > > used to visit a file from Dired? > > On dired I use `RET', `o', and `C-o' on different occasions and I > prefer mouse click to work as `RET' instead of `C-o'. This is > especially true when there are more than three windows in a frame. > > The patch lets mouse click on dired visit a file or directory in > not in with following customization. > > (setq dired-mouse-find-file-func 'find-file) But you could have the same effect by rebinding mouse-2 to another function. We just need to add such a function, which should work like dired-mouse-find-file-other-window, but visit the file in the same window. That sounds like a better alternative for this use case, because customizing a function-valued variable is trickier for users than rebinding keys. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 27 05:03:04 2017 Received: (at 27435) by debbugs.gnu.org; 27 Aug 2017 09:03:05 +0000 Received: from localhost ([127.0.0.1]:57015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dltTE-0006Kv-MQ for submit@debbugs.gnu.org; Sun, 27 Aug 2017 05:03:04 -0400 Received: from mxl065v65.mxlogic.net ([208.81.65.65]:33684 helo=s14p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dltTB-0006KU-Qu for 27435@debbugs.gnu.org; Sun, 27 Aug 2017 05:03:03 -0400 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 fba82a95.0.66812.00-396.137015.s14p02o142.mxlogic.net (envelope-from ); Sun, 27 Aug 2017 03:02:56 -0600 (MDT) X-MXL-Hash: 59a28ac07b0e1a47-9d3e0441dd8175c56fd117d92c5b32587ed8fc07 Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 1b1b_3b2b_48c531b6_acbc_45a7_a285_2e54266bf5fd; Sun, 27 Aug 2017 18:02:53 +0900 Received: from localhost (p219225-ipngn200207tottori.tottori.ocn.ne.jp [153.182.218.225]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id D42374C092E; Sun, 27 Aug 2017 18:02:47 +0900 (JST) Date: Sun, 27 Aug 2017 18:02:43 +0900 (JST) Message-Id: <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> To: eliz@gnu.org Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window From: Tak Kunihiro In-Reply-To: <83o9r262uc.fsf@gnu.org> References: <83ziam698h.fsf@gnu.org> <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> <83o9r262uc.fsf@gnu.org> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 <1760379> : uri <2490513> 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=Q2zgcNCPUS8WusbPfT0A:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017082703); S=0.309(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) >> On dired I use `RET', `o', and `C-o' on different occasions and I >> prefer mouse click to work as `RET' instead of `C-o'. This is >> especially true when there are more than three windows in a frame. >> >> The patch lets mouse click on dired visit a file or directory in >> not in with following customization. >> >> (setq dired-mouse-find-file-func 'find-file) > > But you could have the same effect by rebinding mouse-2 to another > function. We just need to add such a function, which should work like > dired-mouse-find-file-other-window, but visit the file in the same > window. That sounds like a better alternative for this use case, > because customizing a function-valued variable is trickier for users > than rebinding keys. I agree. Then the new function `dired-mouse-find-file-this-window' will look very similar to `dired-mouse-find-file-other-window' but two lines. Is that OK? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 27 08:56:20 2017 Received: (at 27435) by debbugs.gnu.org; 27 Aug 2017 12:56:20 +0000 Received: from localhost ([127.0.0.1]:57126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlx6y-0005GF-Jo for submit@debbugs.gnu.org; Sun, 27 Aug 2017 08:56:20 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:36830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlx6w-0005Fv-Lk for 27435@debbugs.gnu.org; Sun, 27 Aug 2017 08:56:19 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v7RCuBSt021508 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 27 Aug 2017 12:56:11 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7RCu8fi018435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 27 Aug 2017 12:56:09 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v7RCu530008168; Sun, 27 Aug 2017 12:56:06 GMT MIME-Version: 1.0 Message-ID: <43dc12a6-ad00-44b1-b174-46d2ab7f2d0a@default> Date: Sun, 27 Aug 2017 05:56:03 -0700 (PDT) From: Drew Adams To: Tak Kunihiro , eliz@gnu.org Subject: RE: bug#27435: patch for dired-mouse-find-file-other-window References: <83ziam698h.fsf@gnu.org> <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> <83o9r262uc.fsf@gnu.org> <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> In-Reply-To: <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6774.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Then the new function `dired-mouse-find-file-this-window' will look > very similar to `dired-mouse-find-file-other-window' but two lines. > Is that OK? FWIW: Conventionally, we add `-other-window' or `-other-frame' to the same-window command name, which lacks any such suffix. IOW, typically we do not use `-this-window'. FWIW2: Dired+ has had such a same-window mouse command since 1999 (if not before). There is also an `-other-frame' version. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 27 10:41:48 2017 Received: (at 27435) by debbugs.gnu.org; 27 Aug 2017 14:41:48 +0000 Received: from localhost ([127.0.0.1]:57981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlyl2-0007qd-Fg for submit@debbugs.gnu.org; Sun, 27 Aug 2017 10:41:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43111) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlyl0-0007qQ-3Q for 27435@debbugs.gnu.org; Sun, 27 Aug 2017 10:41:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlykr-0006S4-UR for 27435@debbugs.gnu.org; Sun, 27 Aug 2017 10:41:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlykr-0006Ry-Qs; Sun, 27 Aug 2017 10:41:37 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2786 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dlykr-0002Sx-1W; Sun, 27 Aug 2017 10:41:37 -0400 Date: Sun, 27 Aug 2017 17:41:30 +0300 Message-Id: <83zial3wf9.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-reply-to: <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sun, 27 Aug 2017 18:02:43 +0900 (JST)) Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window References: <83ziam698h.fsf@gnu.org> <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> <83o9r262uc.fsf@gnu.org> <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 27 Aug 2017 18:02:43 +0900 (JST) > Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp > From: Tak Kunihiro > > > But you could have the same effect by rebinding mouse-2 to another > > function. We just need to add such a function, which should work like > > dired-mouse-find-file-other-window, but visit the file in the same > > window. That sounds like a better alternative for this use case, > > because customizing a function-valued variable is trickier for users > > than rebinding keys. > > I agree. > > Then the new function `dired-mouse-find-file-this-window' will look > very similar to `dired-mouse-find-file-other-window' but two lines. > Is that OK? We could factor out the common part into a new function, and then make those two functions call it. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 27 20:22:54 2017 Received: (at 27435) by debbugs.gnu.org; 28 Aug 2017 00:22:54 +0000 Received: from localhost ([127.0.0.1]:58433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm7pN-0007rQ-OO for submit@debbugs.gnu.org; Sun, 27 Aug 2017 20:22:53 -0400 Received: from mxl069v66.mxlogic.net ([208.81.69.66]:43586 helo=s18p02o143.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm7pL-0007rH-Uq for 27435@debbugs.gnu.org; Sun, 27 Aug 2017 20:22:53 -0400 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 45263a95.0.161831.00-394.312981.s18p02o143.mxlogic.net (envelope-from ); Sun, 27 Aug 2017 18:22:47 -0600 (MDT) X-MXL-Hash: 59a3625710e26df2-936187df2e3158d914b040c91f4182d44b5a1242 Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 337d_8145_c5c6f2fc_5341_4e9e_a122_ac9cf6c8f5ad; Mon, 28 Aug 2017 09:22:38 +0900 Received: from [192.168.43.59] (p1395043-omed01.osaka.ocn.ne.jp [153.249.98.42]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 827594C0A3B; Mon, 28 Aug 2017 09:22:38 +0900 (JST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window From: Tak Kunihiro In-Reply-To: <83zial3wf9.fsf@gnu.org> Date: Mon, 28 Aug 2017 09:22:35 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <35B0B760-56DC-43A4-B6C9-B29A51CF4547@misasa.okayama-u.ac.jp> References: <83ziam698h.fsf@gnu.org> <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> <83o9r262uc.fsf@gnu.org> <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> <83zial3wf9.fsf@gnu.org> To: drew.adams@oracle.com, Eli Zaretskii X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV6102=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6102> : inlines <6038> : streams <1760470> : uri <2490795> X-AnalysisOut: [v=2.2 cv=E6K9neVl 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=B833973xqv_B6eUtGUEA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5100000000; CM=0.500; MH=0.510(2017082707); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org, =?utf-8?B?5Zu95bqD5Y2T5Lmf?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Thank you for the comments. >>> But you could have the same effect by rebinding mouse-2 to another >>> function. We just need to add such a function, which should work = like >>> dired-mouse-find-file-other-window, but visit the file in the same >>> window. That sounds like a better alternative for this use case, >>> because customizing a function-valued variable is trickier for users >>> than rebinding keys. >>=20 >> Then the new function `dired-mouse-find-file-this-window' will look >> very similar to `dired-mouse-find-file-other-window' but two lines. >> Is that OK? >=20 > We could factor out the common part into a new function, and then make > those two functions call it. > FWIW: Conventionally, we add `-other-window' or `-other-frame' > to the same-window command name, which lacks any such suffix. > IOW, typically we do not use `-this-window'. >=20 > FWIW2: Dired+ has had such a same-window mouse command since > 1999 (if not before). There is also an `-other-frame' version. With the suggestions, I created two functions. - dired-mouse-find-file (new, this inherits common part) - dired-mouse-find-file-other-window - dired-mouse-find-file-other-frame (new) I attach the patch. This does not change the default behavior. diff --git a/dired.252.el b/dired.el index 39dc29e..3a4bbce 100644 --- a/dired.252.el +++ b/dired.el @@ -2117,9 +2117,12 @@ directory in another window." ;; Don't override the setting from .emacs. ;;;###autoload (put 'dired-find-alternate-file 'disabled t) =20 -(defun dired-mouse-find-file-other-window (event) - "In Dired, visit the file or directory name you click on." +(defun dired-mouse-find-file (event &optional find-file-func = find-dir-func) + "In Dired, visit the file or directory name you click on. +FIND-FILE-FUNC and FIND-DIR-FUNC specify functions to visit the file = and directory, respectively." (interactive "e") + (or find-file-func (setq find-file-func 'find-file)) + (or find-dir-func (setq find-file-func 'find-alternate-file)) (let (window pos file) (save-excursion (setq window (posn-window (event-end event)) @@ -2134,9 +2137,19 @@ directory in another window." (dired-goto-subdir file)) (progn (select-window window) - (dired-other-window file))) + (funcall find-dir-func file))) (select-window window) - (find-file-other-window (file-name-sans-versions file t))))) + (funcall find-file-func (file-name-sans-versions file t))))) + +(defun dired-mouse-find-file-other-window (event) + "In Dired, visit the file or directory name you click on other = window." + (interactive "e") + (dired-mouse-find-file event 'find-file-other-window = 'dired-other-window)) + +(defun dired-mouse-find-file-other-frame (event) + "In Dired, visit the file or directory name you click on other = frame." + (interactive "e") + (dired-mouse-find-file event 'find-file-other-frame = 'dired-other-frame)) =20 (defun dired-view-file () "In Dired, examine a file in view mode, returning to Dired when done. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 02 06:20:28 2017 Received: (at 27435) by debbugs.gnu.org; 2 Sep 2017 10:20:28 +0000 Received: from localhost ([127.0.0.1]:41482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1do5XQ-0005ir-JO for submit@debbugs.gnu.org; Sat, 02 Sep 2017 06:20:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1do5XO-0005id-7a for 27435@debbugs.gnu.org; Sat, 02 Sep 2017 06:20:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1do5XD-0007ez-Iu for 27435@debbugs.gnu.org; Sat, 02 Sep 2017 06:20:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1do5XD-0007em-Ey; Sat, 02 Sep 2017 06:20:15 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1896 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1do5XC-0000yn-Qq; Sat, 02 Sep 2017 06:20:15 -0400 Date: Sat, 02 Sep 2017 13:20:06 +0300 Message-Id: <834lsl1jxl.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-reply-to: <35B0B760-56DC-43A4-B6C9-B29A51CF4547@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Mon, 28 Aug 2017 09:22:35 +0900) Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window References: <83ziam698h.fsf@gnu.org> <20170826.182658.1910804375178800263.tkk@misasa.okayama-u.ac.jp> <83o9r262uc.fsf@gnu.org> <20170827.180243.351755072000785818.tkk@misasa.okayama-u.ac.jp> <83zial3wf9.fsf@gnu.org> <35B0B760-56DC-43A4-B6C9-B29A51CF4547@misasa.okayama-u.ac.jp> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tak Kunihiro > Date: Mon, 28 Aug 2017 09:22:35 +0900 > Cc: 国広卓也 , > 27435@debbugs.gnu.org > > With the suggestions, I created two functions. > > - dired-mouse-find-file (new, this inherits common part) > - dired-mouse-find-file-other-window > - dired-mouse-find-file-other-frame (new) > > I attach the patch. This does not change the default behavior. Thanks. Some minor comments: > +(defun dired-mouse-find-file (event &optional find-file-func find-dir-func) > + "In Dired, visit the file or directory name you click on. > +FIND-FILE-FUNC and FIND-DIR-FUNC specify functions to visit the file and directory, respectively." This last line is too long, please break it into 2. Also, the doc string should say explicitly these arguments are optional, and what they default to if omitted or nil. > + (or find-file-func (setq find-file-func 'find-file)) > + (or find-dir-func (setq find-file-func 'find-alternate-file)) I'm not sure I understand why these particular defaults. Can you explain? In particular, find-alternate-file sounds strange to me. Finally, 2 nits: . please always provide a log message for the changes . your patch doesn't apply cleanly, presumably due to some difference in whitespace vs the Git repository; please make sure your diffs are always against the latest Git version Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 02 22:08:18 2017 Received: (at 27435) by debbugs.gnu.org; 3 Sep 2017 02:08:18 +0000 Received: from localhost ([127.0.0.1]:44367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1doKKg-0000gQ-GJ for submit@debbugs.gnu.org; Sat, 02 Sep 2017 22:08:18 -0400 Received: from mxl065v65.mxlogic.net ([208.81.65.65]:54752 helo=s14p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1doKKd-0000gH-Tg for 27435@debbugs.gnu.org; Sat, 02 Sep 2017 22:08:17 -0400 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 c046ba95.0.190993.00-384.402612.s14p02o142.mxlogic.net (envelope-from ); Sat, 02 Sep 2017 20:08:13 -0600 (MDT) X-MXL-Hash: 59ab640d0a8ce7a8-9e55fbefc8785dbe66245b3773718e5f4892ba03 Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 16a4_2fbf_bdd134ea_1a3c_4821_9d44_260120400009; Sun, 03 Sep 2017 11:08:10 +0900 Received: from localhost (p219225-ipngn200207tottori.tottori.ocn.ne.jp [153.182.218.225]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 8E8C84C08E6; Sun, 3 Sep 2017 11:08:10 +0900 (JST) Date: Sun, 03 Sep 2017 11:08:07 +0900 (JST) Message-Id: <20170903.110807.1522119241005954429.tkk@misasa.okayama-u.ac.jp> To: eliz@gnu.org Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window From: Tak Kunihiro In-Reply-To: <834lsl1jxl.fsf@gnu.org> References: <83zial3wf9.fsf@gnu.org> <35B0B760-56DC-43A4-B6C9-B29A51CF4547@misasa.okayama-u.ac.jp> <834lsl1jxl.fsf@gnu.org> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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, RV6107=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6107> : inlines <6052> : streams <1761340> : uri <2494050> 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=2JC] X-AnalysisOut: [JgTwv5E4A:10 a=h9Prw4JL4Da9W-3YIaoA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5100000000; CM=0.500; MH=0.510(2017090212); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27435 Cc: 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Thank you for the response. >> +(defun dired-mouse-find-file (event &optional find-file-func find-dir-func) >> + "In Dired, visit the file or directory name you click on. >> +FIND-FILE-FUNC and FIND-DIR-FUNC specify functions to visit the file and directory, respectively." > > This last line is too long, please break it into 2. Also, the doc > string should say explicitly these arguments are optional, and what > they default to if omitted or nil. I separated the line into two. I revised the doc string to infer option and default explicitly. Please modify it if unclear. >> + (or find-file-func (setq find-file-func 'find-file)) >> + (or find-dir-func (setq find-file-func 'find-alternate-file)) > > I'm not sure I understand why these particular defaults. Can you > explain? In particular, find-alternate-file sounds strange to me. I think `dired-mouse-find-file' should behave similar to `dired-find-file'. For visiting a file in this window, the most similar function to `dired-find-file' with similar argument to `find-file-other-window' is `find-file'. For visiting a directory in this window, the most similar function to `dired-find-file' with similar argument to `dired-other-window' is `dired'. Also there was a typo. On summary, current defaults are shown below. (or find-file-func (setq find-file-func 'find-file)) (or find-dir-func (setq find-dir-func 'dired)) > . please always provide a log message for the changes > . your patch doesn't apply cleanly, presumably due to some > difference in whitespace vs the Git repository; please make sure > your diffs are always against the latest Git version I attach Change Log and a patch relative to the latest Git version. I hope this meets your comments! # Change log 2017-09-03 Tak Kunihiro Let mouse-2 on Dired visit a file or directory in this window, other window, and other frame * lisp/dired.el (dired-mouse-find-file): Visit a file or directory by this window. User can specify functions to visit a file or directory, respectively. (dired-mouse-find-file-other-window): Visit a file or directory in other window. (dired-mouse-find-file-other-frame): Visit a file or directory in other frame. # PATCH diff --git a/dired.260.el b/dired.el index ff62183..da5ad0e 100755 --- a/dired.260.el +++ b/dired.el @@ -2233,9 +2233,15 @@ directory in another window." ;; Don't override the setting from .emacs. ;;;###autoload (put 'dired-find-alternate-file 'disabled t) -(defun dired-mouse-find-file-other-window (event) - "In Dired, visit the file or directory name you click on." +(defun dired-mouse-find-file (event &optional find-file-func find-dir-func) + "In Dired, visit the file or directory name you click on. +The optional arguments FIND-FILE-FUNC and FIND-DIR-FUNC specify +functions to visit the file and directory, respectively. By +default, the file and directry are visited by `find-file' and +`dired', respectively." (interactive "e") + (or find-file-func (setq find-file-func 'find-file)) + (or find-dir-func (setq find-dir-func 'dired)) (let (window pos file) (save-excursion (setq window (posn-window (event-end event)) @@ -2250,9 +2256,19 @@ directory in another window." (dired-goto-subdir file)) (progn (select-window window) - (dired-other-window file))) + (funcall find-dir-func file))) (select-window window) - (find-file-other-window (file-name-sans-versions file t))))) + (funcall find-file-func (file-name-sans-versions file t))))) + +(defun dired-mouse-find-file-other-window (event) + "In Dired, visit the file or directory name you click on other window." + (interactive "e") + (dired-mouse-find-file event 'find-file-other-window 'dired-other-window)) + +(defun dired-mouse-find-file-other-frame (event) + "In Dired, visit the file or directory name you click on other frame." + (interactive "e") + (dired-mouse-find-file event 'find-file-other-frame 'dired-other-frame)) (defun dired-view-file () "In Dired, examine a file in view mode, returning to Dired when done. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 08 04:56:55 2017 Received: (at 27435-done) by debbugs.gnu.org; 8 Sep 2017 08:56:55 +0000 Received: from localhost ([127.0.0.1]:55275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqF5q-0002N6-UY for submit@debbugs.gnu.org; Fri, 08 Sep 2017 04:56:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52173) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqF5p-0002Mu-4u for 27435-done@debbugs.gnu.org; Fri, 08 Sep 2017 04:56:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqF5f-0006v6-2g for 27435-done@debbugs.gnu.org; Fri, 08 Sep 2017 04:56:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqF5f-0006uy-0L; Fri, 08 Sep 2017 04:56:43 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3302 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dqF5e-0003oQ-9O; Fri, 08 Sep 2017 04:56:42 -0400 Date: Fri, 08 Sep 2017 11:56:48 +0300 Message-Id: <83shfxy3e7.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-reply-to: <20170903.110807.1522119241005954429.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sun, 03 Sep 2017 11:08:07 +0900 (JST)) Subject: Re: bug#27435: patch for dired-mouse-find-file-other-window References: <83zial3wf9.fsf@gnu.org> <35B0B760-56DC-43A4-B6C9-B29A51CF4547@misasa.okayama-u.ac.jp> <834lsl1jxl.fsf@gnu.org> <20170903.110807.1522119241005954429.tkk@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27435-done Cc: 27435-done@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Sun, 03 Sep 2017 11:08:07 +0900 (JST) > Cc: drew.adams@oracle.com, 27435@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp > From: Tak Kunihiro > > 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.) From unknown Mon Jun 23 18:28:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 06 Oct 2017 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator