all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Schmidt <christopher@ch.ristopher.com>
To: 13191@debbugs.gnu.org
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)	[thread overview]
Message-ID: <878v8z7dm4@ch.ristopher.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: files-insert-directory.diff --]
[-- Type: text/x-diff, Size: 929 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 124 bytes --]


If this patch is applied, tramp (tramp-sh-handle-insert-directory)
should be modified to do the same.

        Christopher

             reply	other threads:[~2012-12-15 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15 11:34 Christopher Schmidt [this message]
2012-12-15 15:56 ` bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used indirectory" Drew Adams
2019-11-23 14:46 ` bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory" Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=878v8z7dm4@ch.ristopher.com \
    --to=christopher@ch.ristopher.com \
    --cc=13191@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.