Commit fc3e23a4 authored by Eli Zaretskii's avatar Eli Zaretskii

(dired-insert-directory): If file-system-info is

fboundp, call it instead of invoking dired-free-space-program.
parent 0f5f7c3e
2000-12-07 Eli Zaretskii <eliz@is.elta.co.il>
* dired.el (dired-insert-directory): If file-system-info is
fboundp, call it instead of invoking dired-free-space-program.
2000-12-07 Gerd Moellmann <gerd@gnu.org>
* server.el (server-visit-files): Push files on file-name-history.
......
......@@ -686,24 +686,30 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
(goto-char (point-min))
(when (re-search-forward "total [0-9]+$" nil t)
(insert " free ")
(let ((beg (point)))
(condition-case nil
(if (zerop (call-process dired-free-space-program nil t nil
dired-free-space-args
(expand-file-name dir-or-list)))
(progn
(goto-char beg)
(forward-line 1)
(skip-chars-forward "^ \t")
(forward-word 2)
(skip-chars-forward " \t")
(delete-region beg (point))
(forward-word 1)
(delete-region (point)
(progn (forward-line 1) (point))))
;; The dired-free-space-program failed; delete its output
(delete-region (- beg 7) (point)))
(error (delete-region (- beg 7) (point)))))))))
;; Non-Posix systems don't always have dired-free-space-program,
;; but might have an equivalent system call.
(if (fboundp 'file-system-info)
(insert
(format "%.0f"
(/ (nth 2 (file-system-info dir-or-list)) 1024)))
(let ((beg (point)))
(condition-case nil
(if (zerop (call-process dired-free-space-program nil t nil
dired-free-space-args
(expand-file-name dir-or-list)))
(progn
(goto-char beg)
(forward-line 1)
(skip-chars-forward "^ \t")
(forward-word 2)
(skip-chars-forward " \t")
(delete-region beg (point))
(forward-word 1)
(delete-region (point)
(progn (forward-line 1) (point))))
;; The dired-free-space-program failed; delete its output
(delete-region (- beg 7) (point)))
(error (delete-region (- beg 7) (point))))))))))
;; Quote certain characters, unless ls quoted them for us.
(if (not (string-match "b" dired-actual-switches))
(save-excursion
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment