Subject: Re: bug#18643: 25.0.50; elisp--expect-function-p

From: Dmitry Gutov <[email-masked]>
Date: Thu, 16 Oct 2014 06:42:19 +0400

On 10/14/2014 10:32 PM, Stefan Monnier wrote:

> I agree, we should try to handle both cases better.  I.e. have a way to
> distinguish "the user explicitly requested completion, so try to come up
> with something" from the company case where we only want to auto pop up
> a completion menu if we're sufficiently confident that the suggestions
> are valuable.

The idea makes a certain amount of sense, but I'm not sure if "try to 
come up with something" should be performed in contexts where other 
completion functions are likely to be more valuable.

> Question is how to do it.  One way I see we could do it is by adding
> a property to completion data (e.g. in the data returned by the
> completion-at-point-function) which says something like "unsure" or
> "low-quality" so we could ignore those when the user hasn't explicitly
> requested completion.

How will that interact with other elements in 
completion-at-point-functions? Suppose there's another function there, 
named ispell-complete-at-point. And suppose it always returns non-nil 
when in strings or comments, which looks like a reasonable behavior.

Which function will be used in comment if the user explicitly requested 
completion, and if lisp-completion-at-point returned `unsure'? Will that 
depend on the order of the elements in c-a-p-f?