* bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files
@ 2009-10-23 18:19 Drew Adams
0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2009-10-23 18:19 UTC (permalink / raw)
To: bug-gnu-emacs
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)'
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files
@ 2009-10-24 18:51 Chong Yidong
2009-10-24 19:07 ` Drew Adams
2009-10-24 19:10 ` Juanma Barranquero
0 siblings, 2 replies; 4+ messages in thread
From: Chong Yidong @ 2009-10-24 18:51 UTC (permalink / raw)
To: Drew Adams; +Cc: 4792
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files
2009-10-24 18:51 bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files Chong Yidong
@ 2009-10-24 19:07 ` Drew Adams
2009-10-24 19:10 ` Juanma Barranquero
1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2009-10-24 19:07 UTC (permalink / raw)
To: 'Chong Yidong'; +Cc: 4792
> > 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files
2009-10-24 18:51 bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files Chong Yidong
2009-10-24 19:07 ` Drew Adams
@ 2009-10-24 19:10 ` Juanma Barranquero
1 sibling, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2009-10-24 19:10 UTC (permalink / raw)
To: Chong Yidong; +Cc: 4792
On Sat, Oct 24, 2009 at 20:51, Chong Yidong <cyd@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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-24 19:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-24 18:51 bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if no files Chong Yidong
2009-10-24 19:07 ` Drew Adams
2009-10-24 19:10 ` Juanma Barranquero
-- strict thread matches above, loose matches on Subject: below --
2009-10-23 18:19 Drew Adams
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.