]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/check-declare.el
* prolog.el: Fix indentation of empty line
[gnu-emacs] / lisp / emacs-lisp / check-declare.el
index 8fc299d7e938d07a8944c1eef624992c71ebfca6..536e4186c412aeac0834b75f94ca8ec51d8e7690 100644 (file)
@@ -98,7 +98,7 @@ don't know how to recognize (e.g. some macros)."
                  (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)))
@@ -157,11 +157,12 @@ is a string giving details of the error."
           (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")
@@ -200,8 +201,8 @@ ine-overloadable-function\\)\\)\
                               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
@@ -278,12 +279,12 @@ TYPE is a string giving the nature of the error.  Warning is displayed in
            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" ())
+
 (defun check-declare-files (&rest files)
   "Check veracity of all `declare-function' statements in FILES.
 Return a list of any errors found."