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

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

[elpa] externals/relint 956a15b 17/23: Fix defun parsing


From: Mattias Engdegård
Subject: [elpa] externals/relint 956a15b 17/23: Fix defun parsing
Date: Sun, 29 Sep 2019 15:34:53 -0400 (EDT)

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

    Fix defun parsing
    
    Previously, a function returning a string literal wouldn't have any
    body at all.
---
 relint.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/relint.el b/relint.el
index d22b93c..596c0fc 100644
--- a/relint.el
+++ b/relint.el
@@ -1037,11 +1037,14 @@ character alternative: `[' followed by a 
regexp-generating expression."
     (`(,(or 'defun 'defmacro 'defsubst)
        ,name ,args . ,body)
 
+     ;; Skip doc string.
+     (when (stringp (car body))
+       (setq body (cdr body)))
+     ;; Skip declarations.
+     (while (and (consp (car body))
+                 (memq (caar body) '(interactive declare)))
+       (setq body (cdr body)))
      ;; Save the function or macro for possible use.
-     (while (or (stringp (car body))
-                (and (consp (car body))
-                     (memq (caar body) '(interactive declare))))
-       (setq body (cdr body)))          ; Skip doc and declarations.
      (push (list name args body)
            (if (eq (car form) 'defmacro)
                relint--macro-defs



reply via email to

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