diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-17 08:30:48 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-17 08:30:48 -0400 |
commit | ef501ef01cd3d3168da15cf5426f1be119fc90c8 (patch) | |
tree | 8acda749c457612f378f085ea87b0774cfac3128 | |
parent | b7ffe0402bda8231943066a1ce34e60b3dfdb6e7 (diff) | |
download | emacs-ef501ef01cd3d3168da15cf5426f1be119fc90c8.tar.gz |
* lisp/emacs-lisp/elint.el (elint-find-args-in-code):
Use help-function-arglist, so as to handle lexical byte-code.
-rw-r--r-- | lisp/ChangeLog | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/elint.el | 12 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1648aa3bea7..320da46f186 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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). diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index 55915813877..2ff0ace9f4c 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -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 |