emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/relint 1dc96b5 05/10: Make font-lock-keywords errors ea


From: Mattias Engdegård
Subject: [elpa] externals/relint 1dc96b5 05/10: Make font-lock-keywords errors easier to find
Date: Sun, 4 Aug 2019 13:42:47 -0400 (EDT)

branch: externals/relint
commit 1dc96b5bb65a84385fddddc80768e2ca3ef5a37b
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>

    Make font-lock-keywords errors easier to find
    
    At least in the (rare) case when the cdr is a symbol.
---
 relint.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/relint.el b/relint.el
index 93149c2..76b2405 100644
--- a/relint.el
+++ b/relint.el
@@ -759,7 +759,17 @@ evaluated are nil."
 
 
 (defun relint--check-font-lock-keywords (form name file pos path)
-  (relint--check-list-any form name file pos path))
+  "Check a font-lock-keywords list.  A regexp can be found in an element,
+or in the car of an element."
+  (dolist (elem (relint--get-list form file pos path))
+    (cond
+     ((stringp elem)
+      (relint--check-re-string elem name file pos path))
+     ((and (consp elem)
+           (stringp (car elem)))
+      (let* ((tag (and (symbolp (cdr elem)) (cdr elem)))
+             (ident (if tag (format "%s (%s)" name tag) name)))
+        (relint--check-re-string (car elem) ident file pos path))))))
 
 (defun relint--check-compilation-error-regexp-alist-alist (form name
                                                            file pos path)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]