Function: tramp-gvfs-handle-expand-file-name

tramp-gvfs-handle-expand-file-name is a byte-compiled function defined in tramp-gvfs.el.gz.

Signature

(tramp-gvfs-handle-expand-file-name NAME &optional DIR)

Documentation

Like expand-file-name for Tramp files.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-gvfs.el.gz
(defun tramp-gvfs-handle-expand-file-name (name &optional dir)
  "Like `expand-file-name' for Tramp files."
  (tramp-skeleton-expand-file-name name dir
    ;; If there is a default location, expand tilde.
    (when (string-match
	   (rx bos "~" (group (* (not "/"))) (group (* nonl)) eos) localname)
      (let ((uname (match-string 1 localname))
	    (fname (match-string 2 localname))
	    hname)
	(when (tramp-string-empty-or-nil-p uname)
	  (setq uname user))
	(when (setq hname (tramp-get-home-directory v uname))
	  (setq localname (concat hname fname)))))))