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

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 23 Oct 2009 18:25:06 UTC

Severity: minor

To reply to this bug, email your comments to 4792 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4792; Package emacs. (Fri, 23 Oct 2009 18:25:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 23 Oct 2009 18:25:07 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 23.1; dired-insert-directory: doesn't indent header lines if no files
Date: Fri, 23 Oct 2009 11:19:49 -0700
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)'
 





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4792; Package emacs. (Sat, 24 Oct 2009 19:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 24 Oct 2009 19:00:05 GMT) Full text and rfc822 format available.

Message #10 received at 4792 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
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
> 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.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4792; Package emacs. (Sat, 24 Oct 2009 19:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 24 Oct 2009 19:15:05 GMT) Full text and rfc822 format available.

Message #15 received at 4792 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Chong Yidong'" <cyd <at> stupidchicken.com>
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 12:07:19 -0700
> > 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.




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4792; Package emacs. (Sat, 24 Oct 2009 19:20:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 24 Oct 2009 19:20:04 GMT) Full text and rfc822 format available.

Message #20 received at 4792 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Drew Adams <drew.adams <at> oracle.com>, 4792 <at> debbugs.gnu.org
Subject: Re: bug#4792: 23.1; dired-insert-directory: doesn't indent header 
	lines if no files
Date: Sat, 24 Oct 2009 21:10:55 +0200
On Sat, Oct 24, 2009 at 20:51, Chong Yidong <cyd <at> stupidchicken.com> wrote:

> 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"

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



bug reassigned from package 'emacs' to 'emacs,w32'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 27 Jan 2010 22:45:02 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 139 days ago.

Previous Next


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