unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: reza <reza@housseini.me>, 58921@debbugs.gnu.org
Subject: bug#58921: Tab completion hangs in eshell
Date: Thu, 23 Feb 2023 11:25:15 -0800	[thread overview]
Message-ID: <714828fe-bf60-f991-363b-6ee86fd70c30@gmail.com> (raw)
In-Reply-To: <jwvsfewfe7d.fsf-monnier+emacs@gnu.org>

On 2/23/2023 10:08 AM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> This looks good, but doesn't that still leave an inf-loop bug when the
> input doesn't (pcomplete-match "\\`--.*=" 0)?

Testing this manually, I think it's ok. Prior to my patch, the following 
works ok:

   1)  tar potato <TAB>
   2)  tar --potato <TAB>

However, this would hang:

   3)  tar --potato=russet <TAB>

So we just need to fix the case where the argument matches "\\`--.*=". 
I'm still not really clear on all the details of how Pcomplete works, 
but I think case (2) works because of this code just before my diff:

   (if (pcomplete-match "^--\\([^= \t\n\f]*\\)\\'" 0)
       ;; FIXME: Extract this list from "tar --help".
       (pcomplete-here*
        '("--absolute-names"
          ;; ...
          "--volno-file=")))

That is, if we have an arg starting with "--" and without an "=", call 
'pcomplete-here*'. Even the arg doesn't match anything in that list, it 
should still move forward (I think). However, when we have an "=" in the 
arg, the function instead evaluates the 'cond' block that I modified, so 
it needs to be sure to call 'pcomplete-here*' (or some other function) 
to make forward progress.

Maybe this should have some regression tests...





  reply	other threads:[~2023-02-23 19:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2cb2b8aa-0813-5eae-3bfc-27831b3d50dd@housseini.me>
2022-10-31  9:04 ` bug#58921: Tab completion hangs in eshell reza via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-02  7:28   ` Gerd Möllmann
2023-02-10  7:34   ` Jim Porter
2023-02-23  6:57     ` Jim Porter
2023-02-23 18:08     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-23 19:25       ` Jim Porter [this message]
2023-02-23 19:34         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-23 20:43           ` Jim Porter
2023-03-04  5:37             ` Jim Porter
2023-03-08 23:53               ` Jim Porter

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=714828fe-bf60-f991-363b-6ee86fd70c30@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=58921@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=reza@housseini.me \
    /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).