]> git.eshelyaron.com Git - emacs.git/commitdiff
(insert-directory): Insert free space only when listing a full directory.
authorAndreas Schwab <schwab@suse.de>
Sun, 8 Dec 2002 13:20:42 +0000 (13:20 +0000)
committerAndreas Schwab <schwab@suse.de>
Sun, 8 Dec 2002 13:20:42 +0000 (13:20 +0000)
lisp/files.el

index b6bee3b09d44dc816e21b1111a3698877ff50cc1..eb4895781c90956c653e06d9e0bd110aa4d131e0 100644 (file)
@@ -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)