Mercurial > emacs
comparison lisp/textmodes/flyspell.el @ 65662:f621d74f5b9a
(flyspell-incorrect-hook, flyspell-highlight-incorrect-region)
(flyspell-highlight-duplicate-region): Doc fixes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 23 Sep 2005 18:28:10 +0000 |
parents | 703495630901 |
children | d2f4d7bfbaef ee12d75eb214 |
comparison
equal
deleted
inserted
replaced
65661:1da971deed7b | 65662:f621d74f5b9a |
---|---|
167 :group 'flyspell | 167 :group 'flyspell |
168 :type 'boolean) | 168 :type 'boolean) |
169 | 169 |
170 (defcustom flyspell-incorrect-hook nil | 170 (defcustom flyspell-incorrect-hook nil |
171 "*List of functions to be called when incorrect words are encountered. | 171 "*List of functions to be called when incorrect words are encountered. |
172 Each function is given three arguments: the beginning and the end | 172 Each function is given three arguments. The first two |
173 of the incorrect region. The third is either the symbol 'doublon' or the list | 173 arguments are the beginning and the end of the incorrect region. |
174 The third is either the symbol `doublon' or the list | |
174 of possible corrections as returned by `ispell-parse-output'. | 175 of possible corrections as returned by `ispell-parse-output'. |
175 | 176 |
176 If any of the functions return non-Nil, the word is not highlighted as | 177 If any of the functions return non-nil, the word is not highlighted as |
177 incorrect." | 178 incorrect." |
178 :group 'flyspell | 179 :group 'flyspell |
179 :version "21.1" | 180 :version "21.1" |
180 :type 'hook) | 181 :type 'hook) |
181 | 182 |
1084 (goto-char end) | 1085 (goto-char end) |
1085 (flyspell-word-search-forward | 1086 (flyspell-word-search-forward |
1086 word | 1087 word |
1087 (+ end | 1088 (+ end |
1088 flyspell-duplicate-distance)))))) | 1089 flyspell-duplicate-distance)))))) |
1090 ;; This is a misspelled word which occurs | |
1091 ;; twice within flyspell-duplicate-distance. | |
1089 (setq flyspell-word-cache-result nil) | 1092 (setq flyspell-word-cache-result nil) |
1090 (if flyspell-highlight-flag | 1093 (if flyspell-highlight-flag |
1091 (flyspell-highlight-duplicate-region | 1094 (flyspell-highlight-duplicate-region |
1092 start end poss) | 1095 start end poss) |
1093 (message "duplicate `%s'" word)) | 1096 (message "duplicate `%s'" word)) |
1557 | 1560 |
1558 ;*---------------------------------------------------------------------*/ | 1561 ;*---------------------------------------------------------------------*/ |
1559 ;* flyspell-highlight-incorrect-region ... */ | 1562 ;* flyspell-highlight-incorrect-region ... */ |
1560 ;*---------------------------------------------------------------------*/ | 1563 ;*---------------------------------------------------------------------*/ |
1561 (defun flyspell-highlight-incorrect-region (beg end poss) | 1564 (defun flyspell-highlight-incorrect-region (beg end poss) |
1562 "Set up an overlay on a misspelled word, in the buffer from BEG to END." | 1565 "Set up an overlay on a misspelled word, in the buffer from BEG to END. |
1566 POSS is usually a list of possible spelling/correction lists, | |
1567 as returned by `ispell-parse-output'. | |
1568 It can also be the symbol `doublon', in the case where the word | |
1569 is itself incorrect, but suspiciously repeated." | |
1563 (let ((inhibit-read-only t)) | 1570 (let ((inhibit-read-only t)) |
1564 (unless (run-hook-with-args-until-success | 1571 (unless (run-hook-with-args-until-success |
1565 'flyspell-incorrect-hook beg end poss) | 1572 'flyspell-incorrect-hook beg end poss) |
1566 (if (or flyspell-highlight-properties | 1573 (if (or flyspell-highlight-properties |
1567 (not (flyspell-properties-at-p beg))) | 1574 (not (flyspell-properties-at-p beg))) |
1590 | 1597 |
1591 ;*---------------------------------------------------------------------*/ | 1598 ;*---------------------------------------------------------------------*/ |
1592 ;* flyspell-highlight-duplicate-region ... */ | 1599 ;* flyspell-highlight-duplicate-region ... */ |
1593 ;*---------------------------------------------------------------------*/ | 1600 ;*---------------------------------------------------------------------*/ |
1594 (defun flyspell-highlight-duplicate-region (beg end poss) | 1601 (defun flyspell-highlight-duplicate-region (beg end poss) |
1595 "Set up an overlay on a duplicated word, in the buffer from BEG to END. | 1602 "Set up an overlay on a duplicate misspelled word, in the buffer from BEG to END. |
1596 ??? What does POSS mean?" | 1603 POSS is a list of possible spelling/correction lists, |
1604 as returned by `ispell-parse-output'." | |
1597 (let ((inhibit-read-only t)) | 1605 (let ((inhibit-read-only t)) |
1598 (unless (run-hook-with-args-until-success | 1606 (unless (run-hook-with-args-until-success |
1599 'flyspell-incorrect-hook beg end poss) | 1607 'flyspell-incorrect-hook beg end poss) |
1600 (if (or flyspell-highlight-properties | 1608 (if (or flyspell-highlight-properties |
1601 (not (flyspell-properties-at-p beg))) | 1609 (not (flyspell-properties-at-p beg))) |