From a89ac17b41f993d90cf341ec350efca403e752f2 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Fri, 16 Feb 2024 06:48:27 +0100 Subject: orderless-affix-dispatch: Ignore single dispatcher character --- orderless.el | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/orderless.el b/orderless.el index e2ad552..056dd3a 100644 --- a/orderless.el +++ b/orderless.el @@ -161,12 +161,10 @@ as a key in `orderless-affix-dispatch-alist', then that character is removed and the remainder of the COMPONENT is matched in the style associated to the character." (cond - ;; Ignore single without-literal dispatcher - ((and (= (length component) 1) - (equal (aref component 0) - (car (rassq #'orderless-without-literal - orderless-affix-dispatch-alist)))) - '(orderless-literal . "")) + ;; Ignore single dispatcher character + ((and (= (length component) 1) (alist-get (aref component 0) + orderless-affix-dispatch-alist)) + #'ignore) ;; Prefix ((when-let ((style (alist-get (aref component 0) orderless-affix-dispatch-alist))) @@ -276,15 +274,13 @@ regexp." (defun orderless-without (component) "Match strings that do *not* match COMPONENT." - (unless (equal component "") - (let ((regexp (cdr (orderless--component-compiler component)))) - (lambda (str) - (not (string-match-p regexp str)))))) + (let ((regexp (cdr (orderless--compile-component component)))) + (lambda (str) + (not (string-match-p regexp str))))) (defun orderless-annotation (component) "Match candidates where the annotation matches COMPONENT." - (when-let (((not (equal component ""))) - ((minibufferp)) + (when-let (((minibufferp)) (table minibuffer-completion-table) (metadata (completion-metadata (buffer-substring-no-properties (minibuffer-prompt-end) (point)) -- cgit v1.0