[Top][All Lists]

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

Re: tramp-dissect-file-name new user-error message

From: Michael Albinus
Subject: Re: tramp-dissect-file-name new user-error message
Date: Thu, 28 Mar 2013 11:09:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Thierry Volpiatto <address@hidden> writes:

> Hi Michael,

Hi Thierry,

>>> Is raising an error like this really useful ?
>> See <> for the
>> story behind.
> Hmm, this is another feature that assume everybody (must) use TAB to
> have a emacs completion buffer and RET to throw the result when the
> minibuffer is completed, which don't help third party tools using
> incremental completion like helm.

Nope. All such third party tools shall simply let-bind `non-essential' to t
when doing file name completion (aka calling `file-name-all-completions').
That's all.

>> In helm, when you complete file names, you shall let-bind `non-essential'
>> to t.
> Not exactly, I must bind it to t at beginning and let-bind it to nil
> when needed in some places.
> This is why I never been able to use it up to now.

Again, `non-essential' is set globally to nil. This shall not be changed
by any package. You only need to wrap around `file-name-all-completions'

> I will use this instead of defadvicing tramp-dissect-file-name.

Ohh. You should never do this! I even recommend not to call
`tramp-dissect-file-name'. Please use only Tramp functions which are
documented in the manual.

> BTW I am not a ido user, so I can tell, but double check this error
> message is not breaking ido in the same way it broke tramp completion in
> helm.

ido DTRT in `ido-file-name-all-completions-1':

    (let* ((len (1- (length dir)))
           (non-essential t)
            (or (file-name-all-completions "" dir)
                ;; work around bug in ange-ftp.
                ;; /ftp:address@hidden: => nil
                ;; /ftp:address@hidden:./ => ok
                 (not (string= "/ftp:" dir))
                 (file-remote-p dir)
                 ;; tramp-ftp-file-name-p is available only when tramp
                 ;; has been loaded.
                 (fboundp 'tramp-ftp-file-name-p)
                 (funcall 'tramp-ftp-file-name-p dir)
                 (string-match ":\\'" dir)
                 (file-name-all-completions "" (concat dir "./"))))))

I'm not an ido user either; here I go the way Stefan has proposed: wait
for error reports ...

> Thanks.

Best regards, Michael.

reply via email to

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