;;; check-declare.el --- Check declare-function statements
-;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
;; Author: Glenn Morris <rgm@gnu.org>
;; Keywords: lisp, tools, maint
(stringp (setq fnfile (nth 2 form)))
(setq fnfile (check-declare-locate fnfile
(expand-file-name file)))
- ;; Use `t' to distinguish unspecified arglist from empty one.
+ ;; Use t to distinguish unspecified arglist from empty one.
(or (eq t (setq arglist (if (> len 3)
(nth 3 form)
t)))
(defcustom check-declare-ext-errors nil
"When non-nil, warn about functions not found in :ext."
+ :version "25.1"
:type 'boolean)
(defun check-declare-verify (fnfile fnlist)
(setq re (format (if cflag
"^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
"^[ \t]*(\\(fset[ \t]+'\\|\
+cl-def\\(?:generic\\|method\\)\\|\
def\\(?:un\\|subst\\|foo\\|method\\|class\\|\
ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\\|\
\\(?:ine-obsolete-function-\\)?alias[ \t]+'\\|\
ine-overloadable-function\\)\\)\
-\[ \t]*%s\\([ \t;]+\\|$\\)")
+[ \t]*%s\\([ \t;]+\\|$\\)")
(regexp-opt (mapcar 'cadr fnlist) t)))
(while (re-search-forward re nil t)
(skip-chars-forward " \t\n")
type)
'obsolete)
;; Can't easily check arguments in these cases.
- ((string-match "\\`\\(def\\(alias\\|\
-method\\|class\\)\\|fset\\)\\>" type)
+ ((string-match "\\`\\(def\\(alias\\|class\\)\\|\
+fset\\|\\(?:cl-\\)?defmethod\\)\\>" type)
t)
((looking-at "\\((\\|nil\\)")
(byte-compile-arglist-signature
entry))
(warning-fill-prefix " "))
(display-warning 'check-declare
- (format "%s said `%s' was defined in %s: %s"
- (file-name-nondirectory file) fn
- (file-name-nondirectory fnfile)
- type)
+ (format-message "said `%s' was defined in %s: %s"
+ fn (file-name-nondirectory fnfile) type)
nil check-declare-warning-buffer)))
(declare-function compilation-forget-errors "compile" ())
errlist files)
(message "%s" m)
(message "%s" m2)
- (setq files (process-lines find-program root
+ (setq files (process-lines grep-find-program root
"-name" "*.el"
"-exec" grep-program
"-l" "^[ \t]*(declare-function" "{}" ";"))