all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "Bruno Félix Rezende Ribeiro" <oitofelix@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: tramp-auto-auth.el --- TRAMP automatic authentication library
Date: Sun, 01 Sep 2019 11:59:16 +0200	[thread overview]
Message-ID: <87blw4ibgr.fsf@gmx.de> (raw)
In-Reply-To: <87zhjogbgo.fsf@oitofelix.com> ("Bruno Félix Rezende Ribeiro"'s message of "Sat, 31 Aug 2019 20:29:59 -0300")

Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> 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	other threads:[~2019-09-01  9:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23  2:08 tramp-auto-auth.el --- TRAMP automatic authentication library Bruno Félix Rezende Ribeiro
2019-08-27 10:12 ` Michael Albinus
2019-08-28 23:50   ` Bruno Félix Rezende Ribeiro
2019-08-29 11:04     ` Michael Albinus
2019-08-31 23:29       ` Bruno Félix Rezende Ribeiro
2019-09-01  9:59         ` Michael Albinus [this message]
2019-09-01 12:53       ` Stefan Monnier
2019-09-01 15:35         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blw4ibgr.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=oitofelix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.