From unknown Tue Jun 17 20:39:19 2025 X-Loop: don@donarmstrong.com Subject: bug#27: incorrect code in dired-insert-directory Reply-To: "Drew Adams" , 27@debbugs.gnu.org Resent-From: "Drew Adams" Original-Sender: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 03 Mar 2008 03:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 27 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.120451311223557 (code B ref -1); Mon, 03 Mar 2008 03:05:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-0.7 required=4.0 tests=AWL,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Mar 2008 02:58:32 +0000 Received: from ironport2-out.pppoe.ca (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m232wPK1023549 for ; Sun, 2 Mar 2008 18:58:26 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CABf3ykfO+LKX/2dsb2JhbACRd5lXgQA X-IronPort-AV: E=Sophos;i="4.25,435,1199682000"; d="scan'208";a="15470899" Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 02 Mar 2008 21:58:11 -0500 Received: from pastel.home ([206.248.178.151]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id JFJ94910 for ; Sun, 02 Mar 2008 21:58:10 -0500 Received: by pastel.home (Postfix, from userid 20848) id C15B58279; Sun, 2 Mar 2008 21:58:10 -0500 (EST) Resent-Message-ID: Resent-To: submit@debbugs.gnu.org Resent-From: Stefan Monnier Resent-Date: Sun, 02 Mar 2008 21:58:10 -0500 X-Original-To: monnier@iro.umontreal.ca Delivered-To: monnier@iro.umontreal.ca Received: from perlin.iro.umontreal.ca (perlin.iro.umontreal.ca [132.204.24.51]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id A287E2CF80F for ; Fri, 29 Feb 2008 02:09:18 -0500 (EST) Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by perlin.iro.umontreal.ca (Postfix) with ESMTP id 560C814821A for ; Fri, 29 Feb 2008 02:09:11 -0500 (EST) Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUzMl-0005uo-1H for monnier@iro.umontreal.ca; Fri, 29 Feb 2008 02:09:11 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUzMb-0005qf-1K for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:09:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUzMZ-0005oZ-Cq for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:09:00 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUzMZ-0005oS-9P for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:08:59 -0500 Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JUzMY-0001Rt-Ni for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:08:59 -0500 Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m1T78uYf002411 for ; Fri, 29 Feb 2008 01:08:56 -0600 Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1T3e4hH020582 for ; Fri, 29 Feb 2008 00:08:55 -0700 Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3594982491204268930; Thu, 28 Feb 2008 23:08:50 -0800 Received: from dradamslap1 (/141.144.80.6) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 Feb 2008 23:08:49 -0800 From: "Drew Adams" To: Date: Thu, 28 Feb 2008 23:08:52 -0800 Message-ID: <001f01c87aa1$f176d7c0$0600a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ach6ofC6NouTXYTUShSR7cc+EIR2Mw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org Errors-To: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-1.94, requis 5, BAYES_00 -2.60, RECEIVED_FROM_NOUNK 0.66, SPF_HELO_PASS -0.00) X-DIRO-MailScanner-From: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org This line near the end of dired-insert-directory is wrong: (if (and (or hdr wildcard) (not (looking-at "^ /.*:$"))) The problem is that "^ /.*:$" does not recognize a directory name on MS Windows. The purpose of this code is to see if the directory name is already in the buffer - if not, then it adds it. The test always fails on Windows, so, whenever (or hdr wildcard) is non-nil, the `if' test succeeds. That inserts a second copy of the directory name in the buffer in some situations. The regexp works only for Unix and GNU/Linux, not for Windows, which has directories that have drive letters: c:/foobar/. To reproduce (on Windows): emacs -Q Load the source file files.el. C-u C-x 4 d Use switches -lR, and enter some directory name. The first directory name in the buffer appears twice (the others are OK). Note: The problem does not seem to arise if you don't load the source file, for some reason. This problem also exists in 22.1.90. And it exists as far back as Emacs 20. In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include' From unknown Tue Jun 17 20:39:19 2025 X-Loop: don@donarmstrong.com Subject: bug#27: incorrect code in dired-insert-directory Reply-To: Chong Yidong , 27@debbugs.gnu.org Resent-From: Chong Yidong Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 20 Apr 2008 13:55:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 27 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 27-submit@emacsbugs.donarmstrong.com id=B27.12086992084785 (code B ref 27); Sun, 20 Apr 2008 13:55:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=4.0 tests=AWL,MURPHY_DRUGS_REL8, RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 27) by emacsbugs.donarmstrong.com; 20 Apr 2008 13:46:48 +0000 Received: from furry (c-98-216-111-182.hsd1.ma.comcast.net [98.216.111.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m3KDkjaO004779 for <27@emacsbugs.donarmstrong.com>; Sun, 20 Apr 2008 06:46:46 -0700 Received: by furry (Postfix, from userid 1000) id 86671C047; Sun, 20 Apr 2008 09:46:40 -0400 (EDT) From: Chong Yidong To: "Drew Adams" Cc: 27@debbugs.gnu.org Date: Sun, 20 Apr 2008 09:46:40 -0400 Message-ID: <878wz83agv.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > This line near the end of dired-insert-directory is wrong: > > (if (and (or hdr wildcard) (not (looking-at "^ /.*:$"))) > > The problem is that "^ /.*:$" does not recognize a directory name on > MS Windows... The regexp works only for Unix and GNU/Linux, not for > Windows, which has directories that have drive letters Patch welcome (I'd work on this, but I can't test it since I don't have Windows available). From unknown Tue Jun 17 20:39:19 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: "Drew Adams" Subject: bug#27 closed by Stefan Monnier (Re: incorrect code in dired-insert-directory) Message-ID: References: <001f01c87aa1$f176d7c0$0600a8c0@us.oracle.com> X-Emacs-PR-Message: they-closed 27 X-Emacs-PR-Package: emacs Reply-To: 27@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1213125603-31605-1" This is a multi-part message in MIME format... ------------=_1213125603-31605-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #27: incorrect code in dired-insert-directory It has been closed by Stefan Monnier . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Stefan Monnier by replying to this email. --=20 27: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D27 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1213125603-31605-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From monnier@iro.umontreal.ca Tue Jun 10 12:11:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-0.8 required=4.0 tests=AWL,BAYES_00,FAKE_REPLY_C, MURPHY_DRUGS_REL8 autolearn=no version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 27-done) by emacsbugs.donarmstrong.com; 10 Jun 2008 19:11:40 +0000 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m5AJBau9030337 for <27-done@emacsbugs.donarmstrong.com>; Tue, 10 Jun 2008 12:11:37 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgwFAD5uTkhMCpcZ/2dsb2JhbACBW7AE X-IronPort-AV: E=Sophos;i="4.27,618,1204520400"; d="scan'208";a="22375278" Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 10 Jun 2008 15:11:31 -0400 Received: from pastel.home ([76.10.151.25]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id QZV37531; Tue, 10 Jun 2008 15:11:31 -0400 Received: by pastel.home (Postfix, from userid 20848) id 5419A82F1; Tue, 10 Jun 2008 15:11:31 -0400 (EDT) From: Stefan Monnier To: 27-done@debbugs.gnu.org Subject: Re: incorrect code in dired-insert-directory Message-ID: Date: Tue, 10 Jun 2008 15:11:31 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I believe this was fixed by the patch below, Stefan --- dired.el.~1.399.~ 2008-06-06 21:10:43.000000000 -0400 +++ dired.el 2008-06-10 15:09:37.000000000 -0400 @@ -1044,7 +1044,9 @@ ;; Insert text at the beginning to standardize things. (save-excursion (goto-char opoint) - (if (and (or hdr wildcard) (not (looking-at "^ /.*:$"))) + (if (and (or hdr wildcard) + (not (and (looking-at "^ \\(.*\\):$") + (file-name-absolute-p (match-string 1))))) ;; Note that dired-build-subdir-alist will replace the name ;; by its expansion, so it does not matter whether what we insert ;; here is fully expanded, but it should be absolute. ------------=_1213125603-31605-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From monnier@iro.umontreal.ca Sun Mar 2 18:58:32 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-0.7 required=4.0 tests=AWL,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 3 Mar 2008 02:58:32 +0000 Received: from ironport2-out.pppoe.ca (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m232wPK1023549 for ; Sun, 2 Mar 2008 18:58:26 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CABf3ykfO+LKX/2dsb2JhbACRd5lXgQA X-IronPort-AV: E=Sophos;i="4.25,435,1199682000"; d="scan'208";a="15470899" Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 02 Mar 2008 21:58:11 -0500 Received: from pastel.home ([206.248.178.151]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id JFJ94910 for ; Sun, 02 Mar 2008 21:58:10 -0500 Received: by pastel.home (Postfix, from userid 20848) id C15B58279; Sun, 2 Mar 2008 21:58:10 -0500 (EST) Resent-Message-ID: Resent-To: submit@debbugs.gnu.org Resent-From: Stefan Monnier Resent-Date: Sun, 02 Mar 2008 21:58:10 -0500 X-Original-To: monnier@iro.umontreal.ca Delivered-To: monnier@iro.umontreal.ca Received: from perlin.iro.umontreal.ca (perlin.iro.umontreal.ca [132.204.24.51]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id A287E2CF80F for ; Fri, 29 Feb 2008 02:09:18 -0500 (EST) Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by perlin.iro.umontreal.ca (Postfix) with ESMTP id 560C814821A for ; Fri, 29 Feb 2008 02:09:11 -0500 (EST) Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUzMl-0005uo-1H for monnier@iro.umontreal.ca; Fri, 29 Feb 2008 02:09:11 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUzMb-0005qf-1K for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:09:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUzMZ-0005oZ-Cq for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:09:00 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUzMZ-0005oS-9P for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:08:59 -0500 Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JUzMY-0001Rt-Ni for bug-gnu-emacs@gnu.org; Fri, 29 Feb 2008 02:08:59 -0500 Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m1T78uYf002411 for ; Fri, 29 Feb 2008 01:08:56 -0600 Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1T3e4hH020582 for ; Fri, 29 Feb 2008 00:08:55 -0700 Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3594982491204268930; Thu, 28 Feb 2008 23:08:50 -0800 Received: from dradamslap1 (/141.144.80.6) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 Feb 2008 23:08:49 -0800 From: "Drew Adams" To: Date: Thu, 28 Feb 2008 23:08:52 -0800 Message-ID: <001f01c87aa1$f176d7c0$0600a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ach6ofC6NouTXYTUShSR7cc+EIR2Mw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 Subject: incorrect code in dired-insert-directory X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org Errors-To: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-1.94, requis 5, BAYES_00 -2.60, RECEIVED_FROM_NOUNK 0.66, SPF_HELO_PASS -0.00) X-DIRO-MailScanner-From: bug-gnu-emacs-bounces+monnier=iro.umontreal.ca@gnu.org This line near the end of dired-insert-directory is wrong: (if (and (or hdr wildcard) (not (looking-at "^ /.*:$"))) The problem is that "^ /.*:$" does not recognize a directory name on MS Windows. The purpose of this code is to see if the directory name is already in the buffer - if not, then it adds it. The test always fails on Windows, so, whenever (or hdr wildcard) is non-nil, the `if' test succeeds. That inserts a second copy of the directory name in the buffer in some situations. The regexp works only for Unix and GNU/Linux, not for Windows, which has directories that have drive letters: c:/foobar/. To reproduce (on Windows): emacs -Q Load the source file files.el. C-u C-x 4 d Use switches -lR, and enter some directory name. The first directory name in the buffer appears twice (the others are OK). Note: The problem does not seem to arise if you don't load the source file, for some reason. This problem also exists in 22.1.90. And it exists as far back as Emacs 20. In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --cflags -Ic:/gnuwin32/include' ------------=_1213125603-31605-1--