diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-05 19:55:17 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-03-05 19:56:19 +0100 |
| commit | 66953e9fd23d9d9d6f5c931d41b8eb41dac6dd8d (patch) | |
| tree | d465c0530d27757ae0823f14b881ba24d356a966 | |
| parent | 234c0397bcb976cf64026e9c4d385d5b214c562a (diff) | |
orderless-kwd: Shorten lines
| -rw-r--r-- | orderless-kwd.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/orderless-kwd.el b/orderless-kwd.el index 9d94b8b..8560d9b 100644 --- a/orderless-kwd.el +++ b/orderless-kwd.el @@ -91,7 +91,8 @@ as a flag and does not require input." (defun orderless-kwd-group (pred regexp) "Match candidate group title against PRED and REGEXP." - (when-let ((fun (completion-metadata-get (orderless--metadata) 'group-function))) + (when-let ((fun (completion-metadata-get (orderless--metadata) + 'group-function))) (lambda (str) (orderless--match-p pred regexp (funcall fun str nil))))) @@ -126,8 +127,9 @@ as a flag and does not require input." (when-let ((sym (intern-soft str)) ((fboundp sym)) (keys (with-current-buffer buf (where-is-internal sym)))) - (cl-loop for key in keys - thereis (orderless--match-p pred regexp (key-description key))))))) + (cl-loop + for key in keys + thereis (orderless--match-p pred regexp (key-description key))))))) (defun orderless-kwd-value (pred regexp) "Match variable value against PRED and REGEXP." @@ -170,8 +172,9 @@ as a flag and does not require input." (when-let ((buf (orderless-kwd--get-buffer str)) (mode (buffer-local-value 'major-mode buf))) (or (orderless--match-p pred regexp (symbol-name mode)) - (orderless--match-p pred regexp (format-mode-line - (buffer-local-value 'mode-name buf))))))) + (orderless--match-p + pred regexp + (format-mode-line (buffer-local-value 'mode-name buf))))))) (defun orderless-kwd-directory (pred regexp) "Match `default-directory' against PRED and REGEXP." @@ -183,10 +186,12 @@ as a flag and does not require input." ;;;###autoload (defun orderless-kwd-dispatch (component _index _total) "Match COMPONENT against the keywords in `orderless-kwd-alist'." - (when (and (not (equal component "")) (= (aref component 0) orderless-kwd-prefix)) + (when (and (not (equal component "")) + (= (aref component 0) orderless-kwd-prefix)) (if-let ((len (length component)) - (pos (or (string-match-p (rx-to-string `(any ,orderless-kwd-separator)) - component 1) + (pos (or (string-match-p + (rx-to-string `(any ,orderless-kwd-separator)) + component 1) len)) (sym (intern-soft (substring component 1 pos))) (style (alist-get sym orderless-kwd-alist)) |
