branch: externals/relint
commit 956a15bb375be2db21ce53541baf840d819761fb
Author: Mattias Engdegård <[email protected]>
Commit: Mattias Engdegård <[email protected]>

    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