bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13191: 24.3.50; insert-directory: Always replace "total" with "total


From: Christopher Schmidt
Subject: bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory"
Date: Sat, 15 Dec 2012 11:34:37 +0000 (GMT)

severity: wishlist

In insert-directory there are these forms:

    (goto-char beg)
    ;; First find the line to put it on.
    (when (re-search-forward "^ *\\(total\\)" nil t)
      (let ((available (get-free-disk-space ".")))
        (when available
          ;; Replace "total" with "used", to avoid confusion.
          (replace-match "total used in directory" nil nil nil 1)
          (end-of-line)
          (insert " available " available))))))

I think "total" should always be replaced by "total used in directory"
even if Emacs is not able to get the free disk space.  This increases
consistency and avoids confusion by other packages which rely on
consistent output, such as dired-details,

Here is a patch.
--- lisp/ChangeLog
+++ lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-15  Christopher Schmidt  <christopher@ch.ristopher.com>
+
+       * files.el (insert-directory): Always replace "total" with "total
+       used in directory" to avoid confusion.  (Bug#)
+
 2012-12-14  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/macroexp.el (macroexp--warn-and-return):
--- lisp/files.el
+++ lisp/files.el
@@ -6299,10 +6299,11 @@
                (goto-char beg)
                ;; First find the line to put it on.
                (when (re-search-forward "^ *\\(total\\)" nil t)
+                 ;; Replace "total" with "total used in directory" to
+                 ;; avoid confusion.
+                 (replace-match "total used in directory" nil nil nil 1)
                  (let ((available (get-free-disk-space ".")))
                    (when available
-                     ;; Replace "total" with "used", to avoid confusion.
-                     (replace-match "total used in directory" nil nil nil 1)
                      (end-of-line)
                      (insert " available " available))))))))))
 
If this patch is applied, tramp (tramp-sh-handle-insert-directory)
should be modified to do the same.

        Christopher

reply via email to

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