bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#58921: Tab completion hangs in eshell


From: Jim Porter
Subject: bug#58921: Tab completion hangs in eshell
Date: Thu, 23 Feb 2023 11:25:15 -0800

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 via email to

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