bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57572: 29.0.50; Tramp error with tramp-file-name-unify


From: Thierry Volpiatto
Subject: bug#57572: 29.0.50; Tramp error with tramp-file-name-unify
Date: Sat, 10 Sep 2022 15:20:20 +0000

Michael Albinus <michael.albinus@gmx.de> writes:

>> This because helm connect to tramp as soon the last ":" is entered.
>
> Indeed.
>
>> Debugger entered--Lisp error: (file-error "File `' must be absolute")
>>   signal(file-error ("File `' must be absolute"))
>>   tramp-error((tramp-file-name "sudo" "root" nil "IPad-S340" nil "" nil) 
>> file-error "File `%s' must be absolute" "")
>>   tramp-file-name-unify((tramp-file-name "sudo" "root" nil "IPad-S340" nil 
>> "" nil) "")
>>   tramp-get-file-property((tramp-file-name "sudo" "root" nil "IPad-S340" nil 
>> "" nil) "" "file-readable-p" undef)
>>   tramp-sh-handle-file-readable-p("/sudo:root@IPad-S340:")

More exactly, when helm-find-files starts with "/sudo::" and the tramp
connection is not yet enabled, we have:

(file-remote-p "/sudo::" 'localname)
=> ""

and

(helm-ff-set-pattern "/sudo::")
=> #("/sudo:root@IPad-S340:" 6 10 (tramp-default t) 11 20 (tramp-default t))

then this value is passed to file-accessible-directory-p and we have the
error.

I tried this and it seems to work without error:

(file-accessible-directory-p
 (if (string= (file-remote-p path 'localname) "")
     ;; First connection
     (concat path "/") ;; path == "/sudo:root@IPad-S340:" (see above)
   path)) 

Not sure if it is safe with other methods though, didn't try.

Hope that helps.

Thanks.

-- 
Thierry

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]