GNU bug report logs -
#42149
Substring and flex completion ignore implicit trailing ‘any’
Previous Next
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> Regardless, if you don't want to touch that funciton, I understand, it
>> is used in more places than just completion-pcm--hilit-commonality,
>> which really should be called
>>
>> completion--given-that-we-know-this-matches-tell-me-where-and-how-well
>
> Hmm... until someone™ added scoring to it, this function did nothing
> more than add faces to highlight the common parts and the "first
> difference". So I'd suggest you take it up with that someone ;-)
:-)
Grumblebgrumpbl. I kinda did, and so I added a docstring to it (have a
read). Anyway, what's suprising about this function is that this
re-matches PATTERN to each of COMPLETIONS which is very odd to the
reader, becasue it also asserts that PATTERN already matches
COMPLETIONS. Why are we regexp-matching twice?! -- asks the poor soul
reading this.
This comes down to completion-regexp-list being used by
Fall_completions() directly. If that C function recorded the match data
in all the lisp strings it was passed, then completion--given-that...
would be easier follow. And likely faster. Though I haven't measured
the impact, sparing a regexp match against each completion might be
worth it in terms of responsiveness, especially in flex and similar
methods.
João
This bug report was last modified 4 years and 7 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.