aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-05-09 09:20:34 +0200
committerMichael Albinus2016-05-09 09:20:34 +0200
commit60e9b006b514f1337f7ff2a41518f0ed72510d5f (patch)
tree2e032f7bff3d0ccdba92f97044c6063bdbdac37c
parent001d59c60465d30abec6575a767c6daa16f2f8db (diff)
downloademacs-60e9b006b514f1337f7ff2a41518f0ed72510d5f.tar.gz
emacs-60e9b006b514f1337f7ff2a41518f0ed72510d5f.zip
Extend completion candidates in tramp.el
* lisp/net/tramp.el (tramp-parse-default-user-host): New defun. (tramp-get-completion-function): Use it.
-rw-r--r--lisp/net/tramp.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b179815af32..118da578858 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1712,9 +1712,11 @@ Example:
1712(defun tramp-get-completion-function (method) 1712(defun tramp-get-completion-function (method)
1713 "Returns a list of completion functions for METHOD. 1713 "Returns a list of completion functions for METHOD.
1714For definition of that list see `tramp-set-completion-function'." 1714For definition of that list see `tramp-set-completion-function'."
1715 (cons 1715 (append
1716 ;; Hosts visited once shall be remembered. 1716 `(;; Default settings are taken into account.
1717 `(tramp-parse-connection-properties ,method) 1717 (tramp-parse-default-user-host ,method)
1718 ;; Hosts visited once shall be remembered.
1719 (tramp-parse-connection-properties ,method))
1718 ;; The method related defaults. 1720 ;; The method related defaults.
1719 (cdr (assoc method tramp-completion-function-alist)))) 1721 (cdr (assoc method tramp-completion-function-alist))))
1720 1722
@@ -2549,6 +2551,12 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
2549 (unless (zerop (+ (length user) (length host))) 2551 (unless (zerop (+ (length user) (length host)))
2550 (tramp-completion-make-tramp-file-name method user host nil))) 2552 (tramp-completion-make-tramp-file-name method user host nil)))
2551 2553
2554(defun tramp-parse-default-user-host (method)
2555 "Return a list of (user host) tuples allowed to access for METHOD.
2556This function is added always in `tramp-get-completion-function'
2557for all methods. Resulting data are derived from default settings."
2558 `((,(tramp-find-user method nil nil) ,(tramp-find-host method nil nil))))
2559
2552;; Generic function. 2560;; Generic function.
2553(defun tramp-parse-group (regexp match-level skip-regexp) 2561(defun tramp-parse-group (regexp match-level skip-regexp)
2554 "Return a (user host) tuple allowed to access. 2562 "Return a (user host) tuple allowed to access.