diff options
| author | Stefan Monnier | 2001-10-25 05:51:39 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-10-25 05:51:39 +0000 |
| commit | 2e8986926549e41415a877e2a7984a3d2f6365cc (patch) | |
| tree | 762c7f32474af51cea9525e9d803b0f32bfaa355 | |
| parent | 3bd171d52c88b87f75561700dace2f8a86675be9 (diff) | |
| download | emacs-2e8986926549e41415a877e2a7984a3d2f6365cc.tar.gz emacs-2e8986926549e41415a877e2a7984a3d2f6365cc.zip | |
(checkdoc-eval-defun): Call eval-defun
interactively so that C-u M-C-x still does edebug.
(checkdoc-sentencespace-region-engine): Don't force a double-space
after `.' if it doesn't look like an end-of-sentence.
(debug-ignored-errors): Add `disambiguate ...'.
| -rw-r--r-- | lisp/emacs-lisp/checkdoc.el | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index fe075baf536..6364a5d0db5 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -966,7 +966,7 @@ Evaluation is done first so the form will be read before the | |||
| 966 | documentation is checked. If there is a documentation error, then the display | 966 | documentation is checked. If there is a documentation error, then the display |
| 967 | of what was evaluated will be overwritten by the diagnostic message." | 967 | of what was evaluated will be overwritten by the diagnostic message." |
| 968 | (interactive) | 968 | (interactive) |
| 969 | (eval-defun nil) | 969 | (call-interactively 'eval-defun) |
| 970 | (checkdoc-defun)) | 970 | (checkdoc-defun)) |
| 971 | 971 | ||
| 972 | ;;;###autoload | 972 | ;;;###autoload |
| @@ -1654,7 +1654,7 @@ function,command,variable,option or symbol." ms1)))))) | |||
| 1654 | ;; Require whitespace OR | 1654 | ;; Require whitespace OR |
| 1655 | ;; ITEMth<space> OR | 1655 | ;; ITEMth<space> OR |
| 1656 | ;; ITEMs<space> | 1656 | ;; ITEMs<space> |
| 1657 | "\\(\\>\\|th\\>\\|s\\>\\)") | 1657 | "\\(\\>\\|th\\>\\|s\\>\\|[.,;:]\\)") |
| 1658 | e t))) | 1658 | e t))) |
| 1659 | (if (not found) | 1659 | (if (not found) |
| 1660 | (let ((case-fold-search t)) | 1660 | (let ((case-fold-search t)) |
| @@ -2004,35 +2004,35 @@ If the offending word is in a piece of quoted text, then it is skipped." | |||
| 2004 | (progn | 2004 | (progn |
| 2005 | (set-syntax-table checkdoc-syntax-table) | 2005 | (set-syntax-table checkdoc-syntax-table) |
| 2006 | (goto-char begin) | 2006 | (goto-char begin) |
| 2007 | (while (re-search-forward "[^.0-9]\\(\\. \\)[^ \n]" end t) | 2007 | (while (re-search-forward "[^ .0-9]\\(\\. \\)[^ \n]" end t) |
| 2008 | (let ((b (match-beginning 1)) | 2008 | (let ((b (match-beginning 1)) |
| 2009 | (e (match-end 1))) | 2009 | (e (match-end 1))) |
| 2010 | (if (and (not (checkdoc-in-sample-code-p begin end)) | 2010 | (unless (or (checkdoc-in-sample-code-p begin end) |
| 2011 | (not (checkdoc-in-example-string-p begin end)) | 2011 | (checkdoc-in-example-string-p begin end) |
| 2012 | (not (save-excursion | 2012 | (save-excursion |
| 2013 | (goto-char (match-beginning 1)) | 2013 | (goto-char b) |
| 2014 | (condition-case nil | 2014 | (condition-case nil |
| 2015 | (progn | 2015 | (progn |
| 2016 | (forward-sexp -1) | 2016 | (forward-sexp -1) |
| 2017 | ;; piece of an abbreviation | 2017 | ;; piece of an abbreviation |
| 2018 | (looking-at | 2018 | (looking-at |
| 2019 | "\\([a-z]\\|[iI]\\.?e\\|[eE]\\.?g\\)\\.")) | 2019 | "\\([a-z]\\|[iI]\\.?e\\|[eE]\\.?g\\)\\.")) |
| 2020 | (error t))))) | 2020 | (error t)))) |
| 2021 | (if (checkdoc-autofix-ask-replace | 2021 | (if (checkdoc-autofix-ask-replace |
| 2022 | b e | 2022 | b e |
| 2023 | "There should be two spaces after a period. Fix? " | 2023 | "There should be two spaces after a period. Fix? " |
| 2024 | ". ") | 2024 | ". ") |
| 2025 | nil | 2025 | nil |
| 2026 | (if errtxt | 2026 | (if errtxt |
| 2027 | ;; If there is already an error, then generate | 2027 | ;; If there is already an error, then generate |
| 2028 | ;; the warning output if applicable | 2028 | ;; the warning output if applicable |
| 2029 | (if checkdoc-generate-compile-warnings-flag | 2029 | (if checkdoc-generate-compile-warnings-flag |
| 2030 | (checkdoc-create-error | 2030 | (checkdoc-create-error |
| 2031 | "There should be two spaces after a period" | 2031 | "There should be two spaces after a period" |
| 2032 | b e)) | 2032 | b e)) |
| 2033 | (setq errtxt | 2033 | (setq errtxt |
| 2034 | "There should be two spaces after a period" | 2034 | "There should be two spaces after a period" |
| 2035 | bb b be e))))))) | 2035 | bb b be e))))))) |
| 2036 | (set-syntax-table old-syntax-table)) | 2036 | (set-syntax-table old-syntax-table)) |
| 2037 | (if errtxt (checkdoc-create-error errtxt bb be)))))) | 2037 | (if errtxt (checkdoc-create-error errtxt bb be)))))) |
| 2038 | 2038 | ||
| @@ -2655,6 +2655,7 @@ function called to create the messages." | |||
| 2655 | 2655 | ||
| 2656 | (add-to-list 'debug-ignored-errors | 2656 | (add-to-list 'debug-ignored-errors |
| 2657 | "Argument `.*' should appear (as .*) in the doc string") | 2657 | "Argument `.*' should appear (as .*) in the doc string") |
| 2658 | (add-to-list 'debug-ignored-errors "Disambiguate .* by preceding .*") | ||
| 2658 | 2659 | ||
| 2659 | (provide 'checkdoc) | 2660 | (provide 'checkdoc) |
| 2660 | 2661 | ||