Function: tramp-enable-method
tramp-enable-method is an autoloaded, interactive and byte-compiled
function defined in tramp-cmds.el.gz.
Signature
(tramp-enable-method METHOD)
Documentation
Enable optional METHOD if possible.
Probably introduced at or before Emacs version 30.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/net/tramp-cmds.el.gz
;;;###tramp-autoload
(defun tramp-enable-method (method)
"Enable optional METHOD if possible."
(interactive
(list
(completing-read
"method: "
(tramp-compat-seq-keep
(lambda (x)
(when-let* ((name (symbol-name x))
;; It must match `tramp-enable-METHOD-method'.
((string-match
(rx "tramp-enable-"
(group (regexp tramp-method-regexp))
"-method")
name))
(method (match-string 1 name))
;; It must not be enabled yet.
((not (assoc method tramp-methods))))
method))
;; All method enabling functions.
(mapcar
#'intern (all-completions "tramp-enable-" obarray #'functionp))))))
(when-let* (((not (assoc method tramp-methods)))
(fn (intern (format "tramp-enable-%s-method" method)))
((functionp fn)))
(funcall fn)
(message "Tramp method \"%s\" enabled" method)))