]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/checkdoc.el
* emacs-lisp/checkdoc.el (checkdoc-file-comments-engine): Insert
[gnu-emacs] / lisp / emacs-lisp / checkdoc.el
index 913ffcf19418fe57d081df10eed955824bcfb376..666b373ca5399e16da349eac905506d97e352592 100644 (file)
@@ -1,7 +1,7 @@
 ;;; checkdoc.el --- check documentation strings for style requirements
 
 ;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004,
-;;   2005 Free Software Foundation, Inc.
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 0.6.2
 (defvar compilation-error-regexp-alist)
 (defvar compilation-mode-font-lock-keywords)
 
+(defgroup checkdoc nil
+  "Support for doc string checking in Emacs Lisp."
+  :prefix "checkdoc"
+  :group 'lisp
+  :version "20.3")
+
 (defcustom checkdoc-autofix-flag 'semiautomatic
-  "*Non-nil means attempt auto-fixing of doc strings.
+  "Non-nil means attempt auto-fixing of doc strings.
 If this value is the symbol `query', then the user is queried before
 any change is made.  If the value is `automatic', then all changes are
 made without asking unless the change is very-complex.  If the value
@@ -208,37 +214,39 @@ The value `never' is the same as nil, never ask or change anything."
                 (other :tag "semiautomatic" semiautomatic)))
 
 (defcustom checkdoc-bouncy-flag t
-  "*Non-nil means to \"bounce\" to auto-fix locations.
+  "Non-nil means to \"bounce\" to auto-fix locations.
 Setting this to nil will silently make fixes that require no user
 interaction.  See `checkdoc-autofix-flag' for auto-fixing details."
   :group 'checkdoc
   :type 'boolean)
 
 (defcustom checkdoc-force-docstrings-flag t
-  "*Non-nil means that all checkable definitions should have documentation.
+  "Non-nil means that all checkable definitions should have documentation.
 Style guide dictates that interactive functions MUST have documentation,
 and that it's good but not required practice to make non user visible items
 have doc strings."
   :group 'checkdoc
   :type 'boolean)
+(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
 
 (defcustom checkdoc-force-history-flag t
-  "*Non-nil means that files should have a History section or ChangeLog file.
+  "Non-nil means that files should have a History section or ChangeLog file.
 This helps document the evolution of, and recent changes to, the package."
   :group 'checkdoc
   :type 'boolean)
 
 (defcustom checkdoc-permit-comma-termination-flag nil
-  "*Non-nil means the first line of a docstring may end with a comma.
+  "Non-nil means the first line of a docstring may end with a comma.
 Ordinarily, a full sentence is required.  This may be misleading when
 there is a substantial caveat to the one-line description -- the comma
 should be used when the first part could stand alone as a sentence, but
 it indicates that a modifying clause follows."
   :group 'checkdoc
   :type 'boolean)
+(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable 'booleanp)
 
 (defcustom checkdoc-spellcheck-documentation-flag nil
-  "*Non-nil means run Ispell on text based on value.
+  "Non-nil means run Ispell on text based on value.
 This is automatically set to nil if Ispell does not exist on your
 system.  Possible values are:
 
@@ -259,14 +267,14 @@ system.  Possible values are:
   "List of words that are correct when spell-checking Lisp documentation.")
 
 (defcustom checkdoc-max-keyref-before-warn 10
-  "*The number of \\ [command-to-keystroke] tokens allowed in a doc string.
+  "The number of \\ [command-to-keystroke] tokens allowed in a doc string.
 Any more than this and a warning is generated suggesting that the construct
 \\ {keymap} be used instead."
   :group 'checkdoc
   :type 'integer)
 
 (defcustom checkdoc-arguments-in-order-flag t
-  "*Non-nil means warn if arguments appear out of order.
+  "Non-nil means warn if arguments appear out of order.
 Setting this to nil will mean only checking that all the arguments
 appear in the proper form in the documentation, not that they are in
 the same order as they appear in the argument list.  No mention is
@@ -298,7 +306,7 @@ problem discovered.  This is useful for adding additional checks.")
 A search leaves the cursor in front of the parameter list.")
 
 (defcustom checkdoc-verb-check-experimental-flag t
-  "*Non-nil means to attempt to check the voice of the doc string.
+  "Non-nil means to attempt to check the voice of the doc string.
 This check keys off some words which are commonly misused.  See the
 variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own."
   :group 'checkdoc
@@ -1585,7 +1593,7 @@ mouse-[0-3]\\)\\)\\>"))
                     ;; a prefix.
                     (let ((disambiguate
                            (completing-read
-                            "Disambiguating Keyword (default: variable): "
+                            "Disambiguating Keyword (default variable): "
                             '(("function") ("command") ("variable")
                               ("option") ("symbol"))
                             nil t nil nil "variable")))
@@ -2253,7 +2261,8 @@ Code:, and others referenced in the style guide."
                    (re-search-forward "^;;; Code" nil t)
                    (re-search-forward "^(require" nil t)
                    (re-search-forward "^(" nil t))
-               (beginning-of-line)))
+               (beginning-of-line))
+              (t (re-search-forward ";;; .* --- .*\n")))
              (if (checkdoc-y-or-n-p
                   "You should have a \";;; Commentary:\", add one? ")
                  (insert "\n;;; Commentary:\n;; \n\n")
@@ -2633,12 +2642,6 @@ function called to create the messages."
        (setq checkdoc-pending-errors nil)
        nil)))
 
-(defgroup checkdoc nil
-  "Support for doc string checking in Emacs Lisp."
-  :prefix "checkdoc"
-  :group 'lisp
-  :version "20.3")
-
 (custom-add-option 'emacs-lisp-mode-hook
                   (lambda () (checkdoc-minor-mode 1)))
 
@@ -2650,5 +2653,5 @@ function called to create the messages."
 
 (provide 'checkdoc)
 
-;;; arch-tag: c49a7ec8-3bb7-46f2-bfbc-d5f26e033b26
+;; arch-tag: c49a7ec8-3bb7-46f2-bfbc-d5f26e033b26
 ;;; checkdoc.el ends here