If possible, it would be nice to show the second line of a dired buffer created
by tramp,
similarly as it is shown in local dired buffers: that is, instead of
total 1234
showing
total used in directory 1234 available 987654321
Emacs : GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.28)
of 2015-11-28
Package: tramp (2.2.13-pre)
--- tramp-sh.el_orig 2015-12-01 14:18:36.710106914 +0900
+++ tramp-sh.el 2015-12-01 14:23:26.099302534 +0900
@@ -2898,7 +2898,19 @@
beg 'noerror)
(replace-match (file-relative-name filename) t))
- (goto-char (point-max)))))))
+ (goto-char (point-max))
+ (if full-directory-p
+ ;; Try to insert the amount of free space.
+ (save-excursion
+ (goto-char beg)
+ ;; First find the line to put it on.
+ (when (re-search-forward "^ *\\(total\\)" nil t)
+ (let ((available (get-free-disk-space ".")))
+ (when available
+ ;; Replace "total" with "used", to avoid confusion.
+ (replace-match "total used in directory" nil nil nil 1)
+ (end-of-line)
+ (insert " available " available)))))))))))
;; Canonicalization of file names.
_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel