[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 7384a32: Further changes on directory summary line in Tramp
From: |
Michael Albinus |
Subject: |
master 7384a32: Further changes on directory summary line in Tramp |
Date: |
Sat, 4 Dec 2021 12:43:53 -0500 (EST) |
branch: master
commit 7384a329d2582e28e28eb8f8e568f7688dceea38
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Further changes on directory summary line in Tramp
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-system-info):
Do not assume 0 in case of missing information.
* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory):
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Revert previous change, it doesn't fly.
---
lisp/net/tramp-gvfs.el | 10 +++++-----
lisp/net/tramp-sh.el | 23 ++++++++++++-----------
lisp/net/tramp-smb.el | 14 ++++++--------
3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index ab71c9c..22e3142 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1521,11 +1521,11 @@ If FILE-SYSTEM is non-nil, return file system
attributes."
(size (cdr (assoc "filesystem::size" attr)))
(used (cdr (assoc "filesystem::used" attr)))
(free (cdr (assoc "filesystem::free" attr))))
- (when (or size used free)
- (list (string-to-number (or size "0"))
- (string-to-number (or free "0"))
- (- (string-to-number (or size "0"))
- (string-to-number (or used "0"))))))))
+ (when (or size free)
+ (list (and size (string-to-number size))
+ (and free (string-to-number free))
+ (and size used
+ (- (string-to-number size) (string-to-number used))))))))
(defun tramp-gvfs-handle-make-directory (dir &optional parents)
"Like `make-directory' for Tramp files."
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 780c3b3..8d10659 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2678,17 +2678,15 @@ 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. 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)))))
+ ;; 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))))
(prog1 (goto-char end-marker)
(set-marker beg-marker nil)
@@ -6024,5 +6022,8 @@ function cell is returned to be applied on a buffer."
;; be to stipulate, as a directory or connection-local variable, an
;; additional rc file on the remote machine that is sourced every
;; time Tramp connects. <https://emacs.stackexchange.com/questions/62306>
+;;
+;; * Support hostname canonicalization in ~/.ssh/config.
+;; <https://stackoverflow.com/questions/70205232/>
;;; tramp-sh.el ends here
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 0a7d1ef..2411953 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1120,14 +1120,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are
completely ignored."
(setcar x (concat (car x) "*"))))))
entries))
- ;; 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)))))
+ ;; 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))))
;; Print entries.
(mapc
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 7384a32: Further changes on directory summary line in Tramp,
Michael Albinus <=