unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47665: elisp-completion-at-point doesn't work when no characters typed
@ 2021-04-08 23:53 Dmitry Gutov
  2021-04-09  2:38 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Gutov @ 2021-04-08 23:53 UTC (permalink / raw)
  To: 47665; +Cc: stefan monnier

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.





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#47665: elisp-completion-at-point doesn't work when no characters typed
  2021-04-08 23:53 bug#47665: elisp-completion-at-point doesn't work when no characters typed Dmitry Gutov
@ 2021-04-09  2:38 ` Stefan Monnier
  2021-04-09 22:52   ` Dmitry Gutov
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2021-04-09  2:38 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 47665

> 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.

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.


        Stefan






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#47665: elisp-completion-at-point doesn't work when no characters typed
  2021-04-09  2:38 ` Stefan Monnier
@ 2021-04-09 22:52   ` Dmitry Gutov
  2021-04-09 22:57     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Gutov @ 2021-04-09 22:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 47665-done

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#47665: elisp-completion-at-point doesn't work when no characters typed
  2021-04-09 22:52   ` Dmitry Gutov
@ 2021-04-09 22:57     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2021-04-09 22:57 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 47665-done

> With your permission, I will change it then.

You have my blessing ;-)


        Stefan






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-09 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 23:53 bug#47665: elisp-completion-at-point doesn't work when no characters typed Dmitry Gutov
2021-04-09  2:38 ` Stefan Monnier
2021-04-09 22:52   ` Dmitry Gutov
2021-04-09 22:57     ` Stefan Monnier

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).