unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 23006@debbugs.gnu.org
Subject: bug#23006: 25.0.92; Loading Tramp breaks pcomplete in eshell-mode
Date: Tue, 22 Mar 2016 10:47:34 +0100	[thread overview]
Message-ID: <87egb2n8sp.fsf@gmx.de> (raw)
In-Reply-To: <00533907-878e-7f62-7b65-a4ba3318a8e9@yandex.ru> (Dmitry Gutov's message of "Mon, 21 Mar 2016 23:26:30 +0200")

Dmitry Gutov <dgutov@yandex.ru> writes:

>> So maybe we need two different flags for Tramp: One to suppress opening a
>> new connection under any circumstances, and one flag to tell Tramp that
>> we are in the file name completion business, and it shall open a new
>> connection only it is safe (like seeing a slash in the local file name
>> part). Remember my scenario about ediff'ing remote files; I *want* file
>> name completion for the second file, even if there's no established
>> connection yet.
>
> Do you have any reason to expect that `non-essential' would be set to
> non-nil in that context?

Yes. The reason is that it has been always my understanding of
non-essential. See the discussion between Stefan and me six years ago,
when non-essential was born.

Tramp needs an indication that file name completion is in
progress. Otherwise, it would regard remote file names like "/adb:" safe
to be handled, and it would report an error then. Again, we are speaking
about arbitray file name operations but file-name-all-completions and
file-name-completion. Every completion package is free to call any magic
file name operation while file name completion is in progress, it isn't
forbidden anywhere.

> From your description, I see the reason for the connection to be
> established. It does not describe the slash-related caveats, and what
> would make you avoid establishing a connection, e.g. in the case of
> ediff.

I start to believe that we need two different indications. Let's assume
non-essential provides two different non-nil values, `strict' and
`best-effort'. (I don't insist in these names, I even don't insist it
must be indicated by non-essential. Any other variable would do).

In the `strict' case, Tramp must not open a new connection under any
circumstances. That's your idle timer case. There might be also other
cases, but it shall be used with care, because it restricts Tramp's
convenience.

In the `best-effort' case, Tramp is said that file name completion is in
progress, and it shouldn't open a new connection even if the file name
to be completed looks like a valid remote file name, like "/adb:". Tramp
opens a new connection only when it is safe, for example when it has
detected a slash in the local file name part of the file name to be
completed. That's the case when the user has hit TAB, for example. File
name completion packages, which bind non-essential to true these days,
shall change this to a binding of `best-effort'.

>> Still, it would be nice to have let-bound non-essential in order to get
>> an effect.
>
> It's not that simple. First of all, I came to this bug from a report
> by a company-mode user. And apparently we're getting the same error,
> through pcomplete-completion-at-point, from two different user
> interactions: one that should set `non-essential' (like Stefan
> suggested), that would be the "idle completion", and one that
> shouldn't set `non-essential', that would be manually initiated
> completion.
>
> So setting `non-essential' in pcomplete-completion-at-point, or one of
> its callees, looks like a wrong solution to me.
>
> But getting back to this bug report:
>
> I've just typed `M-x pcomplete', which should be a good indicator that
> I probably want to be prompted for credentials, if
> required. `non-essential' should be nil in this scenario. And yet, I
> shouldn't see that error.

`strict' is superior to `best-effort'. Coming back to this bug report, I
would expect that non-essential is bound to `best-effort' somewhere in
pcomplete or the involved completion package(s). When one of these
packages determine, that they run in an idle timer (or something
comparable dangerous), they should overwrite this binding of non-essential
with `strict'.

Best regards, Michael.





  reply	other threads:[~2016-03-22  9:47 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14  2:01 bug#23006: 25.0.92; Loading Tramp breaks pcomplete in eshell-mode Dmitry Gutov
2016-03-14  2:22 ` Stefan Monnier
2016-03-14  7:34 ` Michael Albinus
2016-03-15  3:31   ` Stefan Monnier
2016-03-15  8:43     ` Michael Albinus
2016-03-15 11:09       ` Dmitry Gutov
2016-03-17  0:42       ` Stefan Monnier
2016-03-17 19:43         ` Michael Albinus
2016-03-17 19:44           ` Dmitry Gutov
2016-03-17 19:54             ` Michael Albinus
2016-03-17 22:55               ` Dmitry Gutov
2016-03-18  8:27                 ` Michael Albinus
2016-03-18 16:13                   ` Stefan Monnier
2016-03-18 17:01                     ` Michael Albinus
2016-03-18 17:53                       ` Stefan Monnier
2016-03-18 20:21                         ` Michael Albinus
2016-03-18 22:41                           ` Stefan Monnier
2016-03-19  8:28                             ` Michael Albinus
2016-03-19 12:35                               ` Stefan Monnier
2016-03-19 15:28                                 ` Michael Albinus
2016-03-19 20:04                                   ` Stefan Monnier
2016-03-20 15:08                                     ` Michael Albinus
2016-03-20 15:23                                       ` Stefan Monnier
2016-03-20 15:46                                         ` Michael Albinus
2016-03-20 16:10                                           ` Stefan Monnier
2016-03-20 20:40                                             ` Michael Albinus
2016-03-20 22:17                                               ` Stefan Monnier
2016-03-20 22:28                                                 ` Dmitry Gutov
2016-03-21 15:57                                                 ` Michael Albinus
2016-03-20 15:38                                       ` Drew Adams
2016-03-20 15:54                                         ` Michael Albinus
2016-03-20 15:59                                           ` Dmitry Gutov
2016-03-20 20:31                                             ` Michael Albinus
2016-03-20 20:44                                               ` Dmitry Gutov
2016-03-20 20:53                                                 ` Michael Albinus
2016-03-20 21:05                                                   ` Dmitry Gutov
2016-03-20 22:19                                                     ` Stefan Monnier
2016-03-21 15:49                                                       ` Michael Albinus
2016-03-21 19:26                                                         ` Stefan Monnier
2016-03-22  9:27                                                           ` Michael Albinus
2016-03-22 12:02                                                             ` Stefan Monnier
2016-03-22 12:05                                                               ` Michael Albinus
2016-03-22 13:19                                                                 ` Stefan Monnier
2016-03-21 15:46                                                     ` Michael Albinus
2016-03-21 15:49                                                       ` Dmitry Gutov
2016-03-21 16:03                                                         ` Michael Albinus
2016-03-21 16:13                                                           ` Dmitry Gutov
2016-03-21 16:25                                                             ` Michael Albinus
2016-03-21 16:45                                                               ` Dmitry Gutov
2016-03-21 16:55                                                                 ` Michael Albinus
2016-03-21 18:10                                                                   ` Dmitry Gutov
2016-03-21 18:36                                                                     ` Michael Albinus
2016-03-21 21:26                                                                       ` Dmitry Gutov
2016-03-22  9:47                                                                         ` Michael Albinus [this message]
2016-03-22 12:05                                                                           ` Stefan Monnier
2016-03-22 12:20                                                                             ` Michael Albinus
2016-03-22 13:37                                                                               ` Stefan Monnier
2016-03-22 13:50                                                                                 ` Michael Albinus
2016-03-22 14:01                                                                                   ` Stefan Monnier
2016-03-24  1:00                                                                           ` Dmitry Gutov
2016-03-21 19:23                                                                   ` Stefan Monnier
2016-03-22  9:25                                                                     ` Michael Albinus
2016-03-22 12:02                                                                       ` Stefan Monnier
2016-03-22 12:08                                                                         ` Michael Albinus
2016-03-22 13:18                                                                           ` Stefan Monnier
2016-03-22 13:35                                                                             ` Michael Albinus
2016-03-22 13:38                                                                               ` Stefan Monnier
2016-03-22 13:50                                                                                 ` Michael Albinus
2016-03-24  0:54                                                                               ` Dmitry Gutov
2016-03-24 13:15                                                                                 ` Stefan Monnier
2016-03-24 13:54                                                                                   ` Dmitry Gutov
2016-03-24 15:56                                                                                     ` Stefan Monnier
2016-03-20 16:38                                           ` Drew Adams
2016-03-20 19:48                                             ` Drew Adams
2016-03-20 20:42                                               ` Michael Albinus
2016-03-18 22:51                         ` Dmitry Gutov
2016-03-17  0:50   ` Stefan Monnier
2016-03-17 19:49     ` Michael Albinus
2016-03-18 16:06       ` Stefan Monnier
2017-03-09 18:52 ` Michael Albinus
2017-03-15 12:42 ` Michael Albinus
2017-03-17 11:30   ` Dmitry Gutov

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=87egb2n8sp.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=23006@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=monnier@iro.umontreal.ca \
    /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).