about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-09-16 12:35:05 +0100
committerDavid Morgan <djm_uk@protonmail.com>2022-09-16 12:35:05 +0100
commite18c8297b99cae5c9639eaf4dc6c4efb37cf8743 (patch)
treef8354c7e0832b045fc3f3ee136f5027df590d552
parentfbae1e4c5ae7bb049aa25139e602d25600487649 (diff)
downloaddotfiles-e18c8297b99cae5c9639eaf4dc6c4efb37cf8743.tar.gz
Add orderless-strict-initialism
-rw-r--r--.emacs.d/lisp/init-completion.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/.emacs.d/lisp/init-completion.el b/.emacs.d/lisp/init-completion.el
index 3407905..b03c391 100644
--- a/.emacs.d/lisp/init-completion.el
+++ b/.emacs.d/lisp/init-completion.el
@@ -67,14 +67,22 @@
     (setq-local orderless-matching-styles '(orderless-literal)
                 orderless-style-dispatchers nil))
   :config
-  (defun orderless-strict-leading-initialism (component)
+  (defun orderless-strict-initialism (component &optional leading)
     "Match a component as a strict leading initialism.
 This means the characters in COMPONENT must occur in the
 candidate, in that order, at the beginning of words, with
-no words in between, beginning with the first word."
+no words in between. If LEADING is non-nil, anchor to the
+first word."
     (orderless--separated-by '(seq (zero-or-more word) (zero-or-more punct))
       (cl-loop for char across component collect `(seq word-start ,char))
-      '(seq string-start)))
+      (when leading '(seq buffer-start))))
+
+  (defun orderless-strict-leading-initialism (component)
+    "Match a component as a strict leading initialism.
+This means the characters in COMPONENT must occur in the
+candidate, in that order, at the beginning of words, with
+no words in between, beginning with the first word."
+    (orderless-strict-initialism component t))
 
   ;; Recognizes the following patterns:
   ;; * ~flex flex~
>1 2 3 4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24



                                                                               

                                                                           
 


                                                                         

                                                                               



                            
 




                         
 
                   
6' href='#n26'>26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45