changeset 48745:df29cc9d803b

(insert-directory): Insert free space only when listing a full directory.
author Andreas Schwab <schwab@suse.de>
date Sun, 08 Dec 2002 13:20:42 +0000
parents d23316dc877a
children 6c8c25a778ce
files lisp/files.el
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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)