all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory"
@ 2012-12-15 11:34 Christopher Schmidt
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Christopher Schmidt @ 2012-12-15 11:34 UTC (permalink / raw)
  To: 13191

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used indirectory"
  2012-12-15 11:34 bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory" Christopher Schmidt
@ 2012-12-15 15:56 ` Drew Adams
  2019-11-23 14:46 ` bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory" Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2012-12-15 15:56 UTC (permalink / raw)
  To: 'Christopher Schmidt', 13191

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

FWIW, in Dired+ I use this:

  files 1559/1559 space used 63122 available 24468736






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory"
  2012-12-15 11:34 bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory" Christopher Schmidt
  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 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-23 14:46 UTC (permalink / raw)
  To: 13191

Christopher Schmidt <christopher@ch.ristopher.com> writes:

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

Makes sense to me.  I've now installed this in Emacs 27.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-23 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-15 11:34 bug#13191: 24.3.50; insert-directory: Always replace "total" with "total used in directory" Christopher Schmidt
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

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.