Mercurial > emacs
changeset 28488:d68718635663
(insert-directory): List the total free space
along with the used space.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 03 Apr 2000 19:26:43 +0000 |
parents | 653e53467c66 |
children | 3fe2e55e31da |
files | lisp/files.el |
diffstat | 1 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/files.el Mon Apr 03 19:25:08 2000 +0000 +++ b/lisp/files.el Mon Apr 03 19:26:43 2000 +0000 @@ -3351,8 +3351,26 @@ (if (/= result 0) ;; We get here if ls failed. ;; Access the file to get a suitable error. - (access-file file "Reading directory"))))))) - + (access-file file "Reading directory") + ;; Replace "total" with "used", to avoid confusion. + ;; Add in the amount of free space. + (save-excursion + (goto-char (point-min)) + (when (re-search-forward "^total" nil t) + (replace-match "used") + (end-of-line) + (let (available) + (with-temp-buffer + (call-process "df" nil t nil ".") + (goto-char (point-min)) + (forward-line 1) + (skip-chars-forward "^ \t") + (forward-word 3) + (let ((end (point))) + (forward-word -1) + (setq available (buffer-substring (point) end)))) + (insert " available " available)))))))))) + (defvar kill-emacs-query-functions nil "Functions to call with no arguments to query about killing Emacs. If any of these functions returns nil, killing Emacs is cancelled.