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

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

[elpa] externals/orderless c51037b8ef 024/204: Add custom variable for c


From: ELPA Syncer
Subject: [elpa] externals/orderless c51037b8ef 024/204: Add custom variable for component separator regexp
Date: Tue, 11 Jan 2022 12:58:14 -0500 (EST)

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

    Add custom variable for component separator regexp
---
 orderless.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/orderless.el b/orderless.el
index 9ad70efcf1..306e11357f 100644
--- a/orderless.el
+++ b/orderless.el
@@ -67,6 +67,15 @@
   "Face for maches of components numbered 3 mod 4."
   :group 'orderless)
 
+(defcustom orderless-regexp-separator " +"
+  "Regexp to match component separators for orderless completion.
+This is passed to `split-string' to divide the pattern into
+component regexps."
+  :type '(choice (const :tag "Spaces" " +")
+                 (const :tag "Spaces, hyphen or slash" " +\\|[-/]")
+                 (regexp :tag "Custom regexp"))
+  :group 'orderless)
+
 (let ((faces [orderless-match-face-0
               orderless-match-face-1
               orderless-match-face-2
@@ -85,7 +94,9 @@
     (let* ((limit (car (completion-boundaries string table pred "")))
            (prefix (substring string 0 limit))
            (all (all-completions prefix table pred))
-           (regexps (split-string (substring string limit))))
+           (regexps (split-string (substring string limit)
+                                  orderless-regexp-separator
+                                  t)))
       (when minibuffer-completing-file-name
         (setq all (completion-pcm--filename-try-filter all)))
       (condition-case nil



reply via email to

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