Function: tramp-expand-args
tramp-expand-args is a byte-compiled function defined in tramp.el.gz.
Signature
(tramp-expand-args VEC PARAMETER DEFAULT &rest SPEC-LIST)
Documentation
Expand login arguments as given by PARAMETER in tramp-methods.
PARAMETER is a symbol like tramp-login-args, denoting a list of
list of strings from tramp-methods, containing %-sequences for
substitution. DEFAULT is used when PARAMETER is not specified.
SPEC-LIST is a list of char/value pairs used for
format-spec-make. It is appended by tramp-extra-expand-args,
a connection-local variable.
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp.el.gz
(defun tramp-expand-args (vec parameter default &rest spec-list)
"Expand login arguments as given by PARAMETER in `tramp-methods'.
PARAMETER is a symbol like `tramp-login-args', denoting a list of
list of strings from `tramp-methods', containing %-sequences for
substitution. DEFAULT is used when PARAMETER is not specified.
SPEC-LIST is a list of char/value pairs used for
`format-spec-make'. It is appended by `tramp-extra-expand-args',
a connection-local variable."
(let ((args (tramp-get-method-parameter vec parameter default))
(extra-spec-list
(mapcar
#'eval
(buffer-local-value
'tramp-extra-expand-args (tramp-get-connection-buffer vec))))
spec)
;; Merge both spec lists. Remove duplicate entries.
(while spec-list
(unless (member (car spec-list) extra-spec-list)
(setq extra-spec-list
(append (tramp-compat-take 2 spec-list) extra-spec-list)))
(setq spec-list (cddr spec-list)))
(setq spec (apply #'format-spec-make extra-spec-list))
;; Expand format spec.
(flatten-tree
(mapcar
(lambda (x)
(setq x (mapcar (lambda (y) (tramp-format-spec y spec)) x))
(unless (member "" x) x))
args))))