aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-11-14 20:11:23 +0000
committerStefan Monnier2000-11-14 20:11:23 +0000
commit82bc80bfce8aed0bf4fbdc4c03b289907927acef (patch)
treec6b40a730bdfef0b2223dd7519e8801a12d634ab
parente8c87124d317f942a51cebebe774b3b1124c8222 (diff)
downloademacs-82bc80bfce8aed0bf4fbdc4c03b289907927acef.tar.gz
emacs-82bc80bfce8aed0bf4fbdc4c03b289907927acef.zip
(checkdoc-minor-mode) <defvar>: Remove.
(checkdoc-minor-mode-map): New map, replaces checkdoc-minor-keymap. (checkdoc-minor-keymap): Backward compatibility. (checkdoc-minor-menu): Don't bother checking checkdoc-minor-keymap. (checkdoc-minor-mode) <defun>: Use easy-mmode-define-minor-mode. (checkdoc-this-string-valid-engine): Be a bit more strict to avoid matching substrings of `...' quoted vars/funs. (checkdoc-defun-info): Only look for `interactive' if alone. (debug-ignored-errors): Add "arg doesn't appear in docstring".
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/emacs-lisp/checkdoc.el95
2 files changed, 52 insertions, 53 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 99a771fc415..c9cd1f99c48 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,15 @@
12000-11-14 Stefan Monnier <monnier@cs.yale.edu> 12000-11-14 Stefan Monnier <monnier@cs.yale.edu>
2 2
3 * emacs-lisp/checkdoc.el (checkdoc-minor-mode) <defvar>: Remove.
4 (checkdoc-minor-mode-map): New map, replaces checkdoc-minor-keymap.
5 (checkdoc-minor-keymap): Backward compatibility.
6 (checkdoc-minor-menu): Don't bother checking checkdoc-minor-keymap.
7 (checkdoc-minor-mode) <defun>: Use easy-mmode-define-minor-mode.
8 (checkdoc-this-string-valid-engine): Be a bit more strict
9 to avoid matching substrings of `...' quoted vars/funs.
10 (checkdoc-defun-info): Only look for `interactive' if alone.
11 (debug-ignored-errors): Add "arg doesn't appear in docstring".
12
3 * progmodes/compile.el (grep): `tag-default' can be nil. 13 * progmodes/compile.el (grep): `tag-default' can be nil.
4 14
5 * newcomment.el (comment-indent): Paren typo. 15 * newcomment.el (comment-indent): Paren typo.
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index e687ce7dd74..08393286d5b 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1132,13 +1132,8 @@ generating a buffered list of errors."
1132 1132
1133;;; Minor Mode specification 1133;;; Minor Mode specification
1134;; 1134;;
1135(defvar checkdoc-minor-mode nil
1136 "Non-nil in `emacs-lisp-mode' for automatic documentation checking.")
1137(make-variable-buffer-local 'checkdoc-minor-mode)
1138 1135
1139(checkdoc-add-to-list 'minor-mode-alist '(checkdoc-minor-mode " CDoc")) 1136(defvar checkdoc-minor-mode-map
1140
1141(defvar checkdoc-minor-keymap
1142 (let ((map (make-sparse-keymap)) 1137 (let ((map (make-sparse-keymap))
1143 (pmap (make-sparse-keymap))) 1138 (pmap (make-sparse-keymap)))
1144 ;; Override some bindings 1139 ;; Override some bindings
@@ -1170,63 +1165,54 @@ generating a buffered list of errors."
1170 map) 1165 map)
1171 "Keymap used to override evaluation key-bindings for documentation checking.") 1166 "Keymap used to override evaluation key-bindings for documentation checking.")
1172 1167
1168(defvar checkdoc-minor-keymap checkdoc-minor-mode-map
1169 "Obsolete! Use `checkdoc-minor-mode-map'.")
1170
1173;; Add in a menubar with easy-menu 1171;; Add in a menubar with easy-menu
1174 1172
1175(if checkdoc-minor-keymap 1173(easy-menu-define
1176 (easy-menu-define 1174 checkdoc-minor-menu checkdoc-minor-mode-map "Checkdoc Minor Mode Menu"
1177 checkdoc-minor-menu checkdoc-minor-keymap "Checkdoc Minor Mode Menu" 1175 '("CheckDoc"
1178 '("CheckDoc" 1176 ["Interactive Buffer Style Check" checkdoc t]
1179 ["Interactive Buffer Style Check" checkdoc t] 1177 ["Interactive Buffer Style and Spelling Check" checkdoc-ispell t]
1180 ["Interactive Buffer Style and Spelling Check" checkdoc-ispell t] 1178 ["Check Buffer" checkdoc-current-buffer t]
1181 ["Check Buffer" checkdoc-current-buffer t] 1179 ["Check and Spell Buffer" checkdoc-ispell-current-buffer t]
1182 ["Check and Spell Buffer" checkdoc-ispell-current-buffer t] 1180 "---"
1183 "---" 1181 ["Interactive Style Check" checkdoc-interactive t]
1184 ["Interactive Style Check" checkdoc-interactive t] 1182 ["Interactive Style and Spelling Check" checkdoc-ispell-interactive t]
1185 ["Interactive Style and Spelling Check" checkdoc-ispell-interactive t] 1183 ["Find First Style Error" checkdoc-start t]
1186 ["Find First Style Error" checkdoc-start t] 1184 ["Find First Style or Spelling Error" checkdoc-ispell-start t]
1187 ["Find First Style or Spelling Error" checkdoc-ispell-start t] 1185 ["Next Style Error" checkdoc-continue t]
1188 ["Next Style Error" checkdoc-continue t] 1186 ["Next Style or Spelling Error" checkdoc-ispell-continue t]
1189 ["Next Style or Spelling Error" checkdoc-ispell-continue t] 1187 ["Interactive Message Text Style Check" checkdoc-message-interactive t]
1190 ["Interactive Message Text Style Check" checkdoc-message-interactive t] 1188 ["Interactive Message Text Style and Spelling Check"
1191 ["Interactive Message Text Style and Spelling Check" 1189 checkdoc-ispell-message-interactive t]
1192 checkdoc-ispell-message-interactive t] 1190 ["Check Message Text" checkdoc-message-text t]
1193 ["Check Message Text" checkdoc-message-text t] 1191 ["Check and Spell Message Text" checkdoc-ispell-message-text t]
1194 ["Check and Spell Message Text" checkdoc-ispell-message-text t] 1192 ["Check Comment Style" checkdoc-comments buffer-file-name]
1195 ["Check Comment Style" checkdoc-comments buffer-file-name] 1193 ["Check Comment Style and Spelling" checkdoc-ispell-comments
1196 ["Check Comment Style and Spelling" checkdoc-ispell-comments 1194 buffer-file-name]
1197 buffer-file-name] 1195 ["Check for Rogue Spaces" checkdoc-rogue-spaces t]
1198 ["Check for Rogue Spaces" checkdoc-rogue-spaces t] 1196 "---"
1199 "---" 1197 ["Check Defun" checkdoc-defun t]
1200 ["Check Defun" checkdoc-defun t] 1198 ["Check and Spell Defun" checkdoc-ispell-defun t]
1201 ["Check and Spell Defun" checkdoc-ispell-defun t] 1199 ["Check and Evaluate Defun" checkdoc-eval-defun t]
1202 ["Check and Evaluate Defun" checkdoc-eval-defun t] 1200 ["Check and Evaluate Buffer" checkdoc-eval-current-buffer t]
1203 ["Check and Evaluate Buffer" checkdoc-eval-current-buffer t] 1201 ))
1204 )))
1205;; XEmacs requires some weird stuff to add this menu in a minor mode. 1202;; XEmacs requires some weird stuff to add this menu in a minor mode.
1206;; What is it? 1203;; What is it?
1207 1204
1208;; Allow re-insertion of a new keymap
1209(let ((a (assoc 'checkdoc-minor-mode minor-mode-map-alist)))
1210 (if a
1211 (setcdr a checkdoc-minor-keymap)
1212 (checkdoc-add-to-list 'minor-mode-map-alist (cons 'checkdoc-minor-mode
1213 checkdoc-minor-keymap))))
1214
1215;;;###autoload 1205;;;###autoload
1216(defun checkdoc-minor-mode (&optional arg) 1206(easy-mmode-define-minor-mode checkdoc-minor-mode
1217 "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings. 1207 "Toggle Checkdoc minor mode, a mode for checking Lisp doc strings.
1218With prefix ARG, turn Checkdoc minor mode on iff ARG is positive. 1208With prefix ARG, turn Checkdoc minor mode on iff ARG is positive.
1219 1209
1220In Checkdoc minor mode, the usual bindings for `eval-defun' which is 1210In Checkdoc minor mode, the usual bindings for `eval-defun' which is
1221bound to \\<checkdoc-minor-keymap> \\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include 1211bound to \\<checkdoc-minor-mode-map> \\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include
1222checking of documentation strings. 1212checking of documentation strings.
1223 1213
1224\\{checkdoc-minor-keymap}" 1214\\{checkdoc-minor-mode-map}"
1225 (interactive "P") 1215 nil " CDoc" nil)
1226 (setq checkdoc-minor-mode
1227 (not (or (and (null arg) checkdoc-minor-mode)
1228 (<= (prefix-numeric-value arg) 0))))
1229 (checkdoc-mode-line-update))
1230 1216
1231;;; Subst utils 1217;;; Subst utils
1232;; 1218;;
@@ -1769,7 +1755,7 @@ Replace with \"%s\"? " original replace)
1769 (let ((found nil) (start (point)) (msg nil) (ms nil)) 1755 (let ((found nil) (start (point)) (msg nil) (ms nil))
1770 (while (and (not msg) 1756 (while (and (not msg)
1771 (re-search-forward 1757 (re-search-forward
1772 "[^([`':a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^]']" 1758 "[^-([`':a-zA-Z]\\(\\w+[:-]\\(\\w\\|\\s_\\)+\\)[^]']"
1773 e t)) 1759 e t))
1774 (setq ms (match-string 1)) 1760 (setq ms (match-string 1))
1775 (save-match-data 1761 (save-match-data
@@ -1855,7 +1841,7 @@ from the comment."
1855 ;; Interactive 1841 ;; Interactive
1856 (save-excursion 1842 (save-excursion
1857 (setq ret (cons 1843 (setq ret (cons
1858 (re-search-forward "(interactive" 1844 (re-search-forward "^\\s-*(interactive"
1859 (save-excursion (end-of-defun) (point)) 1845 (save-excursion (end-of-defun) (point))
1860 t) 1846 t)
1861 ret))) 1847 ret)))
@@ -2655,6 +2641,9 @@ function called to create the messages."
2655(custom-add-option 'emacs-lisp-mode-hook 2641(custom-add-option 'emacs-lisp-mode-hook
2656 (lambda () (checkdoc-minor-mode 1))) 2642 (lambda () (checkdoc-minor-mode 1)))
2657 2643
2644(add-to-list 'debug-ignored-errors
2645 "Argument `.*' should appear (as .*) in the doc string")
2646
2658(provide 'checkdoc) 2647(provide 'checkdoc)
2659 2648
2660;;; checkdoc.el ends here 2649;;; checkdoc.el ends here