Mercurial > emacs
comparison lisp/dired.el @ 34346:fe91911bd583
(dired-insert-directory): If file-system-info is
fboundp, call it instead of invoking dired-free-space-program.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Thu, 07 Dec 2000 14:51:33 +0000 |
parents | c6633a26b63a |
children | 25adec4e4b87 |
comparison
equal
deleted
inserted
replaced
34345:39f2e2837fac | 34346:fe91911bd583 |
---|---|
684 (when (and full-p dired-free-space-program) | 684 (when (and full-p dired-free-space-program) |
685 (save-excursion | 685 (save-excursion |
686 (goto-char (point-min)) | 686 (goto-char (point-min)) |
687 (when (re-search-forward "total [0-9]+$" nil t) | 687 (when (re-search-forward "total [0-9]+$" nil t) |
688 (insert " free ") | 688 (insert " free ") |
689 (let ((beg (point))) | 689 ;; Non-Posix systems don't always have dired-free-space-program, |
690 (condition-case nil | 690 ;; but might have an equivalent system call. |
691 (if (zerop (call-process dired-free-space-program nil t nil | 691 (if (fboundp 'file-system-info) |
692 dired-free-space-args | 692 (insert |
693 (expand-file-name dir-or-list))) | 693 (format "%.0f" |
694 (progn | 694 (/ (nth 2 (file-system-info dir-or-list)) 1024))) |
695 (goto-char beg) | 695 (let ((beg (point))) |
696 (forward-line 1) | 696 (condition-case nil |
697 (skip-chars-forward "^ \t") | 697 (if (zerop (call-process dired-free-space-program nil t nil |
698 (forward-word 2) | 698 dired-free-space-args |
699 (skip-chars-forward " \t") | 699 (expand-file-name dir-or-list))) |
700 (delete-region beg (point)) | 700 (progn |
701 (forward-word 1) | 701 (goto-char beg) |
702 (delete-region (point) | 702 (forward-line 1) |
703 (progn (forward-line 1) (point)))) | 703 (skip-chars-forward "^ \t") |
704 ;; The dired-free-space-program failed; delete its output | 704 (forward-word 2) |
705 (delete-region (- beg 7) (point))) | 705 (skip-chars-forward " \t") |
706 (error (delete-region (- beg 7) (point))))))))) | 706 (delete-region beg (point)) |
707 (forward-word 1) | |
708 (delete-region (point) | |
709 (progn (forward-line 1) (point)))) | |
710 ;; The dired-free-space-program failed; delete its output | |
711 (delete-region (- beg 7) (point))) | |
712 (error (delete-region (- beg 7) (point)))))))))) | |
707 ;; Quote certain characters, unless ls quoted them for us. | 713 ;; Quote certain characters, unless ls quoted them for us. |
708 (if (not (string-match "b" dired-actual-switches)) | 714 (if (not (string-match "b" dired-actual-switches)) |
709 (save-excursion | 715 (save-excursion |
710 (setq end (point-marker)) | 716 (setq end (point-marker)) |
711 (goto-char opoint) | 717 (goto-char opoint) |