aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2001-12-21 15:22:06 +0000
committerEli Zaretskii2001-12-21 15:22:06 +0000
commit7f1b5edca1545d4d3331e6abc3a76d091f84a301 (patch)
tree854b22136e76286882b3350f1c2b641af3db47d9
parent01b26b907083382000c3d0b9dd30f75d48e2e16b (diff)
downloademacs-7f1b5edca1545d4d3331e6abc3a76d091f84a301.tar.gz
emacs-7f1b5edca1545d4d3331e6abc3a76d091f84a301.zip
(insert-directory): Insert the amount of free disk
space, like files.el's insert-directory does.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/ls-lisp.el13
2 files changed, 24 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7fd55a56901..ec18c63df3c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12001-12-21 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * ls-lisp.el (insert-directory): Insert the amount of free disk
4 space, like files.el's insert-directory does.
5
6 * files.el (directory-free-space-program): Mention
7 file-system-info in the doc string.
8 (get-free-disk-space): New function; code moved from
9 insert-directory.
10 (insert-directory): Call get-free-disk-space to get the amount of
11 free space.
12
12001-12-21 Richard M. Stallman <rms@gnu.org> 132001-12-21 Richard M. Stallman <rms@gnu.org>
2 14
3 * emacs-lisp/easy-mmode.el (define-minor-mode): 15 * emacs-lisp/easy-mmode.el (define-minor-mode):
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 9f2eb5be2a3..53057dab07f 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -200,7 +200,18 @@ that work are: A a c i r S s t u U X g G B C R and F partly."
200 (if (memq ?B switches) (setq wildcard "[^~]\\'"))) 200 (if (memq ?B switches) (setq wildcard "[^~]\\'")))
201 (ls-lisp-insert-directory 201 (ls-lisp-insert-directory
202 file switches (ls-lisp-time-index switches) 202 file switches (ls-lisp-time-index switches)
203 wildcard full-directory-p))))) 203 wildcard full-directory-p)
204 ;; Try to insert the amount of free space.
205 (save-excursion
206 (goto-char (point-min))
207 ;; First find the line to put it on.
208 (when (re-search-forward "^total" nil t)
209 (let ((available (get-free-disk-space ".")))
210 (when available
211 ;; Replace "total" with "used", to avoid confusion.
212 (replace-match "used")
213 (end-of-line)
214 (insert " available " available)))))))))
204 215
205(defun ls-lisp-insert-directory 216(defun ls-lisp-insert-directory
206 (file switches time-index wildcard full-directory-p) 217 (file switches time-index wildcard full-directory-p)