unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bind non-essential in pcomplete to prevent tramp error
@ 2016-03-13 10:29 Michael Albinus
  2016-03-13 16:25 ` Eli Zaretskii
  2016-03-13 17:27 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Albinus @ 2016-03-13 10:29 UTC (permalink / raw)
  To: emacs-devel; +Cc: Jürgen Hötzel

Hi,

Jürgen Hötzel has reported an error in pcomplete, see
<https://github.com/company-mode/company-mode/pull/487#issuecomment-195926034>.
The following patch in the emacs-25 branch fixes this:

--8<---------------cut here---------------start------------->8---
*** /usr/local/src/emacs-25/lisp/pcomplete.el.~d457fd9dc782465e1547f74021390c9d5951d6af~	2016-03-13 11:24:57.162148275 +0100
--- /usr/local/src/emacs-25/lisp/pcomplete.el	2016-03-13 11:12:53.540170107 +0100
***************
*** 501,507 ****
      (setq pcomplete-current-completions nil
  	  pcomplete-last-completion-raw nil)
      (catch 'pcompleted
!       (let* ((pcomplete-stub)
  	     pcomplete-seen pcomplete-norm-func
  	     pcomplete-args pcomplete-last pcomplete-index
  	     (pcomplete-autolist pcomplete-autolist)
--- 501,508 ----
      (setq pcomplete-current-completions nil
  	  pcomplete-last-completion-raw nil)
      (catch 'pcompleted
!       (let* ((non-essential t)
!              pcomplete-stub
  	     pcomplete-seen pcomplete-norm-func
  	     pcomplete-args pcomplete-last pcomplete-index
  	     (pcomplete-autolist pcomplete-autolist)
--8<---------------cut here---------------end--------------->8---

Is it OK to install the patch in the emacs-25 branch?

Best regards, Michael.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 10:29 Bind non-essential in pcomplete to prevent tramp error Michael Albinus
@ 2016-03-13 16:25 ` Eli Zaretskii
  2016-03-13 18:05   ` John Wiegley
  2016-03-13 17:27 ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2016-03-13 16:25 UTC (permalink / raw)
  To: Michael Albinus; +Cc: juergen, emacs-devel

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Sun, 13 Mar 2016 11:29:43 +0100
> Cc: Jürgen Hötzel <juergen@archlinux.org>
> 
> --8<---------------cut here---------------start------------->8---
> *** /usr/local/src/emacs-25/lisp/pcomplete.el.~d457fd9dc782465e1547f74021390c9d5951d6af~	2016-03-13 11:24:57.162148275 +0100
> --- /usr/local/src/emacs-25/lisp/pcomplete.el	2016-03-13 11:12:53.540170107 +0100
> ***************
> *** 501,507 ****
>       (setq pcomplete-current-completions nil
>   	  pcomplete-last-completion-raw nil)
>       (catch 'pcompleted
> !       (let* ((pcomplete-stub)
>   	     pcomplete-seen pcomplete-norm-func
>   	     pcomplete-args pcomplete-last pcomplete-index
>   	     (pcomplete-autolist pcomplete-autolist)
> --- 501,508 ----
>       (setq pcomplete-current-completions nil
>   	  pcomplete-last-completion-raw nil)
>       (catch 'pcompleted
> !       (let* ((non-essential t)
> !              pcomplete-stub
>   	     pcomplete-seen pcomplete-norm-func
>   	     pcomplete-args pcomplete-last pcomplete-index
>   	     (pcomplete-autolist pcomplete-autolist)
> --8<---------------cut here---------------end--------------->8---
> 
> Is it OK to install the patch in the emacs-25 branch?

Looks reasonable to me, but I'd like to hear from Stefan as well.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 10:29 Bind non-essential in pcomplete to prevent tramp error Michael Albinus
  2016-03-13 16:25 ` Eli Zaretskii
@ 2016-03-13 17:27 ` Stefan Monnier
  2016-03-13 18:25   ` John Wiegley
  2016-03-13 18:45   ` Michael Albinus
  1 sibling, 2 replies; 11+ messages in thread
From: Stefan Monnier @ 2016-03-13 17:27 UTC (permalink / raw)
  To: emacs-devel

> !       (let* ((non-essential t)
> !              pcomplete-stub
>   	     pcomplete-seen pcomplete-norm-func
>   	     pcomplete-args pcomplete-last pcomplete-index
>   	     (pcomplete-autolist pcomplete-autolist)
> --8<---------------cut here---------------end--------------->8---
>
> Is it OK to install the patch in the emacs-25 branch?

Looks wrong.  Why would you consider this to be non-essential?


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 16:25 ` Eli Zaretskii
@ 2016-03-13 18:05   ` John Wiegley
  0 siblings, 0 replies; 11+ messages in thread
From: John Wiegley @ 2016-03-13 18:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, Michael Albinus, juergen

>>>>> Eli Zaretskii <eliz@gnu.org> writes:

>> !       (let* ((non-essential t)
>> !              pcomplete-stub

>> Is it OK to install the patch in the emacs-25 branch?

> Looks reasonable to me, but I'd like to hear from Stefan as well.

Looks reasonable to me as well. It makes sense, since Tramp might be triggered
during generation of a completion list.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 17:27 ` Stefan Monnier
@ 2016-03-13 18:25   ` John Wiegley
  2016-03-13 22:53     ` Stefan Monnier
  2016-03-13 18:45   ` Michael Albinus
  1 sibling, 1 reply; 11+ messages in thread
From: John Wiegley @ 2016-03-13 18:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

>>>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Looks wrong.  Why would you consider this to be non-essential?

It's "transitively non-essential", in that it can lead to prompting from Tramp
(or any other completion backend that might prompt).

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 17:27 ` Stefan Monnier
  2016-03-13 18:25   ` John Wiegley
@ 2016-03-13 18:45   ` Michael Albinus
  2016-03-14  0:07     ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2016-03-13 18:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> !       (let* ((non-essential t)
>> !              pcomplete-stub
>>   	     pcomplete-seen pcomplete-norm-func
>>   	     pcomplete-args pcomplete-last pcomplete-index
>>   	     (pcomplete-autolist pcomplete-autolist)
>> --8<---------------cut here---------------end--------------->8---
>>
>> Is it OK to install the patch in the emacs-25 branch?
>
> Looks wrong.  Why would you consider this to be non-essential?

Have you read the scenario presented by Jürgen? How would you solve this
differently?

`non-essential' was invented for cases like this: "It can be used to
prevent Tramp from ... displaying possible completions before the user
even asked for it."

>         Stefan

Best regards, Michael.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 18:25   ` John Wiegley
@ 2016-03-13 22:53     ` Stefan Monnier
  2016-03-13 23:02       ` Dmitry Gutov
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2016-03-13 22:53 UTC (permalink / raw)
  To: emacs-devel

>> Looks wrong.  Why would you consider this to be non-essential?
> It's "transitively non-essential", in that it can lead to prompting from Tramp
> (or any other completion backend that might prompt).

I don't understand how that's relevant.  Of course, if you want to see
the completions you may have to enter the password.

I get the impression that the non-essential binding should be further up
in the caller.


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 22:53     ` Stefan Monnier
@ 2016-03-13 23:02       ` Dmitry Gutov
  2016-03-14  0:18         ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Gutov @ 2016-03-13 23:02 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel

On 03/14/2016 12:53 AM, Stefan Monnier wrote:

> I get the impression that the non-essential binding should be further up
> in the caller.

Please try this:

M-x eshell

type 'cd /'

M-x pcomplete

I'm getting the error 'tramp-file-name-handler: Host name must not match 
method "adb"'.

Where should the fix be?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 18:45   ` Michael Albinus
@ 2016-03-14  0:07     ` Stefan Monnier
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2016-03-14  0:07 UTC (permalink / raw)
  To: emacs-devel

> Have you read the scenario presented by Jürgen?

No, where is that?  Do we have a bug# for it?

> `non-essential' was invented for cases like this: "It can be used to
> prevent Tramp from ... displaying possible completions before the user
> even asked for it."

That's right.  But that depends on the *caller* of pcomplete, because
it's not true of pcomplete in general.


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-13 23:02       ` Dmitry Gutov
@ 2016-03-14  0:18         ` Stefan Monnier
  2016-03-14  2:04           ` Dmitry Gutov
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2016-03-14  0:18 UTC (permalink / raw)
  To: emacs-devel

>> I get the impression that the non-essential binding should be further up
>> in the caller.
> Please try this:
> M-x eshell
> type 'cd /'
> M-x pcomplete
> I'm getting the error 'tramp-file-name-handler: Host name must not match
> method "adb"'.

Hmm... I get a *Completion* buffer with the expected contents (that was
using emacs-25).  Could we move this to a bug-report and get a backtrace?

> Where should the fix be?

Can't tell you based on this limited info, sorry,


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Bind non-essential in pcomplete to prevent tramp error
  2016-03-14  0:18         ` Stefan Monnier
@ 2016-03-14  2:04           ` Dmitry Gutov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Gutov @ 2016-03-14  2:04 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel

On 03/14/2016 02:18 AM, Stefan Monnier wrote:

> Hmm... I get a *Completion* buffer with the expected contents (that was
> using emacs-25).  Could we move this to a bug-report and get a backtrace?

http://debbugs.gnu.org/23006

No backtrace (it seems to signal user-error).



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-03-14  2:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13 10:29 Bind non-essential in pcomplete to prevent tramp error Michael Albinus
2016-03-13 16:25 ` Eli Zaretskii
2016-03-13 18:05   ` John Wiegley
2016-03-13 17:27 ` Stefan Monnier
2016-03-13 18:25   ` John Wiegley
2016-03-13 22:53     ` Stefan Monnier
2016-03-13 23:02       ` Dmitry Gutov
2016-03-14  0:18         ` Stefan Monnier
2016-03-14  2:04           ` Dmitry Gutov
2016-03-13 18:45   ` Michael Albinus
2016-03-14  0:07     ` Stefan Monnier

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).