From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felix Dietrich Newsgroups: gmane.emacs.help Subject: Re: Error with tramp-archive-autoload-file-name-handler Date: Thu, 07 Apr 2022 19:54:17 +0200 Message-ID: <87fsmog4om.fsf@sperrhaken.name> References: <87bkxtzjf1.fsf@web.de> <871qyphzv1.fsf@gmx.de> <87r16o4jxo.fsf@web.de> <871qyouuls.fsf@web.de> <87y20vg5gu.fsf@gmx.de> <87fsn2q0mk.fsf@web.de> <87o81qwqwi.fsf@sperrhaken.name> <87h77ifk6w.fsf@gmx.de> <87v8vx7gsz.fsf@web.de> <87wngddxm0.fsf@gmx.de> <87pmm11sdw.fsf@web.de> <877d873dak.fsf@sperrhaken.name> <87v8vre7y6.fsf@gmx.de> <87lewiy4t5.fsf@sperrhaken.name> <87y20igjww.fsf@gmx.de> <87o81d8akz.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9063"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Michael Albinus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 07 19:54:57 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncWLR-00027A-6s for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 07 Apr 2022 19:54:57 +0200 Original-Received: from localhost ([::1]:42854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ncWLQ-0001ju-5E for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 07 Apr 2022 13:54:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncWKz-0001ib-Ls for help-gnu-emacs@gnu.org; Thu, 07 Apr 2022 13:54:29 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.74]:53073) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ncWKx-0003A6-Mu for help-gnu-emacs@gnu.org; Thu, 07 Apr 2022 13:54:29 -0400 Original-Received: from localhost ([77.191.182.180]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N6LIF-1o52aU2owr-016jLb; Thu, 07 Apr 2022 19:54:23 +0200 In-Reply-To: <87o81d8akz.fsf@gmx.de> (Michael Albinus's message of "Thu, 07 Apr 2022 12:14:04 +0200") X-Provags-ID: V03:K1:nZDLbmneSWB/hcd3zW7DtXIE4pPC7O6tpxwMlOuf8Ao6wr8+eZ6 3G29kk+w0RmI5Z37QaZXcTCel/5skh+SHZUASi6+eYF9/iQYtplhZadjEQ9gMKEoo6/qNij jUig0xksqowUx0YrZBuyWtQjow52bvikOHGQuX96Lhfx7serWJtoR6bMCHj2JWSd/Xajfcy r4Q+Lr5ai4QzjpMkt8QQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZNN8k3f8h48=:h7Pf+ko+GVTiQRweHK+fBs kHx7OnhoO3nZJsFYpTSE/GUoLUyLASzvS5EiVLV/e86QY6pztaMBPqmvHPczXHYHLe5n5W1SB H8t0EG/a84SWL3WL11QZBeKn1pxrcy6ulUxj2FTieYw+F8QHnMnVc/biolG1nkS+n+zdny2c8 FbhCvH8PU9X4Wh/u7kALbBBMVaeEcY+1EXjT6MMiXUJLF3rOlWs8YQWUxOZiAL4zapKEWXjBe D06AZ/sOnj+oDR7F9x3VtiFq6p77/DIquSAYjOryMOW8zaIeXc+YblRPL2Ew0WHeftAUz36Wx pK0+DzL55W5AHAeejQ0zmPoWAxD/I9QY/KNBpJiLUpC+D9emBaxrS8AI7DQQms7hlyUmv0dVN nZ/6sut340SiLZlSW+Lts2DRFb8Pibr7dALwHg+YOHp1+Z2LoizvLS3HM4JqDd8eWZ3r2umvp rIR1yG7n/4dRh1El7Z/p64Tjh7Y8QVMm8JNUFdpv2tu3D0U0lSeblJIgXazCpnRkMGt941A4K MhDz24ZpauJLP1z5ZqqYjlAOUhDstYY45WA+gcTQJCwxD2QBDyyOZI9+OIu3PW+0fOQe6+veA JF4MSo8aKjXULveeSFRT5P0evgbCV1vOgOc6L36mKqMtRFuqEDlVsJnyQQhZTky0nXy/WFruQ SqKy70cm9wUPwXFmbA4bTEPA4e9tVToww5UpnkxAX2GQa9jk/1Zsw18u0nqJJDKiWTwrs3us5 X9ftXUhtWVq4j1rX Received-SPF: none client-ip=217.72.192.74; envelope-from=felix.dietrich@sperrhaken.name; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136886 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Michael, Michael Albinus writes: > Michael Albinus writes: >> I've shortly tested the recipe given in that bug, and everything seems >> to be OK with your patch. I will apply your patch in your name to the >> emacs-28 branch, after I have merged it with other pending Tramp >> patches. > > Done. >> Perhaps you could provide a ChangeLog-style commit message? Thanks for taking care of fixing the style of my commit message. :) Hm, I had wanted to add that now =E2=80=98tramp-autoload-file-name-handler= =E2=80=99 and =E2=80=98tramp-archive-autoload-file-name-handler=E2=80=99 look nearly the = same, and that a nicer solution would be to revert the changes of 4db69b32b8 (=E2=80= =9CFix bug#48476=E2=80=9D) to tramp-archive.el and make the archive autoload handl= er an alias again to =E2=80=98tramp-autoload-file-name-handler=E2=80=99 as well a= s changing the latter to use =E2=80=98tramp-archive-enabled=E2=80=99 directly instead = of via =E2=80=98tramp-archive-autoload=E2=80=99. Interestingly, this does not wor= k (almost sent it without testing): it causes a similar issue as bug #48476 with an error message =E2=80=9CRecursive load=E2=80=9D (no hang due to an infini= te loop though). Do you remember why using =E2=80=98defalias=E2=80=99 here causes = an infinite recursion? The attached patch shows the erroneous changes described above. Here the steps from bug #48476 to reproduce the issue: mkdir foo.tar cd foo.tar emacs I also forced =E2=80=98tramp-gvfs-enabled=E2=80=99 to t because its checks = do not seem to take the DBUS_SESSION_BUS_ADDRESS environment variable into account (which was set by dbus-run-session). Maybe this had a negative influence. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-Make-tramp-archive-autoload-file-name-handler-an-ali.patch Content-Transfer-Encoding: quoted-printable Content-Description: Patch with changes that result in a recursive load >From d1182bca9737129c0b517b4370f0ddc52f11dcad Mon Sep 17 00:00:00 2001 From: Felix Dietrich Date: Thu, 7 Apr 2022 17:43:10 +0200 Subject: [PATCH] Make tramp-archive-autoload-file-name-handler an alias MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-handler): Make =E2=80=98tramp-archive-autoload-file-name-handler=E2=80=99 an alias of =E2=80=98tramp-autoload-file-name-handler=E2=80=99. This reverts the chang= es to this file introduced by =E2=80=9CFix bug#48476=E2=80=9D on 22. May 2021. * lisp/net/tramp.el (tramp-autoload-file-name-handler): Use =E2=80=98tramp-archive-enabled=E2=80=99 instead of =E2=80=98tramp-archi= ve-autoload=E2=80=99. --- lisp/net/tramp-archive.el | 12 ++---------- lisp/net/tramp.el | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 4b649edaab..cc7d6b3694 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -353,16 +353,8 @@ arguments to pass to the OPERATION." (tramp-archive-run-real-handler operation args))))))) =20 ;;;###autoload -(progn (defun tramp-archive-autoload-file-name-handler (operation &rest ar= gs) - "Load Tramp archive file name handler, and perform OPERATION." - (defvar tramp-archive-autoload) - (let (;; We cannot use `tramp-compat-temporary-file-directory' here - ;; due to autoload. When installing Tramp's GNU ELPA package, - ;; there might be an older, incompatible version active. We - ;; try to overload this. - (default-directory temporary-file-directory) - (tramp-archive-autoload tramp-archive-enabled)) - (apply #'tramp-autoload-file-name-handler operation args)))) +(defalias 'tramp-archive-autoload-file-name-handler + #'tramp-autoload-file-name-handler) =20 (put #'tramp-archive-autoload-file-name-handler 'tramp-autoload t) =20 diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a24d83f876..72ce862dc4 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2678,7 +2678,7 @@ Falls back to normal file name handler if no Tramp fi= le name handler exists." ;; might be an older, incompatible version active. We try to ;; overload this. (let ((default-directory temporary-file-directory)) - (when (bound-and-true-p tramp-archive-autoload) + (when (bound-and-true-p tramp-archive-enabled) (load "tramp-archive" 'noerror 'nomessage)) (load "tramp" 'noerror 'nomessage))) (apply operation args))) --=20 2.35.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Felix Dietrich writes: >> Now, why is it a problem to add >> =E2=80=98tramp-archive-autoload-file-name-handler=E2=80=99 to =E2=80=98f= ile-name-handler-alist=E2=80=99 >> if =E2=80=98tramp-archive-file-name-handler=E2=80=99 is already there? = Why does the >> following snipped still fail even though >> =E2=80=98tramp-archive-file-name-handler=E2=80=99 comes first in the han= dler alist? > With my previous patch, this shouldn't happen > anymore. Both tramp-archive-autoload-file-name-handler and > tramp-archive-file-name-handler shouldn't coexist in > file-name-handler-alist. Do you still see this after your patch has been > applied? I haven=CA=BCt looked particular hard, but no, I do not see both the autolo= ad and the normal handler in the =E2=80=98file-name-handler-alist=E2=80=99 at = the same time after a normal start and load of tramp =E2=80=93 well, if I don=CA=BCt put = them there myself, that is. My intention with this part was to show the issue I described was connected to and indeed the cause for the problem Michael Heerdegen had encountered, and also just to provide further details (I was really confused about the example in that part for quite a while). --=20 Felix Dietrich --=-=-=--