From: Michael Albinus Date: Thu, 24 Mar 2022 11:50:34 +0000 (+0100) Subject: Adapt Tramp to dired--insert-disk-space assumptions X-Git-Tag: emacs-29.0.90~1931^2~936 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=34c7f14668b8445e0a9bb0de2639481fc3bf6918;p=emacs.git Adapt Tramp to dired--insert-disk-space assumptions * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Do not modify disk space information when `dired--insert-disk-space' is available. (Bug#54512) --- diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 7a2b884bad3..fd18b3f05c6 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2715,7 +2715,9 @@ The method used must be an out-of-band method." ;; 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 (and (re-search-forward "^\\([[:space:]]*total\\)" nil t) + ;; Emacs 29.1 or later. + (not (fboundp 'dired--insert-disk-space))) (when-let ((available (get-free-disk-space "."))) ;; Replace "total" with "total used", to avoid confusion. (replace-match "\\1 used in directory") diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 67c63e6ce7a..bbc5499ae72 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1129,7 +1129,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." ;; Insert size information. (when full-directory-p (insert - (if avail + (if (and avail + ;; Emacs 29.1 or later. + (not (fboundp 'dired--insert-disk-space))) (format "total used in directory %s available %s\n" used avail) (format "total %s\n" used))))