[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4792: 23.1; dired-insert-directory: doesn't indent header lines if n

From: Drew Adams
Subject: bug#4792: 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:
  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
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)'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]