summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/check-declare.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/check-declare.el')
-rw-r--r--lisp/emacs-lisp/check-declare.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index c4370e7ee8c..3135b9b5827 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -1,6 +1,6 @@
;;; check-declare.el --- Check declare-function statements
-;; Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2012 Free Software Foundation, Inc.
;; Author: Glenn Morris <rgm@gnu.org>
;; Keywords: lisp, tools, maint
@@ -88,9 +88,11 @@ don't know how to recognize (e.g. some macros)."
;; FIXME we could theoretically be inside a string.
(while (re-search-forward "^[ \t]*\\((declare-function\\)[ \t\n]" nil t)
(goto-char (match-beginning 1))
- (if (and (setq form (ignore-errors (read (current-buffer)))
- len (length form))
- (> len 2) (< len 6)
+ (if (and (setq form (ignore-errors (read (current-buffer))))
+ ;; Exclude element of byte-compile-initial-macro-environment.
+ (or (listp (cdr form)) (setq form nil))
+ (> (setq len (length form)) 2)
+ (< len 6)
(symbolp (setq fn (cadr form)))
(setq fn (symbol-name fn)) ; later we use as a search string
(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))))
(setq alist (cons (list fnfile fn arglist fileonly) alist))
;; FIXME make this more noticeable.
- (message "Malformed declaration for `%s'" (cadr form)))))
+ (if form (message "Malformed declaration for `%s'" (cadr form))))))
(message "%sdone" m)
alist))
@@ -314,5 +316,4 @@ Returns non-nil if any false statements are found."
(provide 'check-declare)
-;; arch-tag: a4d6cdc4-deb7-4502-b327-0e4ef3d82d96
;;; check-declare.el ends here.