[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 34c7f14668: Adapt Tramp to dired--insert-disk-space assumptions
From: |
Michael Albinus |
Subject: |
master 34c7f14668: Adapt Tramp to dired--insert-disk-space assumptions |
Date: |
Thu, 24 Mar 2022 07:50:48 -0400 (EDT) |
branch: master
commit 34c7f14668b8445e0a9bb0de2639481fc3bf6918
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
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)
---
lisp/net/tramp-sh.el | 4 +++-
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 7a2b884bad..fd18b3f05c 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 67c63e6ce7..bbc5499ae7 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))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 34c7f14668: Adapt Tramp to dired--insert-disk-space assumptions,
Michael Albinus <=