GNU bug report logs - #13191
24.3.50; insert-directory: Always replace "total" with "total used in directory"

Previous Next

Package: emacs;

Reported by: Christopher Schmidt <christopher <at> ch.ristopher.com>

Date: Sat, 15 Dec 2012 11:37:01 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 24.3.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; insert-directory: Always replace "total" with "total used in
	directory"
Date: Sat, 15 Dec 2012 11:34:37 +0000 (GMT)
[Message part 1 (text/plain, inline)]
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.
[files-insert-directory.diff (text/x-diff, inline)]
--- lisp/ChangeLog
+++ lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-15  Christopher Schmidt  <christopher <at> 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 <at> 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))))))))))
 
[Message part 3 (text/plain, inline)]
If this patch is applied, tramp (tramp-sh-handle-insert-directory)
should be modified to do the same.

        Christopher

This bug report was last modified 5 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.