comparison lisp/emacs-lisp/check-declare.el @ 96696:b4b1fe2990a7

(check-declare-locate, check-declare-verify): Handle .m files.
author Glenn Morris <rgm@gnu.org>
date Wed, 16 Jul 2008 02:25:40 +0000
parents 90a2847062be
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
96695:98ae99a5a007 96696:b4b1fe2990a7
40 (defconst check-declare-warning-buffer "*Check Declarations Warnings*" 40 (defconst check-declare-warning-buffer "*Check Declarations Warnings*"
41 "Name of buffer used to display any `check-declare' warnings.") 41 "Name of buffer used to display any `check-declare' warnings.")
42 42
43 (defun check-declare-locate (file basefile) 43 (defun check-declare-locate (file basefile)
44 "Return the full path of FILE. 44 "Return the full path of FILE.
45 Expands files with a \".c\" extension relative to the Emacs 45 Expands files with a \".c\" or \".m\" extension relative to the Emacs
46 \"src/\" directory. Otherwise, `locate-library' searches for FILE. 46 \"src/\" directory. Otherwise, `locate-library' searches for FILE.
47 If that fails, expands FILE relative to BASEFILE's directory part. 47 If that fails, expands FILE relative to BASEFILE's directory part.
48 The returned file might not exist. If FILE has an \"ext:\" prefix, so does 48 The returned file might not exist. If FILE has an \"ext:\" prefix, so does
49 the result." 49 the result."
50 (let ((ext (string-match "^ext:" file)) 50 (let ((ext (string-match "^ext:" file))
51 tfile) 51 tfile)
52 (if ext 52 (if ext
53 (setq file (substring file 4))) 53 (setq file (substring file 4)))
54 (setq file 54 (setq file
55 (if (string-equal "c" (file-name-extension file)) 55 (if (member (file-name-extension file) '("c" "m"))
56 (expand-file-name file (expand-file-name "src" source-directory)) 56 (expand-file-name file (expand-file-name "src" source-directory))
57 (if (setq tfile (locate-library (file-name-nondirectory file))) 57 (if (setq tfile (locate-library (file-name-nondirectory file)))
58 (progn 58 (progn
59 (setq tfile 59 (setq tfile
60 (replace-regexp-in-string "\\.elc\\'" ".el" tfile)) 60 (replace-regexp-in-string "\\.elc\\'" ".el" tfile))
128 128
129 Returns nil if all claims are found to be true, otherwise a list 129 Returns nil if all claims are found to be true, otherwise a list
130 of errors with elements of the form \(FILE FN TYPE), where TYPE 130 of errors with elements of the form \(FILE FN TYPE), where TYPE
131 is a string giving details of the error." 131 is a string giving details of the error."
132 (let ((m (format "Checking %s..." fnfile)) 132 (let ((m (format "Checking %s..." fnfile))
133 (cflag (string-equal "c" (file-name-extension fnfile))) 133 (cflag (member (file-name-extension fnfile) '("c" "m")))
134 (ext (string-match "^ext:" fnfile)) 134 (ext (string-match "^ext:" fnfile))
135 re fn sig siglist arglist type errlist minargs maxargs) 135 re fn sig siglist arglist type errlist minargs maxargs)
136 (message "%s" m) 136 (message "%s" m)
137 (if ext 137 (if ext
138 (setq fnfile (substring fnfile 4))) 138 (setq fnfile (substring fnfile 4)))