Closed nickdrozd closed 6 years ago
Yep, boolean functions are definitely worth adding. Suggest.el isn't intended to be limited to lists: it does a good job with strings and numbers too (vector support is limited currently).
Booleans are less useful when you can only supply one example, see #29.
Based on your great examples here, I've tweaked suggest-extra-args
in 0601f08 to avoid some of these sillier examples. A lot of functions return nil if they don't know what to do, so 5 => nil
is a tricky problem.
Suggest.el will stop searching after it's found more than 20 results, see suggest--max-possibilities
. For nil, we're finding so many ways of calculating it that we don't reach the boolean functions.
Could you put the booleans first in suggest-functions
? That will ensure we suggest using them.
Updated
Thank you :)
It looks like for the most part, boolean p-functions (
numberp
,stringp
,consp
) are included in the results when the output ist
, but not when the output isnil
. For instance, the query[5] => nil
might be expected to return(stringp 5)
. Functions that operate on booleans (booleanp
,not
) don't seem to show up at all.Maybe
suggest
is fundamentally list-oriented, and the outputnil
is interpreted as a list, rather than a boolean. Perhaps the split is due to the arguably dumb choice in Emacs to use the empty list for false instead of a dedicated boolean symbol.Note that this PR does NOT solve #35.