emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109123: * lisp/emacs-lisp/elint.el (


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109123: * lisp/emacs-lisp/elint.el (elint-find-args-in-code):
Date: Tue, 17 Jul 2012 08:30:48 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109123
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2012-07-17 08:30:48 -0400
message:
  * lisp/emacs-lisp/elint.el (elint-find-args-in-code):
  Use help-function-arglist, so as to handle lexical byte-code.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/elint.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-07-17 11:52:00 +0000
+++ b/lisp/ChangeLog    2012-07-17 12:30:48 +0000
@@ -1,5 +1,8 @@
 2012-07-17  Stefan Monnier  <address@hidden>
 
+       * 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).
 

=== modified file 'lisp/emacs-lisp/elint.el'
--- a/lisp/emacs-lisp/elint.el  2012-07-11 23:13:41 +0000
+++ b/lisp/emacs-lisp/elint.el  2012-07-17 12:30:48 +0000
@@ -46,6 +46,8 @@
 
 ;;; Code:
 
+(require 'help-fns)
+
 (defgroup elint nil
   "Linting for Emacs Lisp."
   :prefix "elint-"
@@ -713,14 +715,8 @@
 (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


reply via email to

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