From: Andreas Schwab Date: Sun, 8 Dec 2002 13:20:42 +0000 (+0000) Subject: (insert-directory): Insert free space only when listing a full directory. X-Git-Tag: ttn-vms-21-2-B4~12091 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75bb5ca4dc5e3740ba1b387d3f4913c21b0421bc;p=emacs.git (insert-directory): Insert free space only when listing a full directory. --- diff --git a/lisp/files.el b/lisp/files.el index b6bee3b09d4..eb4895781c9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4104,17 +4104,18 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (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)