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: incorrect code in dired-insert-directory Date: Thu, 28 Feb 2008 23:08:52 -0800 Message-ID: <001f01c87aa1$f176d7c0$0600a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204268957 9941 80.91.229.12 (29 Feb 2008 07:09:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Feb 2008 07:09:17 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 29 08:09:42 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUzND-00062U-PB for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Feb 2008 08:09:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUzMh-0005uo-7R for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Feb 2008 02:09:07 -0500 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17618 Archived-At: 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'