[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/bug-42149-funny-pcm-completion-scores 1deade1 3/6: Robustify a h
From: |
João Távora |
Subject: |
scratch/bug-42149-funny-pcm-completion-scores 1deade1 3/6: Robustify a helper function for test/lisp/minibuffer-tests.el |
Date: |
Mon, 28 Dec 2020 04:29:26 -0500 (EST) |
branch: scratch/bug-42149-funny-pcm-completion-scores
commit 1deade1f45287278d54860a293b11bc69fabdf26
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Robustify a helper function for test/lisp/minibuffer-tests.el
completion--pcm-first-difference-pos wasn't taking into account the
fact that faces may come in lists. bug#42149
* test/lisp/minibuffer-tests.el
(completion--pcm-first-difference-pos): Robustify.
---
test/lisp/minibuffer-tests.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index d665587b..381096f 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -112,11 +112,14 @@
(get-text-property 0 'completion-score comp))
(defun completion--pcm-first-difference-pos (comp)
- (cl-loop for pos = (next-single-property-change 0 'face comp)
+ (cl-loop with faces
+ for pos = (next-single-property-change 0 'face comp)
then (next-single-property-change pos 'face comp)
while pos
- when (eq (get-text-property pos 'face comp)
- 'completions-first-difference)
+ when (or (eq (setq faces (get-text-property pos 'face comp))
+ 'completions-first-difference)
+ (and (listp faces)
+ (memq 'completions-first-difference faces)))
return pos))
(ert-deftest completion-pcm-test-1 ()
- 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 <=
- scratch/bug-42149-funny-pcm-completion-scores ec02ae5 4/6: Robustify completion match scoring for incomplete/implicit patterns, João Távora, 2020/12/28
- 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