emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/orderless c023ee1cbe 150/204: Add option to skip-highli


From: ELPA Syncer
Subject: [elpa] externals/orderless c023ee1cbe 150/204: Add option to skip-highlighting as requested by @clemera
Date: Tue, 11 Jan 2022 12:58:26 -0500 (EST)

branch: externals/orderless
commit c023ee1cbe2185ab984981d662ad63ce1c905ddb
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>

    Add option to skip-highlighting as requested by @clemera
---
 orderless.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/orderless.el b/orderless.el
index 0548e2c52f..4e6bcd1826 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]