[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: partial-completion-mode and tramp.
From: |
Michael Albinus |
Subject: |
Re: partial-completion-mode and tramp. |
Date: |
Tue, 11 May 2004 12:37:37 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/20.7 (hpux) |
Stefan Monnier <address@hidden> writes:
>> ***************
>> *** 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?
> Stefan
Best regards, Michael.