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: Mon, 28 Mar 2022 08:08:13 +0200 Message-ID: <87o81qwqwi.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> 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="25671"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 28 08:09:17 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 1nYiZ3-0006Yf-2D for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 28 Mar 2022 08:09:17 +0200 Original-Received: from localhost ([::1]:34004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYiZ1-0002Oj-Dj for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 28 Mar 2022 02:09:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYiYD-0002Ob-IT for help-gnu-emacs@gnu.org; Mon, 28 Mar 2022 02:08:25 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.134]:51593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYiYB-00033y-Pq for help-gnu-emacs@gnu.org; Mon, 28 Mar 2022 02:08:25 -0400 Original-Received: from localhost ([77.183.146.223]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mq1GE-1oLoww0yuo-00nDiA for ; Mon, 28 Mar 2022 08:08:20 +0200 In-Reply-To: <87fsn2q0mk.fsf@web.de> (Michael Heerdegen's message of "Mon, 28 Mar 2022 04:20:03 +0200") X-Provags-ID: V03:K1:qzjBTEbFsLCcgRygfl+FP/Id1y5X9sgduEeW43o1CAU4uuLRWK1 +DitqLWeWauQCILoowJvdbCSfiga/7THu8R+dBJ1ORarncsxB4Z2wjYZkpkRpAfgGeV4dx3 WsSvMFm2H0C0zy7js8eDDkDi6NndhHLGWOmzJRSjQmg6s1Y/+MwNio8IZN5+8I8sT/gwri2 uPCG3+2DGjfdePrjlzhWg== X-UI-Out-Filterresults: notjunk:1;V03:K0:q9SPH900W74=:PVRpuIZnFyVB6wbPkCQ9Wd +kpYx/QcdKk7IaUf/d0sygN6giCZxI5BYjkSDAlXKoi6pFBOO+BWL0cSGOs3GxGfOBrzWDi0i VEL6FFaK1iMEgmEj9AMSf/HLq05TtMgGgM0QwZAfm82/DQP6VKwVLqKTALWVSImIKk1TqR5Ez TjVoliV8XGItC03w212WvE/YrWKIudvnhHFcoi9tx4+QkgvWc2fyT4zYMmLGjGtU6034zM9yA wDsYEvJHUCzlkw0ZZoHB8igmOLTnU0KLKv4p5kB7sC6lM28GKriyqT4gN+glsn2Z3+6XhwXiJ CbTQNuKkvsANBwyLO8awet33ic0LKUdTCT67+KOmx1iEgzQ/6g/HRFGWAqwHwV6nKsrpxBneV HIa0Fx7kpiGc9pHhk9GDAQOSdpn7/69TXC4aPuxU7v5e0Tjoi54m+TV6nzOvN25sUztqX4gfo wQJ1gaueG4FgpNwBPxHdtjE2m2C0Ng9i3g7435orzeJODGpkCVCWghMHm+PZf+bochVgs1HUN MulgOfOBgLmBWT5Ev4wxX5gXxumg3QZySS+lZQZtp0kEDV3aq1czM+3Z9cdLCQxdKp+CbB1gA pjq5j7ADRwywKOJWj+dcDSnnGyPPl4ILkz1cj0J7HMzmGDTiF70fleQLcgv1PmQgqX/dU4TB2 JMOCC4GRET00Vq7VMLkT/+DsZ2cC0Wmc4gSsKgi5XMf288/0b2KPvGIRw55JrlXhjuKuezc1n tncwKjyj3AdH2Yyc Received-SPF: none client-ip=212.227.126.134; 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_H2=-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:136795 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Heerdegen writes: > Michael Albinus writes: > >> I cannot reproduce. The following works fine: >> >> [=E2=80=A6] > > You missed the TWICE part in my last message. Just eval the above > twice: > > $ emacs -Q -l tramp --eval "(add-to-list 'file-name-handler-alist > (cons (tramp-archive-autoload-file-name-regexp) > #'tramp-archive-autoload-file-name-handler))" --eval > '(file-directory-p "/home/albinus/tmp/out.tar.xz/")'\ > --eval "(add-to-list 'file-name-handler-alist > (cons (tramp-archive-autoload-file-name-regexp) > #'tramp-archive-autoload-file-name-handler))" --eval > '(file-directory-p "/home/albinus/tmp/out.tar.xz/")' > > Sorry, but that's the best recipe I can offer. And I guess something > like this is actually happening. AFAIU, Tramp can call > `tramp-register-archive-file-name-handler' several times - see > tramp-archive.el line 394: With Emacs 27.1, I ran the test in the attached script a couple of times and could *not* reproduce your error. --=-=-= Content-Type: text/x-sh; charset=utf-8 Content-Disposition: attachment; filename=test.sh Content-Transfer-Encoding: quoted-printable Content-Description: Script to test the issue with tramp #!/bin/sh # Usage: testscript ARCHIVE_PATH [COUNT] # # Start Emacs and test =E2=80=98file-directory-p=E2=80=99 on ARCHIVE_PATH. # # Each time before using =E2=80=98file-directory-p=E2=80=99, add # # (cons (tramp-archive-autoload-file-name-handler) # #'tramp-archive-autoload-file-name-handler) # # to =E2=80=98file-name-handler-alist=E2=80=99. =E2=80=98file-directory-p= =E2=80=99 is called twice. # # Do this for COUNT times or just once if COUNT is not provided # # ARCHIVE_PATH defaults to # ~/"src/emacs/test/lisp/net/tramp-archive-resources/foo.iso/". # Emacs -nw switch: do not create a GUI frame. nw=3D-nw archive_path=3D${1:-~/"src/emacs/test/lisp/net/tramp-archive-resources/foo.= iso/"} if ! [ -e "$archive_path" ] then printf '"%s" does not exist' "$archive_path" >&2 exit 66 # EX_NOINPUT fi count=3D${2:-1} run_emacs () { emacs $nw -Q -l tramp \ --eval \ '(setq command-error-function ;; Catch an error in a process filter. (lambda () (kill-emacs 1)))' \ --eval \ "(add-to-list 'file-name-handler-alist (cons (tramp-archive-autoload-file-name-regexp) #'tramp-archive-autoload-file-name-handler))" \ --eval \ '(let ((ret 2)) (unwind-protect (setq ret (if (file-directory-p "'"$archive_path"'") ;; either result counts as success 0 0)) (kill-emacs ret)))' \ --eval \ "(add-to-list 'file-name-handler-alist (cons (tramp-archive-autoload-file-name-regexp) #'tramp-archive-autoload-file-name-handler))" \ --eval \ '(let ((ret 3)) (unwind-protect (setq ret (if (file-directory-p "'"$archive_path"'") ;; either result counts as success 0 0)) (kill-emacs ret)))' } i=3D0 while [ "$i" -lt "$count" ] do i=3D$(( i + 1 )) run_emacs ret=3D$? case $ret in 0) # All good, just continue ;; 1) echo "=E2=80=98command-error-function=E2=80=99 killed emacs" >&2 exit $ret ;; 2) echo "1. =E2=80=98unwind-protect=E2=80=99 killed emacs" >&2 exit $ret ;; 3) echo "2. =E2=80=98unwind-protect=E2=80=99 killed emacs" >&2 exit $ret ;; *) echo "Unexpected return code: $ret" >&2 exit $ret ;; esac done --=-=-= Content-Type: text/plain -- Felix Dietrich --=-=-=--