;;;###tramp-autoload
(defun tramp-enable-nc-method ()
- "Enable \"ksu\" method."
+ "Enable \"nc\" method."
(add-to-list 'tramp-methods
`("nc"
(tramp-login-program "telnet")
"Enable optional METHOD if possible."
(interactive
(list
- (completing-read
- "method: "
- (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))))))
-
+ (let ((methods nil))
+ (mapatoms (lambda (sym)
+ (when-let ((fboundp sym)
+ (name (symbol-name sym))
+ ;; It must match `tramp-enable-METHOD-method'.
+ ((string-match
+ (rx "tramp-enable-"
+ (group (regexp tramp-method-regexp))
+ "-method")
+ name))
+ (method (match-string 1 name)))
+ (push method methods))))
+ (completing-read "Enable Tramp method: " methods
+ (lambda (method)
+ (not (assoc method tramp-methods)))))))
(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)))
+(put 'tramp-enable-method 'minibuffer-action "enable")
+
;; Conversion functions between external representation and
;; internal data structure. Convenience functions for internal
;; data structure.