From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: tramp-auto-auth.el --- TRAMP automatic authentication library Date: Sun, 01 Sep 2019 11:59:16 +0200 Message-ID: <87blw4ibgr.fsf@gmx.de> References: <877e74skek.fsf@oitofelix.com> <87woeyudc0.fsf@gmx.de> <87o9086ea0.fsf@oitofelix.com> <87ftlkp70j.fsf@gmx.de> <87zhjogbgo.fsf@oitofelix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="5038"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 01 12:00:00 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i4MeN-00018C-RM for ged-emacs-devel@m.gmane.org; Sun, 01 Sep 2019 11:59:59 +0200 Original-Received: from localhost ([::1]:56268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4MeM-00074A-Je for ged-emacs-devel@m.gmane.org; Sun, 01 Sep 2019 05:59:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37195) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4Mdq-00071t-Is for emacs-devel@gnu.org; Sun, 01 Sep 2019 05:59:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4Mdp-0003um-8Q for emacs-devel@gnu.org; Sun, 01 Sep 2019 05:59:26 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:49623) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4Mdo-0003qX-Sk; Sun, 01 Sep 2019 05:59:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567331957; bh=/jJYPLihWWdqKhRKGf9NC/PCht3qCmLKD70ghpb9RZ0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=NojvXPlE+7QZSn9uZtJgolQ5NgvL9QOwmhPeCAq4rSBmHl3PfceMEnQevpd371aGM TqQYs1m0Dn/MAXlBxdS2aGHx0cYx3apfwVaG+AYbKBhXlGpqS9u+cE5OUgLXJO9IHF N4NT7GXmDa6Dhskkt2sYB/wT7h7qXpJWYMFR3csA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.91.242.113]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LnCkb-1igRD613RF-00hRhw; Sun, 01 Sep 2019 11:59:17 +0200 In-Reply-To: <87zhjogbgo.fsf@oitofelix.com> ("Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro"'s message of "Sat, 31 Aug 2019 20:29:59 -0300") X-Provags-ID: V03:K1:L4MAbEPlu0nsSO+4Icjym49f+TAA3D78uqm5SWxcdZgE5g1nwU3 /5cBuDX62La+u6/tC5JIF/XDaFgOuyVTN8CSR0R8aWifmx7f/NAy7pFcn1Pz3UbOI6Ljyl8 n39lsGQImt8n8tIgLwbvaFWtmWYg3d4zKUns7n+nWGFvedOeBq0guzu25mZrrjpzhhsGzgd LWVLmIdzdiFuge+GDG1Cw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ecaoq8H2ESU=:oh/fTpeTqWm9AzUMwwCz5r HqLBHGr3waTBO3WSwmf7XUxyiixWtzrBGyhA5OmvLLXWFiwN84s00KjXWtzyAVAHLmZnQLmP8 Q/izDKDArNBgAoqCj9sXUpqrzZTQ+QcvSHDNnhyzhsLGivM+JTv4HUMSKABzhkIUKwaugH7zt G8/N/K3DLzf+HpkpFZ3hDfGbTFk9uKyybsIdaJPx+wpEUMDHFzpfNeqhxWnQmS3ZFXyERNNO7 tFetArZqalCOAgNPz1m0RzsO2wtxfPnhbONujXv3TvPQDuCu5BR7KVQuhFkbWc2A2Xq70dP3s QIs2MAbO6KNJvbkzg1fPX481+mkftZAO0qJolmp4x1rIyI6axIO12b3lOwHMNZSpNjlyHXvIo TR2Iyi4hpOiK2WflqqWMvHObM2IB3dxtdyCN2kQokBk93gmM1v8lxNVeHdVA8WamryJrr0mqM G7elf+eCvfE1DduQ+c54lmHSpZDYH59WgjYgQ8GPl9Q8RSNfkGuofP/mu/1kt2VVO3VT3FZjQ xSWDseQIhZAWbsUxssdmxrL3iRlHYbzj15R3RfO3Lt3WgmGTRoq5VO/sKPJCVfWkseDOgfPcm hrMsEkH9t5lDGv7XyAzKwbpYODIMFd/LSpzT2kRlB3DiZaddN4h4ou3JXUtuDsj8xmSXXrK88 GvfKF5LTDYUtx/XEkK+3DxPYKarK6/43kCOAEgusNXnlUmAW044xwtCS3aqBF+pSPBFtAbHIO ZiiIkTuJDsRsG6OYowsCxVes91aLAKLRceOxCv4JDOD/L5aup6LG6QAuFMdDz2OovX/ObO5w X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239747 Archived-At: Bruno F=C3=A9lix Rezende Ribeiro writes: > Hello Michael, Hi Bruno, > However, it=E2=80=99s 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=E2=80=99s most likely you are just giving me general advice as= if > it were to be included, but I=E2=80=99m 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=E2=80=99s enough to: >>> ;; >>> ;; (auth-source-remember '(:host "Funny-Machines" :user "root" :port "s= sh") >>> ;; '((: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=E2=80=99s Netrc files. > > I couldn=E2=80=99t find any reference to this function in auth-source=E2= =80=99s 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 =E2=80=98:global=E2=80=99 in =E2=80=98(= elisp) Defining Minor > Modes=E2=80=99: > > 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 =E2=80=98define-minor-mode=E2=80=99 form is eval= uated each time > Emacs starts; for packages that are not part of Emacs, the easiest way > to do this is to specify a =E2=80=98:require=E2=80=99 keyword. > > Since =E2=80=98tramp-auto-auth=E2=80=99 is not part of Emacs, I thought t= hat 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 =E2=80=98;;;###-autoload=E2=80=99 cookie feature d= ocumented? I > couldn=E2=80=99t 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=E2=80=99t find any other way to obtain the same effect. Do you = have > any suggestion? Change `tramp-read-passwd' accordingly. > Best regards, Best regards, Michael.