emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 60e9b00 2/2: Extend completion candidates in tramp.


From: Michael Albinus
Subject: [Emacs-diffs] master 60e9b00 2/2: Extend completion candidates in tramp.el
Date: Mon, 9 May 2016 07:20:53 +0000 (UTC)

branch: master
commit 60e9b006b514f1337f7ff2a41518f0ed72510d5f
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Extend completion candidates in tramp.el
    
    * lisp/net/tramp.el (tramp-parse-default-user-host): New defun.
    (tramp-get-completion-function): Use it.
---
 lisp/net/tramp.el |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b179815..118da57 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1712,9 +1712,11 @@ Example:
 (defun tramp-get-completion-function (method)
   "Returns a list of completion functions for METHOD.
 For definition of that list see `tramp-set-completion-function'."
-  (cons
-   ;; Hosts visited once shall be remembered.
-   `(tramp-parse-connection-properties ,method)
+  (append
+   `(;; Default settings are taken into account.
+     (tramp-parse-default-user-host ,method)
+     ;; Hosts visited once shall be remembered.
+     (tramp-parse-connection-properties ,method))
    ;; The method related defaults.
    (cdr (assoc method tramp-completion-function-alist))))
 
@@ -2549,6 +2551,12 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match 
HOST."
   (unless (zerop (+ (length user) (length host)))
     (tramp-completion-make-tramp-file-name method user host nil)))
 
+(defun tramp-parse-default-user-host (method)
+  "Return a list of (user host) tuples allowed to access for METHOD.
+This function is added always in `tramp-get-completion-function'
+for all methods.  Resulting data are derived from default settings."
+  `((,(tramp-find-user method nil nil) ,(tramp-find-host method nil nil))))
+
 ;; Generic function.
 (defun tramp-parse-group (regexp match-level skip-regexp)
    "Return a (user host) tuple allowed to access.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]