diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2022-03-24 12:50:34 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2022-03-24 12:50:34 +0100 |
commit | 34c7f14668b8445e0a9bb0de2639481fc3bf6918 (patch) | |
tree | 2139164dc4f405fba5e5eeb5243755a80a159be7 /lisp/net | |
parent | b97aa560ab225bb37cc00c385711825199687fdb (diff) | |
download | emacs-34c7f14668b8445e0a9bb0de2639481fc3bf6918.tar.gz emacs-34c7f14668b8445e0a9bb0de2639481fc3bf6918.tar.bz2 emacs-34c7f14668b8445e0a9bb0de2639481fc3bf6918.zip |
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)
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/tramp-sh.el | 4 | ||||
-rw-r--r-- | lisp/net/tramp-smb.el | 4 |
2 files changed, 6 insertions, 2 deletions
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)))) |