From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#18421: 24.4.50; Allow Dired to use unrelated dir trees? Date: Sun, 7 Sep 2014 09:41:23 -0700 (PDT) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1410108150 16661 80.91.229.3 (7 Sep 2014 16:42:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Sep 2014 16:42:30 +0000 (UTC) To: 18421@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 07 18:42:23 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XQfXj-0004Gy-8n for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Sep 2014 18:42:23 +0200 Original-Received: from localhost ([::1]:38875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQfXi-00012w-T8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 07 Sep 2014 12:42:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQfXX-00011s-S7 for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:42:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQfXP-0002oA-8f for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:42:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQfXP-0002o5-67 for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XQfXO-0002yw-HC for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Sep 2014 16:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18421 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141010811911451 (code B ref -1); Sun, 07 Sep 2014 16:42:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Sep 2014 16:41:59 +0000 Original-Received: from localhost ([127.0.0.1]:32945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQfXK-0002yd-FJ for submit@debbugs.gnu.org; Sun, 07 Sep 2014 12:41:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43968) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XQfXG-0002yJ-5a for submit@debbugs.gnu.org; Sun, 07 Sep 2014 12:41:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQfX2-0002jm-Dv for submit@debbugs.gnu.org; Sun, 07 Sep 2014 12:41:48 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQfX2-0002ji-Ah for submit@debbugs.gnu.org; Sun, 07 Sep 2014 12:41:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQfWu-0000zm-In for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:41:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQfWm-0002ie-Uu for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:41:32 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:31111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQfWm-0002ia-Ot for bug-gnu-emacs@gnu.org; Sun, 07 Sep 2014 12:41:24 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s87GfMpQ024936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 7 Sep 2014 16:41:23 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s87GfLb3014469 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 7 Sep 2014 16:41:22 GMT Original-Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s87GfLRx025258 for ; Sun, 7 Sep 2014 16:41:21 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93104 Archived-At: I think this is a bug report or enhancment request, but if I'm mistaken then I would like to know specifically why this is not a good idea, i.e, what specific problems would ensue. Currently, and for a long time now (forever?), `dired-insert-subdir' has called `dired-insert-subdir-validate', which raises an error if the subdir to be inserted is not in the same directory tree. Can we remove this limitation that inserted dirs must be in the same directory tree? This is important in the context of a call to `dired' that passes a cons DIRNAME argument, such as this: (dired '("my dired buffer" "d:/Emacs-23.1" "c:/Emacs-23.2" "~/foo/bar")) That gives you a workable Dired listing, except for this: you cannot use `i' to insert the directories. Normally, one way to work around the not-same-dir-tree problem is to first `cd' to a directory that is a common ancestor of the directories that you want to include. That is just that: a workaround. And it does not work for MS Windows when different drive letters are involved: there is no common ancestor directory. So what happens if we comment out this line in `dired-insert-subdir': (dired-insert-subdir-validate dirname switches) And we get rid of this `if' condition in `dired-insert-subdir-newpos'? (if (dired-tree-lessp dir new-dir) ;; Insert NEW-DIR after DIR (setq new-pos (dired-get-subdir-max elt) alist nil)) So the code does this unconditionally: (setq new-pos (dired-get-subdir-max elt) alist ()) That seems to fix the problem. And I haven't noticed any drawbacks so far. Dired has a lot of code, however, and I no doubt have not tested everything to see that nothing breaks with this fix. And I have not tried it with a platform other than Windows. I'm looking for information about whether this fix is ill-advised and, if so, just what problems it presents. (I would then perhaps look at those problems, to see whether they too can be easily fixed.) If it does not seem ill-advised, then please consider this an enhancement request. Note: There are actually two parts to function `dired-insert-subdir-validate': 1. Check whether `dired-in-this-tree'. This is the part that this fix tries to deal with. 2. Check whether switches that make a difference to `dired-get-filename' are used for the subdir to insert (and are not used for the overall listing). The code comments say that #2 is important for `dired-get-filename'. I have not (yet) seen where/how removing `dired-insert-subdir-validate' creates a problem, but if that comment is correct then removing it should be problematic for `dired-get-filename' when a mix of switches (e.g., no `F' + `F', no `b' + `b') is used. (Does that problem perhaps depend on whether `ls-lisp' is used?) So if #2 is still needed, then instead of just removing `dired-insert-subdir-validate' altogether perhaps we could remove only its part #1. FYI, this report was inspired by a Stack Overflow user question: http://superuser.com/q/807939/250462, which seems like a reasonable feature request. In GNU Emacs 24.4.50.1 (i686-pc-mingw32) of 2014-08-15 on LEG570 Bzr revision: 117706 rgm@gnu.org-20140815043406-p5hbu97cbm7pulcn Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --enable-checking 'CFLAGS=3D-O0 -g3' CPPFLAGS=3D-DGLYPH_DEBUG= =3D1'