diff options
| author | Gerd Moellmann | 2000-04-03 19:26:43 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-03 19:26:43 +0000 |
| commit | 18f183760f2a3ae71c42d8fe95ad4d96d4c0dafb (patch) | |
| tree | edbe609e8dcd7f40aa7ac8d6c7a0e6887657e95f | |
| parent | 36c5e6177bd9c89108136e0a12e1ab61028c1ee5 (diff) | |
| download | emacs-18f183760f2a3ae71c42d8fe95ad4d96d4c0dafb.tar.gz emacs-18f183760f2a3ae71c42d8fe95ad4d96d4c0dafb.zip | |
(insert-directory): List the total free space
along with the used space.
| -rw-r--r-- | lisp/files.el | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 8873fadb2fc..9de7c0ba8ea 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3351,8 +3351,26 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." | |||
| 3351 | (if (/= result 0) | 3351 | (if (/= result 0) |
| 3352 | ;; We get here if ls failed. | 3352 | ;; We get here if ls failed. |
| 3353 | ;; Access the file to get a suitable error. | 3353 | ;; Access the file to get a suitable error. |
| 3354 | (access-file file "Reading directory"))))))) | 3354 | (access-file file "Reading directory") |
| 3355 | 3355 | ;; Replace "total" with "used", to avoid confusion. | |
| 3356 | ;; Add in the amount of free space. | ||
| 3357 | (save-excursion | ||
| 3358 | (goto-char (point-min)) | ||
| 3359 | (when (re-search-forward "^total" nil t) | ||
| 3360 | (replace-match "used") | ||
| 3361 | (end-of-line) | ||
| 3362 | (let (available) | ||
| 3363 | (with-temp-buffer | ||
| 3364 | (call-process "df" nil t nil ".") | ||
| 3365 | (goto-char (point-min)) | ||
| 3366 | (forward-line 1) | ||
| 3367 | (skip-chars-forward "^ \t") | ||
| 3368 | (forward-word 3) | ||
| 3369 | (let ((end (point))) | ||
| 3370 | (forward-word -1) | ||
| 3371 | (setq available (buffer-substring (point) end)))) | ||
| 3372 | (insert " available " available)))))))))) | ||
| 3373 | |||
| 3356 | (defvar kill-emacs-query-functions nil | 3374 | (defvar kill-emacs-query-functions nil |
| 3357 | "Functions to call with no arguments to query about killing Emacs. | 3375 | "Functions to call with no arguments to query about killing Emacs. |
| 3358 | If any of these functions returns nil, killing Emacs is cancelled. | 3376 | If any of these functions returns nil, killing Emacs is cancelled. |