Function: with-tramp-file-name-with-method

with-tramp-file-name-with-method is a macro defined in tramp-cmds.el.gz.

Signature

(with-tramp-file-name-with-method &rest BODY)

Documentation

Ask user for tramp-file-name-with-method if needed.

Run BODY.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-cmds.el.gz
(defmacro with-tramp-file-name-with-method (&rest body)
  "Ask user for `tramp-file-name-with-method' if needed.
Run BODY."
  (declare (indent 0) (debug t))
  `(let ((tramp-file-name-with-method
          (if current-prefix-arg
	      (completing-read
	       "Tramp method: "
	       ;; Filter out enabled methods.
	       (seq-intersection
		(mapcar #'car tramp-methods)
		(mapcar
		 #'cadr (cdr (get 'tramp-file-name-with-method 'custom-type))))
               nil t (tramp-get-file-name-with-method))
            (tramp-get-file-name-with-method))))
     ,@body))