[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ls-lisp.el ls-lisp-insert-directory fix empty dir bug
From: |
Ingo Lohmar |
Subject: |
Re: [PATCH] ls-lisp.el ls-lisp-insert-directory fix empty dir bug |
Date: |
Sat, 27 Apr 2013 15:56:27 +0200 |
User-agent: |
Notmuch/0.14+282~g9a15fa1 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-pc-linux-gnu) |
On Sat, Apr 27 2013 14:58 (+0200), Eli Zaretskii wrote:
>> From: Ingo Lohmar <address@hidden>
>> Date: Sat, 27 Apr 2013 12:31:56 +0000 (UTC)
>>
>> I noticed a bug with ls-lisp's insert-directory when the list of files is
>> empty. Since point is at the beginning of the buffer before inserting the
>> total-line, save-excursion does not work like it does when there are files
>> (ie, buffer content) already: point afterwards is still before the text,
>> and dired-insert-directory does not correctly indent the content then.
>>
>> Below is a one-line patch (so no FSF assignment necessary, which is still
>> on my TODOs...) to correct this whenever the list of files was empty. I
>> do not use the repository but a recent snapshot, apologies for any necessary
>> reformatting. HTH.
>
> Thanks.
>
> Can you show a simple recipe for reproducing the problem?
Hi Eli,
Glad you asked, I now noticed that the problem only occurs when removing
the dot entries via dired-listing-switches (so when the local files
variable is really nil before populating the buffer):
(require 'ls-lisp)
(setq ls-lisp-use-insert-directory-program nil)
;; only occurs if we do not have "." and ".."
(setq dired-listing-switches "-l -h")
;; now create some empty dir, and do
(dired "my-empty-dir")
;; notice that last two lines are not indented, get wrong text
;; properties due to that...
Regards,
Ingo