Small check-declare fix.

* lisp/emacs-lisp/check-declare.el (check-declare-scan):
Handle byte-compile-initial-macro-environment in bytecomp.el
This commit is contained in:
Glenn Morris 2011-05-04 23:27:24 -07:00
parent 40c67c6dee
commit 0bff894fc1
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2011-05-05 Glenn Morris <rgm@gnu.org>
* emacs-lisp/check-declare.el (check-declare-scan):
Handle byte-compile-initial-macro-environment in bytecomp.el
2011-05-05 Stefan Monnier <monnier@iro.umontreal.ca> 2011-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
Fix earlier half-done eieio-defmethod change (bug#8338). Fix earlier half-done eieio-defmethod change (bug#8338).

View file

@ -88,9 +88,11 @@ don't know how to recognize (e.g. some macros)."
;; FIXME we could theoretically be inside a string. ;; FIXME we could theoretically be inside a string.
(while (re-search-forward "^[ \t]*\\((declare-function\\)[ \t\n]" nil t) (while (re-search-forward "^[ \t]*\\((declare-function\\)[ \t\n]" nil t)
(goto-char (match-beginning 1)) (goto-char (match-beginning 1))
(if (and (setq form (ignore-errors (read (current-buffer))) (if (and (setq form (ignore-errors (read (current-buffer))))
len (length form)) ;; Exclude element of byte-compile-initial-macro-environment.
(> len 2) (< len 6) (or (listp (cdr form)) (setq form nil))
(> (setq len (length form)) 2)
(< len 6)
(symbolp (setq fn (cadr form))) (symbolp (setq fn (cadr form)))
(setq fn (symbol-name fn)) ; later we use as a search string (setq fn (symbol-name fn)) ; later we use as a search string
(stringp (setq fnfile (nth 2 form))) (stringp (setq fnfile (nth 2 form)))
@ -104,7 +106,7 @@ don't know how to recognize (e.g. some macros)."
(symbolp (setq fileonly (nth 4 form)))) (symbolp (setq fileonly (nth 4 form))))
(setq alist (cons (list fnfile fn arglist fileonly) alist)) (setq alist (cons (list fnfile fn arglist fileonly) alist))
;; FIXME make this more noticeable. ;; FIXME make this more noticeable.
(message "Malformed declaration for `%s'" (cadr form))))) (if form (message "Malformed declaration for `%s'" (cadr form))))))
(message "%sdone" m) (message "%sdone" m)
alist)) alist))