]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/check-declare.el
Use 'grep-find-program' in check-declare.el
[gnu-emacs] / lisp / emacs-lisp / check-declare.el
index 2c2f68482a9410feb646a686e372bdd03f80f705..b8a00b3fb4e3ac92b5cfc166932dcee53acd43e7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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
@@ -106,7 +106,7 @@ don't know how to recognize (e.g. some macros)."
                  (symbolp (setq fileonly (nth 4 form))))
             (setq alist (cons (list fnfile fn arglist fileonly) alist))
           ;; FIXME make this more noticeable.
-          (if form (message "Malformed declaration for ‘%s’" (cadr form))))))
+          (if form (message "Malformed declaration for `%s'" (cadr form))))))
     (message "%sdone" m)
     alist))
 
@@ -131,6 +131,7 @@ With optional argument FULL, sums the number of elements in each element."
 
 (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)
@@ -162,7 +163,7 @@ 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")
@@ -279,8 +280,8 @@ TYPE is a string giving the nature of the error.  Warning is displayed in
            entry))
         (warning-fill-prefix "    "))
     (display-warning 'check-declare
-                     (format "said ‘%s’ was defined in %s: %s"
-                             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" ())
@@ -318,7 +319,7 @@ Return a list of any errors found."
 See `check-declare-directory' for more information."
   (interactive "fFile to check: ")
   (or (file-exists-p file)
-      (error "File ‘%s’ not found" file))
+      (error "File `%s' not found" file))
   (let ((m (format "Checking %s..." file))
         errlist)
     (message "%s" m)
@@ -332,13 +333,13 @@ See `check-declare-directory' for more information."
 Returns non-nil if any false statements are found."
   (interactive "DDirectory to check: ")
   (or (file-directory-p (setq root (expand-file-name root)))
-      (error "Directory ‘%s’ not found" root))
-  (let ((m "Checking ‘declare-function’ statements...")
+      (error "Directory `%s' not found" root))
+  (let ((m "Checking `declare-function' statements...")
         (m2 "Finding files with declarations...")
         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" "{}" ";"))