169 |
|
|
170 |
(defcustom flyspell-incorrect-hook nil |
(defcustom flyspell-incorrect-hook nil |
171 |
"*List of functions to be called when incorrect words are encountered. |
"*List of functions to be called when incorrect words are encountered. |
172 |
Each function is given three arguments: the beginning and the end |
Each function is given three arguments. The first two |
173 |
of the incorrect region. The third is either the symbol 'doublon' or the list |
arguments are the beginning and the end of the incorrect region. |
174 |
|
The third is either the symbol `doublon' or the list |
175 |
of possible corrections as returned by `ispell-parse-output'. |
of possible corrections as returned by `ispell-parse-output'. |
176 |
|
|
177 |
If any of the functions return non-Nil, the word is not highlighted as |
If any of the functions return non-nil, the word is not highlighted as |
178 |
incorrect." |
incorrect." |
179 |
:group 'flyspell |
:group 'flyspell |
180 |
:version "21.1" |
:version "21.1" |
1087 |
word |
word |
1088 |
(+ end |
(+ end |
1089 |
flyspell-duplicate-distance)))))) |
flyspell-duplicate-distance)))))) |
1090 |
|
;; This is a misspelled word which occurs |
1091 |
|
;; twice within flyspell-duplicate-distance. |
1092 |
(setq flyspell-word-cache-result nil) |
(setq flyspell-word-cache-result nil) |
1093 |
(if flyspell-highlight-flag |
(if flyspell-highlight-flag |
1094 |
(flyspell-highlight-duplicate-region |
(flyspell-highlight-duplicate-region |
1562 |
;* flyspell-highlight-incorrect-region ... */ |
;* flyspell-highlight-incorrect-region ... */ |
1563 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1564 |
(defun flyspell-highlight-incorrect-region (beg end poss) |
(defun flyspell-highlight-incorrect-region (beg end poss) |
1565 |
"Set up an overlay on a misspelled word, in the buffer from BEG to END." |
"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." |
1570 |
(let ((inhibit-read-only t)) |
(let ((inhibit-read-only t)) |
1571 |
(unless (run-hook-with-args-until-success |
(unless (run-hook-with-args-until-success |
1572 |
'flyspell-incorrect-hook beg end poss) |
'flyspell-incorrect-hook beg end poss) |
1599 |
;* flyspell-highlight-duplicate-region ... */ |
;* flyspell-highlight-duplicate-region ... */ |
1600 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1601 |
(defun flyspell-highlight-duplicate-region (beg end poss) |
(defun flyspell-highlight-duplicate-region (beg end poss) |
1602 |
"Set up an overlay on a duplicated word, in the buffer from BEG to END. |
"Set up an overlay on a duplicate misspelled word, in the buffer from BEG to END. |
1603 |
??? What does POSS mean?" |
POSS is a list of possible spelling/correction lists, |
1604 |
|
as returned by `ispell-parse-output'." |
1605 |
(let ((inhibit-read-only t)) |
(let ((inhibit-read-only t)) |
1606 |
(unless (run-hook-with-args-until-success |
(unless (run-hook-with-args-until-success |
1607 |
'flyspell-incorrect-hook beg end poss) |
'flyspell-incorrect-hook beg end poss) |