GNU bug report logs -
#42149
Substring and flex completion ignore implicit trailing ‘any’
Previous Next
Full log
View this message in rfc822 format
João Távora <joaotavora <at> gmail.com> writes:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>>> I think this elimination of consecutive `any' should also be included in
>>> João’s branch.
>>
>> I just pushed (a rewrite of) that change to `master`.
>
> And I just pushed my cleaned up fix to to master as well, thus hopefully
> fixing the brunt of this bug. Dario and others, please test this. I
> haven't yet pushed the tests, since we're not entirely sure of those,
> but I think we should break them up further and push them too, once we
> come to an aggreement on what and how they should test exactly.
Meanwhile, I found that the patch after my sig fixes the remaining two
Dario tests, concerning the presumed misplacement of
'completions-first-difference.
I hadn't touched this part explicitly, and it doesn't seem to make a
world of difference, so I'll leave it up to you two if we should isntall
something like this or not. (I do think some form of tests should go
in).
I'll put this bit of patch in the side branch
scratch/bug-42149-funny-pcm-completion-scores, too
João
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index dc37c5f447..074d436b35 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3332,11 +3332,12 @@ completion-pcm--hilit-commonality
;; for that extra bit of match (bug#42149).
(unless (= from match-end)
(funcall update-score-and-face from match-end))
- (if (> (length str) pos)
- (add-face-text-property
- pos (1+ pos)
- 'completions-first-difference
- nil str))
+ (cl-loop for p from pos below (length str)
+ unless (eq (get-text-property p 'face str)
+ 'completions-common-part)
+ return (add-face-text-property p (1+ p)
+ 'completions-first-difference
+ nil str))
(unless (zerop (length str))
(put-text-property
0 1 'completion-score
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.