Thierry Volpiatto <[email protected]> writes:
> Hi Michael,
> I encountered some issues with tramp while writing `anything' completion
> for hostnames:
>
> - tramp hang if i do (find-file "/ssh:toto")
> (notice the last ":" is missing)
> where toto is a valid hostname.
> I think this should return an error and exiting instead of trying to
> connect.
> This is reproductible in emacs -Q with C-x C-f => /ssh:toto RET
>
> - `tramp-parse-connection-properties' should return a list of (user
> host) as described in docstring, however it return sometimes a list of
> (user method), so i have to parse this to remove such entries.
> (not a big deal though, but well..)
Also, to avoid repetition, what about somthing like that:
#+BEGIN_SRC lisp
(defun tramp-parse-sfile (filename function)
"Return a list of (user host) tuples allowed to access.
User is always nil."
;; On Windows, there are problems in completion when
;; `default-directory' is remote.
(let ((default-directory (tramp-compat-temporary-file-directory))
res)
(when (file-readable-p filename)
(with-temp-buffer
(insert-file-contents filename)
(goto-char (point-min))
(while (not (eobp))
(push (funcall function) res))))
res))
(defun tramp-parse-shosts (filename)
"Return a list of (user host) tuples allowed to access.
User is always nil."
(tramp-parse-sfile filename 'tramp-parse-shosts-group))
(defun tramp-parse-sconfig (filename)
"Return a list of (user host) tuples allowed to access.
User is always nil."
(tramp-parse-sfile filename 'tramp-parse-sconfig-group))
#+END_SRC
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel