Function: tramp-default-rename-file

tramp-default-rename-file is a byte-compiled function defined in tramp-cmds.el.gz.

Signature

(tramp-default-rename-file STRING)

Documentation

Determine default file name for renaming according to STRING.

The user option tramp-default-rename-alist is consulted, finding the default mapping. If there is no matching entry, the function returns nil

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cmds.el.gz
(defun tramp-default-rename-file (string)
  "Determine default file name for renaming according to STRING.
The user option `tramp-default-rename-alist' is consulted,
finding the default mapping.  If there is no matching entry, the
function returns nil"
  (when (tramp-tramp-file-p string)
    (let ((tdra tramp-default-rename-alist)
	  (method (or (file-remote-p string 'method) ""))
	  (user (or (file-remote-p string 'user) ""))
	  (host (or (file-remote-p string 'host) ""))
	  item result)
      (while (setq item (pop tdra))
	(when (string-match-p (or (eval (car item) t) "") string)
	  (setq tdra nil
		result
		(tramp-format-spec
		 (cdr item) (format-spec-make ?m method ?u user ?h host)))))
      result)))