# HG changeset patch # User Andreas Schwab # Date 1039353642 0 # Node ID df29cc9d803b19ae65dacc22fc38c4978d99a85b # Parent d23316dc877af401370f0c2a914d8192923cf0c5 (insert-directory): Insert free space only when listing a full directory. diff -r d23316dc877a -r df29cc9d803b lisp/files.el --- a/lisp/files.el Sun Dec 08 13:18:02 2002 +0000 +++ b/lisp/files.el Sun Dec 08 13:20:42 2002 +0000 @@ -4104,17 +4104,18 @@ (beginning-of-line) (delete-region (point) (progn (forward-line 2) (point))))) - ;; Try to insert the amount of free space. - (save-excursion - (goto-char beg) - ;; First find the line to put it on. - (when (re-search-forward "^ *\\(total\\)" nil t) - (let ((available (get-free-disk-space "."))) - (when available - ;; Replace "total" with "used", to avoid confusion. - (replace-match "total used in directory" nil nil nil 1) - (end-of-line) - (insert " available " available)))))))))) + (if full-directory-p + ;; Try to insert the amount of free space. + (save-excursion + (goto-char beg) + ;; First find the line to put it on. + (when (re-search-forward "^ *\\(total\\)" nil t) + (let ((available (get-free-disk-space "."))) + (when available + ;; Replace "total" with "used", to avoid confusion. + (replace-match "total used in directory" nil nil nil 1) + (end-of-line) + (insert " available " available))))))))))) (defun insert-directory-safely (file switches &optional wildcard full-directory-p)