tramp-devel
[Top][All Lists]
Advanced

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

Re: TRAMP: Host name must not match method ...


From: Michael Albinus
Subject: Re: TRAMP: Host name must not match method ...
Date: Tue, 20 Aug 2013 12:06:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Matt McClure <address@hidden> writes:

Hi Matt,

>> Strange. The user error in `tramp-dissect-file-name' is raised only when
>> `tramp-completion-mode-p' returns nil. That function checks (beside
>> other things) the variable `non-essential', which is bound to t inside
>> `rfn-eshadow-update-overlay'. So there shouldn't be any problem.
>
> True. The first backtrace from my previous message is in a scenario
> where the error doesn't surface to the user. The second backtrace,
> which does not include `rfn-eshadow-update-overlay', is the failure
> case.

For the first backtrace, I could fix it (binding of `non-essential' was
too late).

The second problem you have shown is still not reproducible
locally. Anyway, the patch in `completion--sifn-requote' below uses the
same logic as in `rfn-eshadow-update-overlay', and should fix it for you
as well.

> Comparing rfn-eshadow-update-overlay to completion--sifn-requote, I
> notice that the former wraps its call to substitute-in-file-name with
> condition-case, whereas the latter does not. I believe the user-error
> is signaled in both cases, but in the former it's handled by
> condition-case, whereas in the latter nothing handles it.

Right. Except that the second case does not happen to me.

> But it seems that there must be a copy of minibuffer.el compiled into
> the executable (?). Even though the completion--sifn-requote is
> already defined, before my copy becomes active, I have to explicitly
> (load-library "minibuffer").

Yes. Some of the most used lisp packages are dumped into the Emacs
binary. You must recompile Emacs (or reload minibuffer.el, as you do).

The following patch is submitted to Emacs trunk. Please check, whether
it fixes the problem for you, especially in `completion--sifn-requote'.

--8<---------------cut here---------------start------------->8---
=== modified file 'lisp/ChangeLog'
*** lisp/ChangeLog      2013-08-17 10:20:15 +0000
--- lisp/ChangeLog      2013-08-20 09:50:38 +0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2013-08-20  Michael Albinus  <address@hidden>
+ 
+       * minibuffer.el (completion--sifn-requote): Bind `non-essential'.
+ 
+       * rfn-eshadow.el (rfn-eshadow-update-overlay): Move binding of
+       `non-essential' up.
+ 
  2013-08-17  Michael Albinus  <address@hidden>
  
        * net/tramp.el:

=== modified file 'lisp/minibuffer.el'
*** lisp/minibuffer.el  2013-07-30 20:42:15 +0000
--- lisp/minibuffer.el  2013-08-20 09:29:27 +0000
***************
*** 2246,2252 ****
    ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin"
    ;;          (substitute-in-file-name "C:\") => "/"
    ;;          (substitute-in-file-name "C:\bi") => "/bi"
!   (let* ((ustr (substitute-in-file-name qstr))
           (uprefix (substring ustr 0 upos))
           qprefix)
      ;; Main assumption: nothing after qpos should affect the text before upos,
--- 2246,2253 ----
    ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin"
    ;;          (substitute-in-file-name "C:\") => "/"
    ;;          (substitute-in-file-name "C:\bi") => "/bi"
!   (let* ((non-essential t)
!        (ustr (substitute-in-file-name qstr))
           (uprefix (substring ustr 0 upos))
           qprefix)
      ;; Main assumption: nothing after qpos should affect the text before upos,

=== modified file 'lisp/rfn-eshadow.el'
*** lisp/rfn-eshadow.el 2013-01-01 09:11:05 +0000
--- lisp/rfn-eshadow.el 2013-08-20 08:57:50 +0000
***************
*** 176,186 ****
  `file-name-shadow-mode'; the minibuffer should have already
  been set up by `rfn-eshadow-setup-minibuffer'."
    (condition-case nil
!       (let ((goal (substitute-in-file-name (minibuffer-contents)))
!             (mid (overlay-end rfn-eshadow-overlay))
!             (start (minibuffer-prompt-end))
!             (end (point-max))
!           (non-essential t))
          (unless
              ;; Catch the common case where the shadow does not need to move.
              (and mid
--- 176,186 ----
  `file-name-shadow-mode'; the minibuffer should have already
  been set up by `rfn-eshadow-setup-minibuffer'."
    (condition-case nil
!       (let* ((non-essential t)
!            (goal (substitute-in-file-name (minibuffer-contents)))
!            (mid (overlay-end rfn-eshadow-overlay))
!            (start (minibuffer-prompt-end))
!            (end (point-max)))
          (unless
              ;; Catch the common case where the shadow does not need to move.
              (and mid

--8<---------------cut here---------------end--------------->8---

Best regards, Michael.



reply via email to

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