changeset 41917:67cd4c7204bc

(lm-verify): New arg NON-FSF-OK. Don't use interactive-p; instead, pass the proper args in (interactive...). Clean up most of the trouble-report strings.
author Richard M. Stallman <rms@gnu.org>
date Sun, 09 Dec 2001 21:47:36 +0000
parents f0304f03fe6f
children 52fa3aece6f3
files lisp/emacs-lisp/lisp-mnt.el
diffstat 1 files changed, 32 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mnt.el	Sun Dec 09 21:31:54 2001 +0000
+++ b/lisp/emacs-lisp/lisp-mnt.el	Sun Dec 09 21:47:36 2001 +0000
@@ -47,6 +47,14 @@
 ;; 
 ;;    Format is three semicolons, followed by the filename, followed by
 ;; three dashes, followed by the summary.  All fields space-separated.
+;;
+;;    * A blank line
+;;
+;;    * Copyright line, which looks more or less like this:
+;;
+;;       ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+;;
+;;    * A blank line
 ;; 
 ;;    * Author line --- contains the name and net address of at least
 ;; the principal author.
@@ -417,15 +425,17 @@
   (move-to-column col t)
   (apply 'insert strings))
 
-(defun lm-verify (&optional file showok verb)
+(defun lm-verify (&optional file showok verbose non-fsf-ok)
   "Check that the current buffer (or FILE if given) is in proper format.
 If FILE is a directory, recurse on its files and generate a report in a
-temporary buffer.
-Optional argument SHOWOK indicates that \"OK\" be displayed in the temp buffer.
-Optional argument VERB specifies verbosity."
-  (interactive)
-  (let* ((verb (or verb (interactive-p)))
-	 (ret (and verb "Ok."))
+temporary buffer.  In that case, the optional argument SHOWOK
+says display \"OK\" in temp buffer for files that have no problems.
+
+Optional argument VERBOSE specifies verbosity level.
+Optional argument NON-FSF-OK if non-nil means a non-FSF
+copyright notice is allowed."
+  (interactive (list nil nil t))
+  (let* ((ret (and verbose "Ok"))
 	 name)
     (if (and file (file-directory-p file))
 	(setq ret
@@ -447,21 +457,21 @@
 	(setq ret
 	      (cond
 	       ((null name)
-		"Can't find a package NAME")
+		(format "Package %s does not exist"))
 	       ((not (lm-authors))
-		"Author: tag missing.")
+		"`Author:' tag missing")
 	       ((not (lm-maintainer))
-		"Maintainer: tag missing.")
+		"`Maintainer:' tag missing")
 	       ((not (lm-summary))
-		"Can't find a one-line 'Summary' description")
+		"Can't find the one-line summary description")
 	       ((not (lm-keywords))
-		"Keywords: tag missing.")
+		"`Keywords:' tag missing")
 	       ((not (lm-keywords-finder-p))
-		"Keywords: no valid finder keywords.")
+		"`Keywords:' has no valid finder keywords (see `finder-known-keywords')")
 	       ((not (lm-commentary-mark))
-		"Can't find a 'Commentary' section marker.")
+		"Can't find a 'Commentary' section marker")
 	       ((not (lm-history-mark))
-		"Can't find a 'History' section marker.")
+		"Can't find a 'History' section marker")
 	       ((not (lm-code-mark))
 		"Can't find a 'Code' section marker")
 	       ((progn
@@ -471,15 +481,16 @@
 		    (concat "^;;;[ \t]+" name "[ \t]+ends here[ \t]*$"
 			    "\\|^;;;[ \t]+ End of file[ \t]+" name)
 		    nil t)))
-		(format "Can't find a footer line for [%s]" name))
+		(format "Can't find a footer line"))
 	       ((not (and (lm-copyright-mark) (lm-crack-copyright)))
-		"Can't find a valid Copyright")
-	       ((not (string-match "Free Software Foundation"
-				   (car (lm-crack-copyright))))
-		"Copyright Holder is not the Free Software Foundation.")
+		"Can't find a valid copyright notice")
+	       ((not (or non-fsf-ok
+			 (string-match "Free Software Foundation"
+				       (car (lm-crack-copyright)))))
+		"Copyright holder is not the Free Software Foundation")
 	       (t
 		ret)))))
-    (if verb
+    (if verbose
 	(message ret))
     ret))