aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-08-16 00:31:28 +0000
committerChong Yidong2009-08-16 00:31:28 +0000
commite1bdde781814f254e61ed54478bcef087009429b (patch)
treec3451d35dd6ece417feb0a69ee9a3b74842e38c4
parent4b1ed1bb560a63bd5e136f2023ab3987a516af42 (diff)
downloademacs-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/ChangeLog6
-rw-r--r--lisp/files.el16
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 @@
12009-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
12009-08-15 Chong Yidong <cyd@stupidchicken.com> 72009-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
5387This function calls `file-system-info' if it is available, or invokes the 5387This function calls `file-system-info' if it is available, or invokes the
5388program specified by `directory-free-space-program' if that is non-nil." 5388program 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