comparison lisp/emacs-lisp/check-declare.el @ 87260:4cd2a938a117

(check-declare-verify): Handle deffoo.
author Glenn Morris <rgm@gnu.org>
date Tue, 11 Dec 2007 05:51:56 +0000
parents 885c9731dd1d
children b9e8ab94c460
comparison
equal deleted inserted replaced
87259:3f85433313d0 87260:4cd2a938a117
31 ;; The entry points are `check-declare-file' and `check-declare-directory'. 31 ;; The entry points are `check-declare-file' and `check-declare-directory'.
32 32
33 ;; For more information, see Info node `elisp(Declaring Functions)'. 33 ;; For more information, see Info node `elisp(Declaring Functions)'.
34 34
35 ;;; TODO: 35 ;;; TODO:
36
37 ;; 1. Warn about functions marked as obsolete, eg
38 ;; password-read-and-add in smime.el.
36 39
37 ;;; Code: 40 ;;; Code:
38 41
39 (defconst check-declare-warning-buffer "*Check Declarations Warnings*" 42 (defconst check-declare-warning-buffer "*Check Declarations Warnings*"
40 "Name of buffer used to display any `check-declare' warnings.") 43 "Name of buffer used to display any `check-declare' warnings.")
139 (with-temp-buffer 142 (with-temp-buffer
140 (insert-file-contents fnfile) 143 (insert-file-contents fnfile)
141 ;; defsubst's don't _have_ to be known at compile time. 144 ;; defsubst's don't _have_ to be known at compile time.
142 (setq re (format (if cflag 145 (setq re (format (if cflag
143 "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\"" 146 "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
144 "^[ \t]*(\\(fset[ \t]+'\\|def\\(?:un\\|subst\\|\ 147 "^[ \t]*(\\(fset[ \t]+'\\|\
148 def\\(?:un\\|subst\\|foo\\|\
145 ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\ 149 ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\
146 \\|\\(?:ine-obsolete-function-\\)?alias[ \t]+'\\)\\)\ 150 \\|\\(?:ine-obsolete-function-\\)?alias[ \t]+'\\)\\)\
147 \[ \t]*%s\\([ \t;]+\\|$\\)") 151 \[ \t]*%s\\([ \t;]+\\|$\\)")
148 (regexp-opt (mapcar 'cadr fnlist) t))) 152 (regexp-opt (mapcar 'cadr fnlist) t)))
149 (while (re-search-forward re nil t) 153 (while (re-search-forward re nil t)