tramp-devel
[Top][All Lists]
Advanced

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

Re: hang forever with an invalid tramp filename


From: Michael Albinus
Subject: Re: hang forever with an invalid tramp filename
Date: Mon, 07 Nov 2011 21:05:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> 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

Good idea. I will check, which functions coujld be merged; likely more
than only tramp-parse-shosts and tramp-parse-sconfig.

Best regards, Michael.



reply via email to

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