summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2007-11-19 00:09:20 +0000
committerGlenn Morris <rgm@gnu.org>2007-11-19 00:09:20 +0000
commitf3a4724d5c6597e5722761a83d313565256eb6c7 (patch)
tree746af0c28cd35aa2205eaad16aea9d0bf6420f5d /lisp/emacs-lisp
parentb581d2ea49dcee6b92b264bca07dbec64faaa550 (diff)
downloademacs-f3a4724d5c6597e5722761a83d313565256eb6c7.tar.gz
emacs-f3a4724d5c6597e5722761a83d313565256eb6c7.tar.bz2
emacs-f3a4724d5c6597e5722761a83d313565256eb6c7.zip
(check-declare-verify): If fnfile does not exist, try adding `.el'
extension. Also search for defsubsts.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/check-declare.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index e0d9601f4b4..0b78da165db 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -30,6 +30,10 @@
;; checks that all such statements in a file or directory are accurate.
;; The entry points are `check-declare-file' and `check-declare-directory'.
+;;; TODO:
+
+;; 1. Handle defstructs (eg uniquify-item-base in desktop.el).
+
;;; Code:
(defconst check-declare-warning-buffer "*Check Declarations Warnings*"
@@ -76,14 +80,17 @@ found to be true, otherwise a list of errors with elements of the form
(let ((m (format "Checking %s..." fnfile))
re fn sig siglist arglist type errlist)
(message "%s" m)
+ (or (file-exists-p fnfile)
+ (setq fnfile (concat fnfile ".el")))
(if (file-exists-p fnfile)
(with-temp-buffer
(insert-file-contents fnfile)
- (setq re (format "^[ \t]*(defun[ \t]+%s\\>"
+ ;; defsubst's don't _have_ to be known at compile time.
+ (setq re (format "^[ \t]*(def\\(un\\|subst\\)[ \t]+%s\\>"
(regexp-opt (mapcar 'cadr fnlist) t)))
(while (re-search-forward re nil t)
(skip-chars-forward " \t\n")
- (setq fn (match-string 1)
+ (setq fn (match-string 2)
sig (if (looking-at "\\((\\|nil\\)")
(byte-compile-arglist-signature
(read (current-buffer))))