--- 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.