aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2000-03-29 20:02:10 +0000
committerAndreas Schwab2000-03-29 20:02:10 +0000
commit8b0b6a7f28fcd8a253ed090791c395c3e7fd0446 (patch)
treeb6ffe65cd3774768cf7fc9074b9512d9d19da1cd
parent3d3df9e1212ed7f7c1396cc13001953ad5537b58 (diff)
downloademacs-8b0b6a7f28fcd8a253ed090791c395c3e7fd0446.tar.gz
emacs-8b0b6a7f28fcd8a253ed090791c395c3e7fd0446.zip
(dired-insert-directory): If dired-free-space-program
failed just delete its output.
-rw-r--r--lisp/dired.el27
1 files changed, 15 insertions, 12 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index e5f704689c6..e9426d40288 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -681,18 +681,21 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
681 (when (re-search-forward "total [0-9]+$" nil t) 681 (when (re-search-forward "total [0-9]+$" nil t)
682 (insert " free ") 682 (insert " free ")
683 (let ((beg (point))) 683 (let ((beg (point)))
684 (call-process dired-free-space-program nil t nil 684 (if (zerop (call-process dired-free-space-program nil t nil
685 dired-free-space-args 685 dired-free-space-args
686 (expand-file-name dir-or-list)) 686 (expand-file-name dir-or-list)))
687 (goto-char beg) 687 (progn
688 (forward-line 1) 688 (goto-char beg)
689 (skip-chars-forward "^ \t") 689 (forward-line 1)
690 (forward-word 2) 690 (skip-chars-forward "^ \t")
691 (skip-chars-forward " \t") 691 (forward-word 2)
692 (delete-region beg (point)) 692 (skip-chars-forward " \t")
693 (forward-word 1) 693 (delete-region beg (point))
694 (delete-region (point) 694 (forward-word 1)
695 (progn (forward-line 1) (point)))))))) 695 (delete-region (point)
696 (progn (forward-line 1) (point))))
697 ;; The dired-free-space-program failed; delete its output
698 (delete-region (- beg 7) (point))))))))
696 ;; Quote certain characters, unless ls quoted them for us. 699 ;; Quote certain characters, unless ls quoted them for us.
697 (if (not (string-match "b" dired-actual-switches)) 700 (if (not (string-match "b" dired-actual-switches))
698 (save-excursion 701 (save-excursion