diff options
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/lisp/init-completion.el | 14 |
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~ |