aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric M. Ludlam1998-01-08 23:35:34 +0000
committerEric M. Ludlam1998-01-08 23:35:34 +0000
commit0a0a3dee18c253038f0ad2b77b65c6a7d3470383 (patch)
tree21a93fefec25bb13f124ad06efca9a650b3ff3eb
parentf8791ebe79e49f11c378e5ec868a070043f0a224 (diff)
downloademacs-0a0a3dee18c253038f0ad2b77b65c6a7d3470383.tar.gz
emacs-0a0a3dee18c253038f0ad2b77b65c6a7d3470383.zip
Added some more comments in the commentary.
You can now `quote' symbols that look like keystrokes When spell checking, meta variables can end in `th' or `s'.
-rw-r--r--lisp/emacs-lisp/checkdoc.el40
1 files changed, 29 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 9d0d6da7040..31e090d33fb 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1,23 +1,23 @@
1;;; checkdoc --- Check documentation strings for style requirements 1;;; checkdoc --- Check documentation strings for style requirements
2 2
3;;; Copyright (C) 1997 Free Software Foundation, Inc. 3;;; Copyright (C) 1997, 1998 Free Software Foundation
4;; 4;;
5;; Author: Eric M. Ludlam <zappo@gnu.ai.mit.edu> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6;; Version: 0.4.1 6;; Version: 0.4.2
7;; Keywords: docs, maint, lisp 7;; Keywords: docs, maint, lisp
8;; 8;;
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
10 10;;
11;; GNU Emacs is free software; you can redistribute it and/or modify 11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by 12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option) 13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version. 14;; any later version.
15 15;;
16;; GNU Emacs is distributed in the hope that it will be useful, 16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details. 19;; GNU General Public License for more details.
20 20;;
21;; You should have received a copy of the GNU General Public License 21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the 22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@@ -74,6 +74,19 @@
74;; running. Use `ispell-kill-ispell' to make checkdoc restart it with 74;; running. Use `ispell-kill-ispell' to make checkdoc restart it with
75;; these words enabled. 75;; these words enabled.
76;; 76;;
77;; Checking parameters
78;;
79;; You might not always want a function to have it's parameters listed
80;; in order. When this is the case, put the following comment just in
81;; front of the documentation string: "; checkdoc-order: nil" This
82;; overrides the value of `checkdoc-arguments-in-order-flag'.
83;;
84;; If you specifically wish to avoid mentioning a parameter of a
85;; function in the doc string (such as a hidden parameter, or a
86;; parameter which is very obvious like events), you can have checkdoc
87;; skip looking for it by putting the following comment just in front
88;; of the documentation string: "; checkdoc-params: (args go here)"
89;;
77;; Adding your own checks: 90;; Adding your own checks:
78;; 91;;
79;; You can experiment with adding your own checks by setting the 92;; You can experiment with adding your own checks by setting the
@@ -153,6 +166,9 @@
153;; Added `checkdoc-tripple-semi-comment-check-flag'. 166;; Added `checkdoc-tripple-semi-comment-check-flag'.
154;; `checkdoc-spellcheck-documentation-flag' off by default. 167;; `checkdoc-spellcheck-documentation-flag' off by default.
155;; Re-sorted check order so white space is removed before adding a . 168;; Re-sorted check order so white space is removed before adding a .
169;; 0.4.2 Added some more comments in the commentary.
170;; You can now `quote' symbols that look like keystrokes
171;; When spell checking, meta variables can end in `th' or `s'.
156 172
157;;; TO DO: 173;;; TO DO:
158;; Hook into the byte compiler on a defun/defver level to generate 174;; Hook into the byte compiler on a defun/defver level to generate
@@ -166,7 +182,7 @@
166;; not specifically docstring related. Would this even be useful? 182;; not specifically docstring related. Would this even be useful?
167 183
168;;; Code: 184;;; Code:
169(defvar checkdoc-version "0.4.1" 185(defvar checkdoc-version "0.4.2"
170 "Release version of checkdoc you are currently running.") 186 "Release version of checkdoc you are currently running.")
171 187
172;; From custom web page for compatibility between versions of custom: 188;; From custom web page for compatibility between versions of custom:
@@ -181,7 +197,7 @@
181 nil) 197 nil)
182 (defmacro custom-add-option (&rest args) 198 (defmacro custom-add-option (&rest args)
183 nil) 199 nil)
184 (defmacro defcustom (var value doc &rest args) 200 (defmacro defcustom (var value doc &rest args)
185 (` (defvar (, var) (, value) (, doc)))))) 201 (` (defvar (, var) (, value) (, doc))))))
186 202
187(defcustom checkdoc-autofix-flag 'semiautomatic 203(defcustom checkdoc-autofix-flag 'semiautomatic
@@ -278,7 +294,7 @@ Must return nil if no errors are found, or a string describing the
278problem discovered. This is useful for adding additional checks.") 294problem discovered. This is useful for adding additional checks.")
279 295
280(defvar checkdoc-diagnostic-buffer "*Style Warnings*" 296(defvar checkdoc-diagnostic-buffer "*Style Warnings*"
281 "Name of the buffer where checkdoc stores warning messages.") 297 "Name of warning message buffer.")
282 298
283(defvar checkdoc-defun-regexp 299(defvar checkdoc-defun-regexp
284 "^(def\\(un\\|var\\|custom\\|macro\\|const\\|subst\\|advice\\)\ 300 "^(def\\(un\\|var\\|custom\\|macro\\|const\\|subst\\|advice\\)\
@@ -1104,7 +1120,7 @@ may require more formatting.")
1104 ;; Instead, use the `\\[...]' construct to stand for them. 1120 ;; Instead, use the `\\[...]' construct to stand for them.
1105 (save-excursion 1121 (save-excursion
1106 (let ((f nil) (m nil) (start (point)) 1122 (let ((f nil) (m nil) (start (point))
1107 (re "\\<\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\ 1123 (re "[^`]\\([CMA]-[a-zA-Z]\\|\\(\\([CMA]-\\)?\
1108mouse-[0-3]\\)\\)\\>")) 1124mouse-[0-3]\\)\\)\\>"))
1109 ;; Find the first key sequence not in a sample 1125 ;; Find the first key sequence not in a sample
1110 (while (and (not f) (setq m (re-search-forward re e t))) 1126 (while (and (not f) (setq m (re-search-forward re e t)))
@@ -1422,7 +1438,9 @@ before using the ispell engine on it."
1422 nil 1438 nil
1423 ;; Find out how we spell-check this word. 1439 ;; Find out how we spell-check this word.
1424 (if (or 1440 (if (or
1425 (not (string-match "[a-z]" word)) ;all caps meta variable 1441 ;; All caps w/ option th, or s tacked on the end
1442 ;; for pluralization or nuberthness.
1443 (string-match "^[A-Z][A-Z]+\\(s\\|th\\)?$" word)
1426 (looking-at "}") ; a keymap expression 1444 (looking-at "}") ; a keymap expression
1427 ) 1445 )
1428 nil 1446 nil