diff options
| author | Omar Antolín <omar.antolin@gmail.com> | 2020-04-28 09:31:22 -0500 |
|---|---|---|
| committer | Omar Antolín <omar.antolin@gmail.com> | 2020-04-28 09:31:22 -0500 |
| commit | bf91e1d8a2214febbdaf3b539669aadcd6c30575 (patch) | |
| tree | bda0c1def9889f07b36b6d8f99bbf5f40eb52fbf | |
| parent | 5897841be41f2864de34461aa68270b87a96ad5d (diff) | |
Name sections of code
| -rw-r--r-- | orderless.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/orderless.el b/orderless.el index 504b422..2223632 100644 --- a/orderless.el +++ b/orderless.el @@ -190,6 +190,8 @@ This is simply the identity function.") "Match a component as a literal string. This is simply `regexp-quote'.") +;;; Matching styles + (defun orderless--separated-by (sep rxs &optional before after) "Return a regexp to match the rx-regexps RXS with SEP in between. If BEFORE is specified, add it to the beginning of the rx @@ -264,6 +266,8 @@ at a word boundary in the candidate. This is similar to the (cl-loop for prefix in (split-string component "\\>" t) collect `(seq word-boundary ,prefix)))) +;;; Highlighting matches + (defun orderless--highlight (regexps string) "Propertize STRING to highlight a match of each of the REGEXPS. Warning: only use this if you know all REGEXPs match!" @@ -291,6 +295,8 @@ converted to a list of regexps according to the value of for string = (copy-sequence original) collect (orderless--highlight regexps string))) +;;; Compiling patterns to lists of regexps + (defun orderless-default-pattern-compiler (pattern) "Build regexps to match the components of PATTERN. Split PATTERN on `orderless-component-separator' and consult @@ -322,6 +328,8 @@ This is the default value of `orderless-pattern-compiler'." ,@(cl-loop for style in styles collect `(regexp ,(funcall style component))))))))) +;;; Completion style implementation + (defun orderless--prefix+pattern (string table pred) "Split STRING into prefix and pattern according to TABLE. The predicate PRED is used to constrain the entries in TABLE." @@ -380,6 +388,8 @@ This function is part of the `orderless' completion style." orderless-try-completion orderless-all-completions "Completion of multiple components, in any order.")) +;;; Temporary separator change (does anyone use this?) + (defvar orderless-old-component-separator nil "Stores the old value of `orderless-component-separator'.") @@ -400,7 +410,7 @@ This function is part of the `orderless' completion style." (setq orderless-component-separator separator) (add-to-list 'minibuffer-exit-hook #'orderless--restore-component-separator)) -;;; ivy integration +;;; Ivy integration (defvar ivy-regex) (defvar ivy-highlight-functions-alist) |
