[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/bug-42149-funny-pcm-completion-scores ec02ae5 4/6: Robustify com
From: |
João Távora |
Subject: |
scratch/bug-42149-funny-pcm-completion-scores ec02ae5 4/6: Robustify completion match scoring for incomplete/implicit patterns |
Date: |
Mon, 28 Dec 2020 04:29:27 -0500 (EST) |
branch: scratch/bug-42149-funny-pcm-completion-scores
commit ec02ae5a3af91f6bec06bbf08b7df841f772d15f
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Robustify completion match scoring for incomplete/implicit patterns
completion-pcm--hilit-commonality, which propertizes and scores a
previously confirmed match, expects PATTERN to match the strings `of
COMPLETIONS entirely. In this patch, we take care that the main goal
of this function, isn't affected by some optimzations that transform
PATTERN beforehand.
* lisp/minibuffer.el (completion-pcm--hilit-commonality):
Initialize start to 0 and end to the length of the string.
---
lisp/minibuffer.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 7d05f77..df4ec67 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3255,10 +3255,10 @@ one-letter-long matches).")
(unless (string-match re str)
(error "Internal error: %s does not match %s" re str))
(let* ((pos (if point-idx (match-beginning point-idx) (match-end 0)))
- (md (match-data))
- (start (pop md))
- (end (pop md))
+ (md (cddr (match-data)))
+ (start 0)
(len (length str))
+ (end len)
;; To understand how this works, consider these bad
;; ascii(tm) diagrams showing how the pattern "foo"
;; flex-matches "fabrobazo", "fbarbazoo" and
- branch scratch/bug-42149-funny-pcm-completion-scores created (now 00ff781), João Távora, 2020/12/28
- scratch/bug-42149-funny-pcm-completion-scores 8465bf1 2/6: Make a completion test robust to custom completion styles, João Távora, 2020/12/28
- scratch/bug-42149-funny-pcm-completion-scores b06aadf 1/6: Add tests for bug#42149, João Távora, 2020/12/28
- scratch/bug-42149-funny-pcm-completion-scores 1deade1 3/6: Robustify a helper function for test/lisp/minibuffer-tests.el, João Távora, 2020/12/28
- scratch/bug-42149-funny-pcm-completion-scores ec02ae5 4/6: Robustify completion match scoring for incomplete/implicit patterns,
João Távora <=
- scratch/bug-42149-funny-pcm-completion-scores 04fdac8 5/6: Add docstring to completion-pcm--hilit-commonality, João Távora, 2020/12/28
- scratch/bug-42149-funny-pcm-completion-scores 00ff781 6/6: Slightly simplify completion-pcm--hilit-commonality, João Távora, 2020/12/28