[Top][All Lists]

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

[PATCH] ls-lisp.el ls-lisp-insert-directory fix empty dir bug

From: Ingo Lohmar
Subject: [PATCH] ls-lisp.el ls-lisp-insert-directory fix empty dir bug
Date: Sat, 27 Apr 2013 12:31:56 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hi all,

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.


--- /usr/share/emacs/24.3.50/lisp/ls-lisp.el.gz
+++ #<buffer ls-lisp.el.gz>
@@ -404,6 +404,7 @@
                ;; the wildcard; let's say something similar.
                (insert "(No match)\n"))
            (insert (format "total %.0f\n" (fceiling (/ sum 1024.0))))))
+          (unless files (goto-char (point-max)))
        (if (memq ?R switches)
            ;; List the contents of all directories recursively.
            ;; cadr of each element of `file-alist' is t for

reply via email to

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