GNU bug report logs - #4792
23.1; dired-insert-directory: doesn't indent header lines if no files

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Drew Adams" <drew.adams@HIDDEN>; dated Fri, 23 Oct 2009 18:25:06 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug reassigned from package 'emacs' to 'emacs,w32'. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 4792@HIDDEN:


Received: (at 4792) by emacsbugs.donarmstrong.com; 24 Oct 2009 19:11:22 +0000
From lekktu@HIDDEN Sat Oct 24 12:11:22 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,HAS_BUG_NUMBER
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com [209.85.219.213])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9OJBKEl027267
	for <4792@HIDDEN>; Sat, 24 Oct 2009 12:11:22 -0700
Received: by ewy9 with SMTP id 9so2717366ewy.1
        for <4792@HIDDEN>; Sat, 24 Oct 2009 12:11:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:in-reply-to:references
         :from:date:message-id:subject:to:cc:content-type
         :content-transfer-encoding;
        bh=0nvQZ2+l/ZSBzf+D1A1XjiZPjFNwqQ731roTvwRL0GQ=;
        b=NXesVsUeIkEYDWdRQJUTs66cZbQyqwOli5lbZvU1XAoMMwCa9qcBfnACSh3weBSJWT
         +LBMSARuyICuKWW2oDMfG83ng1yeD9fj8gaDgcJfcOE0YWTposcFuH4JPjhDjy4gfXIl
         Z/qbF9Ag9b5SqgAPDaMJ5e5AJwf95xULprPbs=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc:content-type:content-transfer-encoding;
        b=r7N7WGoFdCNIOS00n3TKybhVxFMwv9tcH94WovqIDckfD57LcHl8grdqpOyfl0fwhg
         WHY7w9Lt23TFKxtx/ii6R7BFhtkFobAOxl1qCJl7DTS893Ptzv+zLiDYHbkklGVh8N7P
         F/bBSXngGHqLsFJnUKQBwIRUrJdi8Wqv73JrY=
MIME-Version: 1.0
Received: by 10.211.147.10 with SMTP id z10mr247163ebn.28.1256411475096; Sat, 
	24 Oct 2009 12:11:15 -0700 (PDT)
In-Reply-To: <87zl7geib9.fsf@HIDDEN>
References: <87zl7geib9.fsf@HIDDEN>
From: Juanma Barranquero <lekktu@HIDDEN>
Date: Sat, 24 Oct 2009 21:10:55 +0200
Message-ID: <f7ccd24b0910241210n6156eb88s6f6abed7d59a1905@HIDDEN>
Subject: Re: bug#4792: 23.1; dired-insert-directory: doesn't indent header 
	lines if no files
To: Chong Yidong <cyd@HIDDEN>
Cc: Drew Adams <drew.adams@HIDDEN>, 4792 <at> debbugs.gnu.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 24, 2009 at 20:51, Chong Yidong <cyd@HIDDEN> wrote:

> I can't reproduce this. =C2=A0C-x d some-directory-that-does-not-exist gi=
ves
> an error
>
> =C2=A0"Reading directory: no such file or directory, some-directory"

Perhaps it is a Windows thing. I can reproduce it.

C:\> emacs -Q

C-x d doesnotexist <RET>

  c:/:
  wildcard doesnotexist
(No match)
total used in directory 0 available 43706472


    Juanma



Acknowledgement sent to Juanma Barranquero <lekktu@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4792; Package emacs. Full text available.

Message received at 4792@HIDDEN:


Received: (at 4792) by emacsbugs.donarmstrong.com; 24 Oct 2009 19:07:17 +0000
From drew.adams@HIDDEN Sat Oct 24 12:07:16 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-1.7 required=4.0 tests=AWL,IMPRONONCABLE_1,
	MURPHY_WRONG_WORD1,MURPHY_WRONG_WORD2 autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from rgminet11.oracle.com (rcsinet11.oracle.com [148.87.113.123])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9OJ7FeO026581
	for <4792@HIDDEN>; Sat, 24 Oct 2009 12:07:16 -0700
Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227])
	by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9OJ8ac8027272
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sat, 24 Oct 2009 19:08:37 GMT
Received: from acsmt355.oracle.com (acsmt355.oracle.com [141.146.40.155])
	by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9OICaiG024144;
	Sat, 24 Oct 2009 19:08:21 GMT
Received: from abhmt015.oracle.com by acsmt358.oracle.com
	with ESMTP id 20600848741256411212; Sat, 24 Oct 2009 14:06:52 -0500
Received: from dradamslap1 (/24.5.184.158)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Sat, 24 Oct 2009 12:06:52 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: "'Chong Yidong'" <cyd@HIDDEN>
Cc: <4792 <at> debbugs.gnu.org>
References: <87zl7geib9.fsf@HIDDEN>
Subject: RE: 23.1; dired-insert-directory: doesn't indent header lines if no files
Date: Sat, 24 Oct 2009 12:07:19 -0700
Message-ID: <C752015B80B34CC4ABFFBE5B4A0A03E9@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <87zl7geib9.fsf@HIDDEN>
Thread-Index: AcpU2xiNuBw2lXckSSyumyLl576n3AAAPsWQ
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-Source-IP: acsmt355.oracle.com [141.146.40.155]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090202.4AE3505A.00F4:SCFMA4539814,ss=1,fgs=0

> > emacs -q
> > C-x d some-directory-that-does-not-exist
> 
> > The listing looks like this:
> >   c:/Emacs-23.1/lisp:
> >   wildcard some-directory-that-does-not-exist
> > (No match)
> > total used in directory 0 available 26402560
> 
> I can't reproduce this.  C-x d 
> some-directory-that-does-not-exist gives an error
> 
>   "Reading directory: no such file or directory, some-directory"
> 
> This is both with and without ls-lisp loaded.

Hey, what can I say? Did you actually try it on MS Windows?
This is 100% reproducible for me, using emacs -Q in 23.1.

And I don't think it _should_ be raising an error. You should be able to use any
wildcard expression (and that's what this is, in fact), and a Dired buffer
should be opened showing you the matches - even if there are none.

IOW, using `some-directory-that-does-not-exist' is no different from using
`*.jjjjjjjjj'. If there are no matches for the pattern, then you should get a
listing like what I wrote above - except the header info should be indented
properly.




Acknowledgement sent to "Drew Adams" <drew.adams@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4792; Package emacs. Full text available.

Message received at 4792@HIDDEN:


Received: (at 4792) by emacsbugs.donarmstrong.com; 24 Oct 2009 18:52:02 +0000
From cyd@HIDDEN Sat Oct 24 11:52:01 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-0.4 required=4.0 tests=AWL autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from pantheon-po42.its.yale.edu (pantheon-po42.its.yale.edu [130.132.50.101])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9OIq0Pa023910
	for <4792@HIDDEN>; Sat, 24 Oct 2009 11:52:01 -0700
Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244])
	(authenticated bits=0)
	by pantheon-po42.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n9OIpsjv003700
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sat, 24 Oct 2009 14:51:55 -0400
Received: by furry (Postfix, from userid 1000)
	id F22E3C070; Sat, 24 Oct 2009 14:51:54 -0400 (EDT)
From: Chong Yidong <cyd@HIDDEN>
To: "Drew Adams" <drew.adams@HIDDEN>
Cc: 4792 <at> debbugs.gnu.org
Subject: Re: 23.1; dired-insert-directory: doesn't indent header lines if no files
Date: Sat, 24 Oct 2009 14:51:54 -0400
Message-ID: <87zl7geib9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed)

> emacs -q
> C-x d some-directory-that-does-not-exist

> The listing looks like this:
>   c:/Emacs-23.1/lisp:
>   wildcard some-directory-that-does-not-exist
> (No match)
> total used in directory 0 available 26402560

I can't reproduce this.  C-x d some-directory-that-does-not-exist gives
an error

  "Reading directory: no such file or directory, some-directory"

This is both with and without ls-lisp loaded.



Acknowledgement sent to Chong Yidong <cyd@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4792; Package emacs. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 23 Oct 2009 18:20:06 +0000
From drew.adams@HIDDEN Fri Oct 23 11:20:05 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.3 required=4.0 tests=AWL,FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9NIK4NH006260
	for <submit@HIDDEN>; Fri, 23 Oct 2009 11:20:05 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1N1Ok7-0004LM-UW
	for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2009 14:20:03 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1N1Ok3-0004H1-8I
	for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2009 14:20:03 -0400
Received: from [199.232.76.173] (port=38034 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1N1Ok3-0004Gt-5I
	for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2009 14:19:59 -0400
Received: from rcsinet11.oracle.com ([148.87.113.123]:50732 helo=rgminet11.oracle.com)
	by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60)
	(envelope-from <drew.adams@HIDDEN>)
	id 1N1Ok2-0002nN-Qq
	for bug-gnu-emacs@HIDDEN; Fri, 23 Oct 2009 14:19:59 -0400
Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125])
	by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9NILM8o021419
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-gnu-emacs@HIDDEN>; Fri, 23 Oct 2009 18:21:23 GMT
Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153])
	by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9NGug8V015283
	for <bug-gnu-emacs@HIDDEN>; Fri, 23 Oct 2009 18:20:32 GMT
Received: from abhmt004.oracle.com by acsmt358.oracle.com
	with ESMTP id 20594296681256321987; Fri, 23 Oct 2009 13:19:47 -0500
Received: from dradamslap1 (/141.144.80.25)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Fri, 23 Oct 2009 11:19:47 -0700
From: "Drew Adams" <drew.adams@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: 23.1; dired-insert-directory: doesn't indent header lines if no files
Date: Fri, 23 Oct 2009 11:19:49 -0700
Message-ID: <EB256AEA70384A5391791CA52A801E00@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
Thread-Index: AcpUDWhpWsD/vxF8RHmm/1sazLzZbg==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-Source-IP: acsmt353.oracle.com [141.146.40.153]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090205.4AE1F3CA.00AF:SCFMA4539814,ss=1,fgs=0
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1)

emacs -q
C-x d some-directory-that-does-not-exist
 
The listing looks like this:
 
  c:/Emacs-23.1/lisp:
  wildcard some-directory-that-does-not-exist
(No match)
total used in directory 0 available 26402560
 
The last two lines should be indented, but they are not.
 
They need to be indented, in particular, so that any (custom)
font-lock highlighting that might be done can act appropriately. They
should also be indented for consistency with the display of a
non-empty listing.
 
This regression was introduced in Emacs 22 - the lines are indented
correctly in Emacs 20 and 21.
 
The cause is this change in `dired-insert-directory':
(indent-rigidly opoint (point) 2)
 
Originally, that was (indent-rigidly (point-min) (point-max) 2),
though the indentation was done elsewhere at that time.
 
The problem is that when there are no files in the listing, point does
not get moved, so opoint is 1, and so is (point) - so nothing is
indented.
 
Either `point-min' and `point-max' should be used, as before (unless
that causes some other problem), or the code should check whether any
file lines were actually inserted and DTRT. Or perhaps the
`save-excursion' could be removed around the code that inserts this
header info, so that (point) would be at (point-max). (opoint = 1 is
not the problem.)
 
Note: I'm on Windows, so the code uses ls-lisp.el. E.g. it uses the
version of `insert-directory' provided by ls-lisp.el. Dunno if that
makes a difference.
 

In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'
 





Acknowledgement sent to "Drew Adams" <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4792; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.