[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless ae36760f61 015/204: Colorize matching portion
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless ae36760f61 015/204: Colorize matching portions of candidates |
Date: |
Tue, 11 Jan 2022 12:58:13 -0500 (EST) |
branch: externals/orderless
commit ae36760f610d25693f089dde31b51d4e9c5f9363
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>
Colorize matching portions of candidates
---
orderless.el | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/orderless.el b/orderless.el
index 22ac79927e..c5150560f3 100644
--- a/orderless.el
+++ b/orderless.el
@@ -45,6 +45,15 @@
;;; Code:
+(defun orderless-highlight-match (regexp string)
+ (when (string-match regexp string)
+ (font-lock-prepend-text-property
+ (match-beginning 0)
+ (match-end 0)
+ 'face 'completions-common-part
+ string)
+ t))
+
(defun orderless-all-completions (string table pred _point)
(let* ((lim (car (completion-boundaries string table pred "")))
(prefix (substring string 0 lim))
@@ -55,10 +64,12 @@
(condition-case nil
(progn
(setq all
- (cl-loop for candidate in all
- when (cl-loop for regexp in regexps
- always (string-match-p regexp
candidate))
- collect candidate))
+ (save-match-data
+ (cl-loop for candidate in all
+ when (cl-loop for regexp in regexps
+ always (orderless-highlight-match
+ regexp candidate))
+ collect candidate)))
(when all (nconc all (length prefix))))
(invalid-regexp nil))))
- [elpa] externals/orderless 24cfe928e4 010/204: Minor tweaks, (continued)
- [elpa] externals/orderless 24cfe928e4 010/204: Minor tweaks, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c5003a2990 014/204: Fix typo, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 95b6e302f6 001/204: Initial version of orderless, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 5e402282db 005/204: Mostly (but not completely) fix the problem with file completion, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 7752cb4abb 013/204: Correct innocuous typo, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless eaa8b00d23 026/204: Add "literature review", ELPA Syncer, 2022/01/11
- [elpa] externals/orderless cd24e47c96 012/204: Corrected very misleading typo, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 938c7639ad 006/204: Finish fixing problem with file completion, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 105a004784 008/204: Improve installation instructions, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 7f79dc2233 038/204: Don't move point unless actually completing, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless ae36760f61 015/204: Colorize matching portions of candidates,
ELPA Syncer <=
- [elpa] externals/orderless 2913935f16 002/204: Add README and tweak commentary, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 2be7bf8c3d 009/204: Add forgotten :test to cl-pushnew call, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 4effeb0839 032/204: Merge pull request #5 from protesilaos/update-defface-syntax, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 118ec4f36a 025/204: Document customization options, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 3b2741737b 042/204: Fix regression bug on no matches, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless ba93f3e521 055/204: Typo in README pointed out by codecoll, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c23a9a40be 050/204: Typo in README, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 40d46ba925 080/204: Fix typo, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless a3471e47aa 083/204: Explain company integration (+ misc formatting improvements), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 7e57a5458c 085/204: Allow dispatcher to modify component without handling it, ELPA Syncer, 2022/01/11