[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Spell checking of the commentary section by checkdoc.el.
From: |
Lute Kamstra |
Subject: |
Spell checking of the commentary section by checkdoc.el. |
Date: |
Mon, 12 May 2003 11:29:16 +0200 |
User-agent: |
Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux) |
Dear people,
The function `checkdoc-file-comments-engine' in
lisp/emacs-lisp/checkdoc.el tries to spell check (when spell checking
is requested) the commentary section of a lisp library. To do this,
it determines the start and end of the commentary section as follows.
,----[ checkdoc.el.~1.36~; lines 2345 -- 2361 ]
| ;; Let's spellcheck the commentary section. This is the only
| ;; section that is easy to pick out, and it is also the most
| ;; visible section (with the finder).
| (let ((cm (lm-commentary-mark)))
| (if cm
| (save-excursion
| (goto-char (lm-commentary-mark))
| ;; Spellcheck between the commentary, and the first
| ;; non-comment line. We could use lm-commentary, but that
| ;; returns a string, and Ispell wants to talk to a buffer.
| ;; Since the comments talk about Lisp, use the specialized
| ;; spell-checker we also used for doc strings.
| (let ((e (save-excursion (re-search-forward "^[^;]" nil t)
| (point))))
| (checkdoc-sentencespace-region-engine (point) e)
| (checkdoc-proper-noun-region-engine (point) e)
| (checkdoc-ispell-docstring-engine e)))))
`----
This works fine if the entire commentary section consists of lines
starting with the `;' character. In most libraries this is not the
case as their commentary sections contain empty lines as well. In
most cases the line succeeding the ";;; Commentary:" line is empty.
As a result, `checkdoc-file-comments-engine' does not spellcheck these
commentary sections.
I propose the following change to make `checkdoc-file-comments-engine'
spellcheck everything after the ";;; Commentary:" line up to the first
non-comment non-whitespace line. Shall I commit it?
Lute.
*** lisp/emacs-lisp/checkdoc.el.~1.36.~ 2003-03-28 18:38:50.000000000 +0100
--- lisp/emacs-lisp/checkdoc.el 2003-05-12 11:23:49.000000000 +0200
***************
*** 2354,2361 ****
;; returns a string, and Ispell wants to talk to a buffer.
;; Since the comments talk about Lisp, use the specialized
;; spell-checker we also used for doc strings.
! (let ((e (save-excursion (re-search-forward "^[^;]" nil t)
! (point))))
(checkdoc-sentencespace-region-engine (point) e)
(checkdoc-proper-noun-region-engine (point) e)
(checkdoc-ispell-docstring-engine e)))))
--- 2354,2363 ----
;; returns a string, and Ispell wants to talk to a buffer.
;; Since the comments talk about Lisp, use the specialized
;; spell-checker we also used for doc strings.
! (let ((e (save-excursion
! (while (looking-at "[ \t]*[;\n]")
! (forward-line 1))
! (point))))
(checkdoc-sentencespace-region-engine (point) e)
(checkdoc-proper-noun-region-engine (point) e)
(checkdoc-ispell-docstring-engine e)))))
- Spell checking of the commentary section by checkdoc.el.,
Lute Kamstra <=
- Re[1]: Spell checking of the commentary section by checkdoc.el., Eric M. Ludlam, 2003/05/13
- Re: Re[1]: Spell checking of the commentary section by checkdoc.el., Stefan Monnier, 2003/05/13
- Re: Spell checking of the commentary section by checkdoc.el., Lute Kamstra, 2003/05/14
- Re: Spell checking of the commentary section by checkdoc.el., Stefan Monnier, 2003/05/14
- Re: Spell checking of the commentary section by checkdoc.el., Lute Kamstra, 2003/05/15
- Re: Spell checking of the commentary section by checkdoc.el., Oliver Scholz, 2003/05/15
- Re: Spell checking of the commentary section by checkdoc.el., Stefan Monnier, 2003/05/15
- Re: Spell checking of the commentary section by checkdoc.el., Miles Bader, 2003/05/15
- Re: Spell checking of the commentary section by checkdoc.el., Oliver Scholz, 2003/05/16
- Re: Spell checking of the commentary section by checkdoc.el., Stefan Monnier, 2003/05/16