unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <bug-gnu-emacs@gnu.org>
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	[thread overview]
Message-ID: <EB256AEA70384A5391791CA52A801E00@us.oracle.com> (raw)

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)'
 







             reply	other threads:[~2009-10-23 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 18:19 Drew Adams [this message]
  -- strict thread matches above, loose matches on Subject: below --
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EB256AEA70384A5391791CA52A801E00@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=4792@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).