aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-09-25 16:16:35 -0400
committerChong Yidong2010-09-25 16:16:35 -0400
commit41f54b738882c1f98c152c7788c2c2456993531b (patch)
treec6e0f64cba0e2dab4e7a3bfb755d9e584ee493b0
parentd24ec09aee53c057d4ff30d84b44aa044d4f6805 (diff)
downloademacs-41f54b738882c1f98c152c7788c2c2456993531b.tar.gz
emacs-41f54b738882c1f98c152c7788c2c2456993531b.zip
* files.el (get-free-disk-space): Don't assume "df" output columns line up (Bug#6995).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el25
2 files changed, 15 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c220f46509d..8adb6b03de6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12010-09-25 Chong Yidong <cyd@stupidchicken.com>
2
3 * files.el (get-free-disk-space): Don't assume the "df" output
4 columns line up (Bug#6995).
5
12010-09-25 Juanma Barranquero <lekktu@gmail.com> 62010-09-25 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * finder.el (finder-unknown-keywords): 8 * finder.el (finder-unknown-keywords):
diff --git a/lisp/files.el b/lisp/files.el
index 24190a51529..40627f690f8 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5622,22 +5622,17 @@ returns nil."
5622 directory-free-space-args 5622 directory-free-space-args
5623 dir) 5623 dir)
5624 0))) 5624 0)))
5625 ;; Usual format is as follows: 5625 ;; Assume that the "available" column is before the
5626 ;; Filesystem ... Used Available Capacity ... 5626 ;; "capacity" column. Find the "%" and scan backward.
5627 ;; /dev/sda6 ...48106535 35481255 10669850 ...
5628 (goto-char (point-min)) 5627 (goto-char (point-min))
5629 (when (re-search-forward " +Avail[^ \n]*" 5628 (forward-line 1)
5630 (line-end-position) t) 5629 (when (re-search-forward
5631 (let ((beg (match-beginning 0)) 5630 "[[:space:]]+[^[:space:]]+%[^%]*$"
5632 (end (match-end 0)) 5631 (line-end-position) t)
5633 str) 5632 (goto-char (match-beginning 0))
5634 (forward-line 1) 5633 (let ((endpt (point)))
5635 (setq str 5634 (skip-chars-backward "^[:space:]")
5636 (buffer-substring-no-properties 5635 (buffer-substring-no-properties (point) endpt)))))))))
5637 (+ beg (point) (- (point-min)))
5638 (+ end (point) (- (point-min)))))
5639 (when (string-match "\\` *\\([^ ]+\\)" str)
5640 (match-string 1 str))))))))))
5641 5636
5642;; The following expression replaces `dired-move-to-filename-regexp'. 5637;; The following expression replaces `dired-move-to-filename-regexp'.
5643(defvar directory-listing-before-filename-regexp 5638(defvar directory-listing-before-filename-regexp