(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."
(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)
;; 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
(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