--- Begin Message ---
Subject: |
elisp-completion-at-point doesn't work when no characters typed |
Date: |
Fri, 9 Apr 2021 02:53:29 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
X-Debbugs-CC: Stefan Monnier <monnier@IRO.UMontreal.CA>
Example:
(|)
press C-M-i -> nothing
(a|)
press C-M-i -> lots of completions
That's not very conducive to API exploration via completion.
Further, it triggers a problem when used with company: if I initiate
completion when prefix is empty, it switches to the dabbrev-code
backend. Then, even after I type some chars, the same backend continues
to be used. Not company-capf, which I would want.
This patch seems to fix it:
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 8ade718640..203712f45d 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -496,7 +496,7 @@ elisp-completion-at-point
(end
(unless (or (eq beg (point-max))
(member (char-syntax (char-after beg))
- '(?\s ?\" ?\( ?\))))
+ '(?\" ?\()))
(condition-case nil
(save-excursion
(goto-char beg)
But I'm not sure why those elements were there in the first place.
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#47665: elisp-completion-at-point doesn't work when no characters typed |
Date: |
Sat, 10 Apr 2021 01:52:07 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
On 09.04.2021 05:38, Stefan Monnier wrote:
I don't think there was a deep reason.
More of a desire to be on the safe side and only provide completion when
there was some evidence that we were indeed in the presence of an identifier.
With your permission, I will change it then.
I don't think there are any significant cases where we're trying to
complete something other than an identifier and would benefit from
skipping over elisp-completion-at-point.
--- End Message ---