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

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

bug#50470: 27.1; 'company-mode' 'eshell'


From: Dmitry Gutov
Subject: bug#50470: 27.1; 'company-mode' 'eshell'
Date: Wed, 8 Jun 2022 01:39:03 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 07.06.2022 18:52, Stefan Monnier wrote:
Dmitry Gutov [2022-06-06 12:07:58] wrote:
On 06.06.2022 04:34, Stefan Monnier via Bug reports for GNU Emacs, the Swiss
army knife of text editors wrote:
Still, if you remove the ~/ the behavior is still not great: it seems I get
"Do*" completed to "Documents/ " where the SPC might not be what I want.
I think that space comes from exit-function (defined at the end of
pcomplete-completions-at-point).
So it should be orthogonal to the contents of the completion table.
Right, but when we complete file names in Eshell, the behavior is
better, because the exit-function is different.  I don't think there's
much we can do about it within `pcomplete.el`, tho.

I'm sorry, I don't understand.

pcomplete-completions-at-point is the completion function used for Eshell, and the exit-function it defines at the end is the one that inserts the spaces.

So... which behaviors are you comparing?

Speaking of trying to use completion-table-subvert, it doesn't seem obvious which value to use as S2. What we have is a list of strings, and the common prefix isn't going to always match the (unexpanded) input.

pcomplete-completions-at-point somehow has pcomplete-stub pointing to the necessary value (e.g. "/home/dgutov/Do") in the asterisk-less cases (due to some other code path being taken), but not in this specific one.

Conceptually, it seems easier and cleaner to avoid expansion in the first place. The patch below does that, though I'm not sure what unwanted side-effects it might have ('cd' still works).

In any case, supporting completion with asterisk doesn't seem very useful, given that the user might as well omit that char and get the same list of completions, and typing asterisk in the middle of a work doesn't work. That's where the 'backend' style could help indeed.

diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 5396044d8c..fa504bb618 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -204,8 +204,8 @@ eshell-dirs-initialize
                             'eshell-dirs-substitute-cd)
                       eshell-interpreter-alist)))

-  (add-hook 'eshell-parse-argument-hook
-           #'eshell-parse-user-reference nil t)
+  ;; (add-hook 'eshell-parse-argument-hook
+  ;;           #'eshell-parse-user-reference nil t)
   (if (eshell-under-windows-p)
       (add-hook 'eshell-parse-argument-hook
                #'eshell-parse-drive-letter nil t))





reply via email to

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