summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-12-01 23:27:09 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-12-01 23:27:19 +0100
commit1914d946d62de4ab7bab1434bcea09087d61bb5a (patch)
tree2c535caf9dc3d7094f4548b5b482e01bcb8fb33b /lisp/ls-lisp.el
parented7591c9055d4c90d2f59ffbd90aff45da2dc102 (diff)
downloademacs-1914d946d62de4ab7bab1434bcea09087d61bb5a.tar.gz
emacs-1914d946d62de4ab7bab1434bcea09087d61bb5a.tar.bz2
emacs-1914d946d62de4ab7bab1434bcea09087d61bb5a.zip
Change how Dired displays available space
* doc/emacs/dired.texi (Misc Dired Features): Document it (bug#23812). * lisp/dired.el (dired-free-space): New user option. (dired-insert-directory): Use it from here. (dired--insert-disk-space): New function that uses the user option. * lisp/files.el (insert-directory): Don't transform "total" here. * lisp/ls-lisp.el (ls-lisp--insert-directory): Or here. Instead just leave the "total <num>" bit alone, and let Dired transform it. * test/lisp/files-tests.el (files-tests): Move "available" tests to dired-tests. * test/lisp/dired-tests.el (data-dir): Moved here.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r--lisp/ls-lisp.el13
1 files changed, 1 insertions, 12 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index eea8089daa7..25d196392ab 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -337,18 +337,7 @@ are also supported; unsupported long options are silently ignored."
(ls-lisp-insert-directory
file switches (ls-lisp-time-index switches)
nil full-directory-p))
- (signal (car err) (cdr err)))))
- ;; Try to insert the amount of free space.
- (save-excursion
- (goto-char (point-min))
- ;; First find the line to put it on.
- (when (re-search-forward "^total" nil t)
- (let ((available (get-free-disk-space orig-file)))
- (when available
- ;; Replace "total" with "total used", to avoid confusion.
- (replace-match "total used in directory")
- (end-of-line)
- (insert " available " available)))))))))
+ (signal (car err) (cdr err)))))))))
(advice-add 'insert-directory :around #'ls-lisp--insert-directory)
(defun ls-lisp-insert-directory