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

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

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


From: Dmitry Gutov
Subject: bug#18643: 25.0.50; elisp--expect-function-p
Date: Fri, 10 Oct 2014 07:34:04 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

On 10/09/2014 07:27 PM, Stefan Monnier wrote:

I mean, Elisp completion has been context-sensitive "for ever", so the
change is not that it now is, but that it now reacts to the
context differently.

It completed against "all available symbols" in way too many situations. And the logic was even simpler before 24.4, where IIRC you adopted some code from company-elisp (and also reimplemented some).

I think this is not right: we should have a elisp--expect-exp-p
which returns non-nil in a context where we know the symbol at point
should be a valid expression (i.e. a variable).

Yes, I guess it would make more sense (this function can whitelist certain cases, like function name in a defun, for example).

> Not sure how to write
it, tho, but in its absence I think we're better off completing against
"anything" than restricting ourselves to variables.

Emacs 25.1 is probably still far away enough for us to get this right. No need to revert useful changes.

BTW, to improve on these behaviors, one approach is to take the
macro-expansion code used in elisp--local-variables and use it
"everywhere".  I.e. expand elisp--local-variables so it doesn't just
return the list of local vars, but also returns whether we're inside
a quote, or we're expecting a function, or we're expecting an expression.

I'm glad that you think this approach will work. Sounds like then the code will just have to handle a fixed number of forms, which is solvable.

Now I just have to wrap my head around `elisp--local-variables'. :)





reply via email to

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