]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/elint.el (elint-find-args-in-code):
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 17 Jul 2012 12:30:48 +0000 (08:30 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 17 Jul 2012 12:30:48 +0000 (08:30 -0400)
Use help-function-arglist, so as to handle lexical byte-code.

lisp/ChangeLog
lisp/emacs-lisp/elint.el

index 1648aa3bea7a3073628b3bb7983f5d806e1b4215..320da46f1861267066797d2782898e1d3864b944 100644 (file)
@@ -1,5 +1,8 @@
 2012-07-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/elint.el (elint-find-args-in-code):
+       Use help-function-arglist, so as to handle lexical byte-code.
+
        * progmodes/sh-script.el (sh-syntax-propertize-function): Fix last
        change (bug#11826).
 
index 559158138778d192eedd37765aacb4959e73b48d..2ff0ace9f4c7cc611f23ffb6f5fea523a1685201 100644 (file)
@@ -46,6 +46,8 @@
 
 ;;; Code:
 
+(require 'help-fns)
+
 (defgroup elint nil
   "Linting for Emacs Lisp."
   :prefix "elint-"
@@ -713,14 +715,8 @@ Returns `unknown' if we couldn't find arguments."
 (defun elint-find-args-in-code (code)
   "Extract the arguments from CODE.
 CODE can be a lambda expression, a macro, or byte-compiled code."
-  (cond
-   ((byte-code-function-p code)
-    (aref code 0))
-   ((and (listp code) (eq (car code) 'lambda))
-    (car (cdr code)))
-   ((and (listp code) (eq (car code) 'macro))
-    (elint-find-args-in-code (cdr code)))
-   (t 'unknown)))
+  (let ((args (help-function-arglist code)))
+    (if (listp args) args 'unknown)))
 
 ;;;
 ;;; Functions to check some special forms