diff options
| author | Chong Yidong | 2009-08-16 00:31:28 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-08-16 00:31:28 +0000 |
| commit | e1bdde781814f254e61ed54478bcef087009429b (patch) | |
| tree | c3451d35dd6ece417feb0a69ee9a3b74842e38c4 | |
| parent | 4b1ed1bb560a63bd5e136f2023ab3987a516af42 (diff) | |
| download | emacs-e1bdde781814f254e61ed54478bcef087009429b.tar.gz emacs-e1bdde781814f254e61ed54478bcef087009429b.zip | |
* files.el (get-free-disk-space): Change fallback default
directory to /. Expand DIR argument before switching to fallback.
Suggested by Kevin Ryde (Bug#2631, Bug#3911).
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/files.el | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c339b6d4b1..6961e82c6d2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-08-16 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * files.el (get-free-disk-space): Change fallback default | ||
| 4 | directory to /. Expand DIR argument before switching to fallback. | ||
| 5 | Suggested by Kevin Ryde (Bug#2631, Bug#3911). | ||
| 6 | |||
| 1 | 2009-08-15 Chong Yidong <cyd@stupidchicken.com> | 7 | 2009-08-15 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 8 | ||
| 3 | * files.el (load-library): Doc fix. | 9 | * files.el (load-library): Doc fix. |
diff --git a/lisp/files.el b/lisp/files.el index 966036a15e4..6f8ff69caef 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -5386,7 +5386,7 @@ fail. It returns also nil when DIR is a remote directory. | |||
| 5386 | 5386 | ||
| 5387 | This function calls `file-system-info' if it is available, or invokes the | 5387 | This function calls `file-system-info' if it is available, or invokes the |
| 5388 | program specified by `directory-free-space-program' if that is non-nil." | 5388 | program specified by `directory-free-space-program' if that is non-nil." |
| 5389 | (when (not (file-remote-p dir)) | 5389 | (unless (file-remote-p dir) |
| 5390 | ;; Try to find the number of free blocks. Non-Posix systems don't | 5390 | ;; Try to find the number of free blocks. Non-Posix systems don't |
| 5391 | ;; always have df, but might have an equivalent system call. | 5391 | ;; always have df, but might have an equivalent system call. |
| 5392 | (if (fboundp 'file-system-info) | 5392 | (if (fboundp 'file-system-info) |
| @@ -5396,12 +5396,14 @@ program specified by `directory-free-space-program' if that is non-nil." | |||
| 5396 | (save-match-data | 5396 | (save-match-data |
| 5397 | (with-temp-buffer | 5397 | (with-temp-buffer |
| 5398 | (when (and directory-free-space-program | 5398 | (when (and directory-free-space-program |
| 5399 | (let ((default-directory | 5399 | ;; Avoid failure if the default directory does |
| 5400 | (if (and (not (file-remote-p default-directory)) | 5400 | ;; not exist (Bug#2631, Bug#3911). |
| 5401 | (file-directory-p default-directory) | 5401 | (let ((default-directory default-directory)) |
| 5402 | (file-readable-p default-directory)) | 5402 | (setq dir (expand-file-name dir)) |
| 5403 | default-directory | 5403 | (unless (and (not (file-remote-p default-directory)) |
| 5404 | (expand-file-name "~/")))) | 5404 | (file-directory-p default-directory) |
| 5405 | (file-readable-p default-directory)) | ||
| 5406 | (setq default-directory "/")) | ||
| 5405 | (eq (call-process directory-free-space-program | 5407 | (eq (call-process directory-free-space-program |
| 5406 | nil t nil | 5408 | nil t nil |
| 5407 | directory-free-space-args | 5409 | directory-free-space-args |