[Top][All Lists]

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

Re: tramp-auto-auth.el --- TRAMP automatic authentication library

From: Michael Albinus
Subject: Re: tramp-auto-auth.el --- TRAMP automatic authentication library
Date: Sun, 01 Sep 2019 11:59:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Bruno Félix Rezende Ribeiro <address@hidden> writes:

> Hello Michael,

Hi Bruno,

> However, it’s not clear to me
> if the code I already wrote would be used as an interim solution.

Is this needed? Tramp is available as ELPA package, and as soon as you
provide patches, it will be there (after next sync).

> I think it’s most likely you are just giving me general advice as if
> it were to be included, but I’m not entirely sure; because (maybe)
> this code could be included in GNU ELPA.  Could you please clarify
> this matter?

My proposal is to improve vanilla Tramp.

>>> ;; In case you are feeling lazy or the secret is not so secret (nor so
>>> ;; sacred) -- or for any reason you need to do it all from Lisp --
>>> ;; it’s enough to:
>>> ;;
>>> ;; (auth-source-remember '(:host "Funny-Machines" :user "root" :port "ssh")
>>> ;;                   '((:secret "$r00tP#sWD!")))
>> I wouldn't write this into a Tramp doc. Refer to the "auth" Info pages.
> My intention with this was to document the way I found for another
> private library to setup an auth-source entry automatically without
> fiddling with user’s Netrc files.
> I couldn’t find any reference to this function in auth-source’s manual.
> Perhaps a section about this technique is needed there before we can
> refer to it?

Yes, auth.texi is the place to update. Patches welcome.

>>>   :require 'tramp-auto-auth)
>> Why is this needed?
> Quoting from the documentation on ‘:global’ in ‘(elisp) Defining Minor
> Modes’:
>   One of the effects of making a minor mode global is that the MODE
>   variable becomes a customization variable.  Toggling it through the
>   Customize interface turns the mode on and off, and its value can be
>   saved for future Emacs sessions.  For the saved variable to work, you
>   should ensure that the ‘define-minor-mode’ form is evaluated each time
>   Emacs starts; for packages that are not part of Emacs, the easiest way
>   to do this is to specify a ‘:require’ keyword.
> Since ‘tramp-auto-auth’ is not part of Emacs, I thought that was needed.

When we have added your code to Tramp, it will also be part of
Emacs. Well, using it via ELPA for older Emacsen might still require
this technique. So maybe you keep it (changing to :require 'tramp).

>>> ;;;###autoload
>> Please use ";;;###tramp-autoload". The user option makes only sense
>> after Tramp has been loaded.
> Where is this ‘;;;###<package>-autoload’ cookie feature documented?  I
> couldn’t find it.

Read the documentation of `generate-autoload-cookie' and
`generated-autoload-file' in (info "(elisp) Autoload")

>>>     (advice-add #'tramp-action-password :around
>> Code, which is part of core Emacs, shall not advice other
>> functions. Advicing is intended for user-written Lisp.
> I couldn’t find any other way to obtain the same effect.  Do you have
> any suggestion?

Change `tramp-read-passwd' accordingly.

> Best regards,

Best regards, Michael.

reply via email to

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