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

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

Re: partial-completion-mode and tramp.


From: Stefan
Subject: Re: partial-completion-mode and tramp.
Date: Sat, 09 Oct 2004 21:58:31 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)

>>> ***************
>>> *** 1104,1112 ****
>>> ;; Do `PC-do-completion' without substitution
>>> (let* (save)
>>> (fset 'save (symbol-function 'substitute-in-file-name))
>>> !     (fset 'substitute-in-file-name (symbol-function 'identity))
>>> !     ad-do-it
>>> !     (fset 'substitute-in-file-name (symbol-function 'save)))
>> 
>>> ;; Expand "$"
>>> (let* ((beg (or (and (functionp 'minibuffer-prompt-end) ; Emacs 21
>> 
>> YUCK!!
>> 
>> Can someone more clearly explain what this advice is trying to do so we can
>> replace it with something a bit less stomach-turning?

> The code is from me. It tries to provide a workaround that
> `PC-do-completion' calls `substitute-in-file-name', which is fatal in
> some cases.

> Imagine, you want to access to a Windows PC (horrible, but let discuss
> this another day). You would type

>  C-x C-f /smb:Adm <TAB> => /smb:address@hidden:

>  C-x C-f /smb:address@hidden:/C <TAB> => ERROR

> Debugger entered--Lisp error: (error "Substituting nonexistent environment 
> variable \"\"")
>   substitute-in-file-name("/smb:address@hidden:/C$/")

> The reason is, that, in `PC-do-completion', `all-completions' returns
> ("C$/"), and later on `substitute-in-file-name' is called with the
> expanded file name. See above.

> My workaround is a sledge hammer, indeed. But how to teach
> `PC-do-completion' to handle this case?

Actually, now that I think about it, I believe this is not a problem any
more in Emacs-CVS because `substitute-in-file-name' now ignores the $ which
do not correspond to a valid envvar.

        Stefan




reply via email to

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