]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt directory summary line handling in Tramp
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 3 Dec 2021 13:24:43 +0000 (14:24 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 3 Dec 2021 13:24:43 +0000 (14:24 +0100)
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Do not add or modify summary line when `dired-free-space' is bound.

lisp/net/tramp-sh.el
lisp/net/tramp-smb.el

index b83569f3dedbab5f3719891cd484056b4b03a962..780c3b39413602142b88ed610e5a374ae5a27458 100644 (file)
@@ -2678,15 +2678,17 @@ The method used must be an out-of-band method."
             (point-min) 'noerror)
            (replace-match (file-relative-name filename) t))
 
-         ;; Try to insert the amount of free space.
-         (goto-char (point-min))
-         ;; First find the line to put it on.
-         (when (re-search-forward "^\\([[:space:]]*total\\)" nil t)
-           (when-let ((available (get-free-disk-space ".")))
-             ;; Replace "total" with "total used", to avoid confusion.
-             (replace-match "\\1 used in directory")
-             (end-of-line)
-             (insert " available " available))))
+         ;; Try to insert the amount of free space.  This is moved to
+         ;; `dired-insert-directory' in Emacs 29.1.
+         (unless (boundp 'dired-free-space)
+           (goto-char (point-min))
+           ;; First find the line to put it on.
+           (when (re-search-forward "^\\([[:space:]]*total\\)" nil t)
+             (when-let ((available (get-free-disk-space ".")))
+               ;; Replace "total" with "total used", to avoid confusion.
+               (replace-match "\\1 used in directory")
+               (end-of-line)
+               (insert " available " available)))))
 
        (prog1 (goto-char end-marker)
          (set-marker beg-marker nil)
index 24119539db0bd88ebd39aac2c10856e408926c5b..0a7d1efc8b850ed563080adc7acfdce22bf9088e 100644 (file)
@@ -1120,12 +1120,14 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
                   (setcar x (concat (car x) "*"))))))
             entries))
 
-         ;; Insert size information.
-         (when full-directory-p
-           (insert
-            (if avail
-                (format "total used in directory %s available %s\n" used avail)
-              (format "total %s\n" used))))
+         ;; Insert size information.  This is moved to
+         ;; `dired-insert-directory' in Emacs 29.1.
+         (unless (boundp 'dired-free-space)
+           (when full-directory-p
+             (insert
+              (if avail
+                  (format "total used in directory %s available %s\n" used avail)
+                (format "total %s\n" used)))))
 
          ;; Print entries.
          (mapc