[Top][All Lists]

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

[elpa] externals/relint 88ccc9c 2/9: Stronger regexp-generating variable

From: Mattias Engdegård
Subject: [elpa] externals/relint 88ccc9c 2/9: Stronger regexp-generating variable check
Date: Sat, 13 Apr 2019 12:51:29 -0400 (EDT)

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

    Stronger regexp-generating variable check
    If the variable contents do not reveal anything, look at the name.
 relint.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/relint.el b/relint.el
index 0d3a2f6..4db34d5 100644
--- a/relint.el
+++ b/relint.el
@@ -731,9 +731,10 @@
    ((symbolp expr)
     (and (not (memq expr '(nil t)))
-         (let ((def (assq expr relint--variables)))
-           (if def
-               (relint--regexp-generators (cdr def) expanded)
+         ;; Check both variable contents and name.
+         (or (let ((def (assq expr relint--variables)))
+               (and def
+                    (relint--regexp-generators (cdr def) expanded)))
              (and (or (memq expr '(page-delimiter paragraph-separate
                                    paragraph-start sentence-end))
                       ;; This is guesswork, but effective.
@@ -742,7 +743,7 @@
                                (or "-regexp" "-regex" "-re"))
                        (symbol-name expr)))
-                  (list expr))))))
+                  (list expr)))))
    ((atom expr) nil)
    ((memq (car expr) '(regexp-quote regexp-opt regexp-opt-charset
                        rx rx-to-string wildcard-to-regexp read-regexp

reply via email to

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