aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el53
1 files changed, 32 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 83521bae5f1..62a0f3216fe 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -47,6 +47,14 @@
47;; 47;;
48;; Format is three semicolons, followed by the filename, followed by 48;; Format is three semicolons, followed by the filename, followed by
49;; three dashes, followed by the summary. All fields space-separated. 49;; three dashes, followed by the summary. All fields space-separated.
50;;
51;; * A blank line
52;;
53;; * Copyright line, which looks more or less like this:
54;;
55;; ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
56;;
57;; * A blank line
50;; 58;;
51;; * Author line --- contains the name and net address of at least 59;; * Author line --- contains the name and net address of at least
52;; the principal author. 60;; the principal author.
@@ -417,15 +425,17 @@ tags `Code', `Change Log' or `History'."
417 (move-to-column col t) 425 (move-to-column col t)
418 (apply 'insert strings)) 426 (apply 'insert strings))
419 427
420(defun lm-verify (&optional file showok verb) 428(defun lm-verify (&optional file showok verbose non-fsf-ok)
421 "Check that the current buffer (or FILE if given) is in proper format. 429 "Check that the current buffer (or FILE if given) is in proper format.
422If FILE is a directory, recurse on its files and generate a report in a 430If FILE is a directory, recurse on its files and generate a report in a
423temporary buffer. 431temporary buffer. In that case, the optional argument SHOWOK
424Optional argument SHOWOK indicates that \"OK\" be displayed in the temp buffer. 432says display \"OK\" in temp buffer for files that have no problems.
425Optional argument VERB specifies verbosity." 433
426 (interactive) 434Optional argument VERBOSE specifies verbosity level.
427 (let* ((verb (or verb (interactive-p))) 435Optional argument NON-FSF-OK if non-nil means a non-FSF
428 (ret (and verb "Ok.")) 436copyright notice is allowed."
437 (interactive (list nil nil t))
438 (let* ((ret (and verbose "Ok"))
429 name) 439 name)
430 (if (and file (file-directory-p file)) 440 (if (and file (file-directory-p file))
431 (setq ret 441 (setq ret
@@ -447,21 +457,21 @@ Optional argument VERB specifies verbosity."
447 (setq ret 457 (setq ret
448 (cond 458 (cond
449 ((null name) 459 ((null name)
450 "Can't find a package NAME") 460 (format "Package %s does not exist"))
451 ((not (lm-authors)) 461 ((not (lm-authors))
452 "Author: tag missing.") 462 "`Author:' tag missing")
453 ((not (lm-maintainer)) 463 ((not (lm-maintainer))
454 "Maintainer: tag missing.") 464 "`Maintainer:' tag missing")
455 ((not (lm-summary)) 465 ((not (lm-summary))
456 "Can't find a one-line 'Summary' description") 466 "Can't find the one-line summary description")
457 ((not (lm-keywords)) 467 ((not (lm-keywords))
458 "Keywords: tag missing.") 468 "`Keywords:' tag missing")
459 ((not (lm-keywords-finder-p)) 469 ((not (lm-keywords-finder-p))
460 "Keywords: no valid finder keywords.") 470 "`Keywords:' has no valid finder keywords (see `finder-known-keywords')")
461 ((not (lm-commentary-mark)) 471 ((not (lm-commentary-mark))
462 "Can't find a 'Commentary' section marker.") 472 "Can't find a 'Commentary' section marker")
463 ((not (lm-history-mark)) 473 ((not (lm-history-mark))
464 "Can't find a 'History' section marker.") 474 "Can't find a 'History' section marker")
465 ((not (lm-code-mark)) 475 ((not (lm-code-mark))
466 "Can't find a 'Code' section marker") 476 "Can't find a 'Code' section marker")
467 ((progn 477 ((progn
@@ -471,15 +481,16 @@ Optional argument VERB specifies verbosity."
471 (concat "^;;;[ \t]+" name "[ \t]+ends here[ \t]*$" 481 (concat "^;;;[ \t]+" name "[ \t]+ends here[ \t]*$"
472 "\\|^;;;[ \t]+ End of file[ \t]+" name) 482 "\\|^;;;[ \t]+ End of file[ \t]+" name)
473 nil t))) 483 nil t)))
474 (format "Can't find a footer line for [%s]" name)) 484 (format "Can't find a footer line"))
475 ((not (and (lm-copyright-mark) (lm-crack-copyright))) 485 ((not (and (lm-copyright-mark) (lm-crack-copyright)))
476 "Can't find a valid Copyright") 486 "Can't find a valid copyright notice")
477 ((not (string-match "Free Software Foundation" 487 ((not (or non-fsf-ok
478 (car (lm-crack-copyright)))) 488 (string-match "Free Software Foundation"
479 "Copyright Holder is not the Free Software Foundation.") 489 (car (lm-crack-copyright)))))
490 "Copyright holder is not the Free Software Foundation")
480 (t 491 (t
481 ret))))) 492 ret)))))
482 (if verb 493 (if verbose
483 (message ret)) 494 (message ret))
484 ret)) 495 ret))
485 496