unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Matt McClure <matthewlmcclure@gmail.com>
Cc: tramp-devel@gnu.org, emacs-devel@gnu.org
Subject: Re: TRAMP: Host name must not match method ...
Date: Tue, 20 Aug 2013 12:06:24 +0200	[thread overview]
Message-ID: <yqpgvc303cdb.fsf@gmx.de> (raw)
In-Reply-To: <CAJELnLEQ4b66VEdgN4WrZHaig0T5CL3curAJYNBF+_3Y5tVMOQ@mail.gmail.com> (Matt McClure's message of "Mon, 19 Aug 2013 22:38:10 -0400")

Matt McClure <matthewlmcclure@gmail.com> 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  <michael.albinus@gmx.de>
+ 
+ 	* 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  <michael.albinus@gmx.de>
  
  	* 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	other threads:[~2013-08-20 10:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 13:06 TRAMP: Host name must not match method Matt McClure
2013-08-16 13:15 ` Michael Albinus
2013-08-17 17:18   ` Matt McClure
2013-08-17 17:41     ` Matt McClure
2013-08-19 10:25       ` Michael Albinus
2013-08-19 12:07     ` Michael Albinus
2013-08-20  2:38       ` Matt McClure
2013-08-20 10:06         ` Michael Albinus [this message]
2013-08-27 20:01           ` Matt McClure

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yqpgvc303cdb.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=matthewlmcclure@gmail.com \
    --cc=tramp-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).