[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 7609924 1/2: Adapt directory summary line handling in Tramp
From: |
Michael Albinus |
Subject: |
master 7609924 1/2: Adapt directory summary line handling in Tramp |
Date: |
Fri, 3 Dec 2021 08:25:03 -0500 (EST) |
branch: master
commit 76099240119d0137f25b356d64e2c1b70201973e
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Adapt directory summary line handling in Tramp
* 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 | 20 +++++++++++---------
lisp/net/tramp-smb.el | 14 ++++++++------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index b83569f..780c3b3 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -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)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 2411953..0a7d1ef 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 7609924 1/2: Adapt directory summary line handling in Tramp,
Michael Albinus <=