Felix Dietrich writes: Hi, > Michael Heerdegen writes: > >> Michael Albinus writes: >> >>> I cannot reproduce. The following works fine: >>> >>> […] >> >> 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. Same here, I cannot reproduce it with Emacs 27, Emacs 28, Emacs 29. Btw, I believe a more realistic check would be --8<---------------cut here---------------start------------->8--- $ emacs -Q -f tramp-register-archive-file-name-handler --eval '(file-directory-p "/home/albinus/tmp/out.tar.xz/")'\ -f tramp-register-archive-file-name-handler --eval '(file-directory-p "/home/albinus/tmp/out.tar.xz/")' --8<---------------cut here---------------end--------------->8--- It is tramp-register-archive-file-name-handler which might be invoked several times, and which causes the problem. Could *you* (Michael) reproduce the problem with this recipe? Anyway, I've pushed the appended patch to the repositories. It should fix this problem, hopefully. Best regards, Michael.