diff options
| author | Omar Antolín <omar.antolin@gmail.com> | 2021-01-26 18:02:56 -0600 |
|---|---|---|
| committer | Omar Antolín <omar.antolin@gmail.com> | 2021-01-26 18:02:56 -0600 |
| commit | c023ee1cbe2185ab984981d662ad63ce1c905ddb (patch) | |
| tree | 300150b53ae1e0812ae79ca07ca86444792dc434 | |
| parent | ee5e8bda2551d8297f5737cb866a6490be27cb9f (diff) | |
Add option to skip-highlighting as requested by @clemera
| -rw-r--r-- | orderless.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/orderless.el b/orderless.el index 0548e2c..4e6bcd1 100644 --- a/orderless.el +++ b/orderless.el @@ -106,6 +106,13 @@ or a function of a single string argument." "Vector of faces used (cyclically) for component matches." :type '(vector face)) +(defcustom orderless-skip-highlighting nil + "Skip highlighting the matching parts of candidates? +If this is set to a function, the function is called to decide +whether to skip higlighting the matches. Any non-function non-nil +value means highlighting is skipped." + :type '(choice boolean function)) + (defcustom orderless-matching-styles '(orderless-regexp orderless-initialism) "List of component matching styles. @@ -425,9 +432,15 @@ This function is part of the `orderless' completion style." (let ((completions (orderless-filter string table pred))) (when completions (pcase-let ((`(,prefix . ,pattern) - (orderless--prefix+pattern string table pred))) + (orderless--prefix+pattern string table pred)) + (skip-highlighting + (if (functionp orderless-skip-highlighting) + (orderless-skip-highlighting) + orderless-skip-highlighting))) (nconc - (orderless-highlight-matches pattern completions) + (if skip-highlighting + completions + (orderless-highlight-matches pattern completions)) (length prefix)))))) ;;;###autoload |
