From f61769dd3a29307017f990fc573431c9abebb0d5 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 17 Jan 2021 19:38:27 +0000 Subject: [PATCH] * dash.el (dash--keywords): Prefer rx. --- dash.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dash.el b/dash.el index edbb357..66fa4a2 100644 --- a/dash.el +++ b/dash.el @@ -2939,15 +2939,16 @@ structure such as plist or alist." (defvar dash--keywords `(;; TODO: Do not fontify the following automatic variables ;; globally; detect and limit to their local anaphoric scope. - (,(concat "\\_<" (regexp-opt '("acc" "it" "it-index" "other")) "\\_>") + (,(rx symbol-start (| "acc" "it" "it-index" "other") symbol-end) 0 font-lock-variable-name-face) ;; Macros in dev/examples.el. Based on `lisp-mode-symbol-regexp'. - (,(concat "(" (regexp-opt '("defexamples" "def-example-group") t) - "\\_>[\t ]+\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)*\\)") + (,(rx ?\( (group (| "defexamples" "def-example-group")) symbol-end + (+ (in "\t ")) + (group (* (| (syntax word) (syntax symbol) (: ?\\ nonl))))) (1 font-lock-keyword-face) (2 font-lock-function-name-face)) ;; Symbols in dev/examples.el. - ,(concat "\\_<" (regexp-opt '("=>" "~>" "!!>")) "\\_>") + ,(rx symbol-start (| "=>" "~>" "!!>") symbol-end) ;; Elisp macro fontification was static prior to Emacs 25. ,@(when (< emacs-major-version 25) (let ((macs '("!cdr"