94 |
"*The maximum distance for finding duplicates of unrecognized words. |
"*The maximum distance for finding duplicates of unrecognized words. |
95 |
This applies to the feature that when a word is not found in the dictionary, |
This applies to the feature that when a word is not found in the dictionary, |
96 |
if the same spelling occurs elsewhere in the buffer, |
if the same spelling occurs elsewhere in the buffer, |
97 |
Flyspell uses a different face (`flyspell-duplicate-face') to highlight it. |
Flyspell uses a different face (`flyspell-duplicate') to highlight it. |
98 |
This variable specifies how far to search to find such a duplicate. |
This variable specifies how far to search to find such a duplicate. |
99 |
-1 means no limit (search the whole buffer). |
-1 means no limit (search the whole buffer). |
100 |
0 means do not search for duplicate unrecognized spellings." |
0 means do not search for duplicate unrecognized spellings." |
444 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
445 |
;* Highlighting */ |
;* Highlighting */ |
446 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
447 |
(defface flyspell-incorrect-face |
(defface flyspell-incorrect |
448 |
'((((class color)) (:foreground "OrangeRed" :bold t :underline t)) |
'((((class color)) (:foreground "OrangeRed" :bold t :underline t)) |
449 |
(t (:bold t))) |
(t (:bold t))) |
450 |
"Face used for marking a misspelled word in Flyspell." |
"Face used for marking a misspelled word in Flyspell." |
451 |
:group 'flyspell) |
:group 'flyspell) |
452 |
|
;; backward-compatibility alias |
453 |
|
(put 'flyspell-incorrect-face 'face-alias 'flyspell-incorrect) |
454 |
|
|
455 |
(defface flyspell-duplicate-face |
(defface flyspell-duplicate |
456 |
'((((class color)) (:foreground "Gold3" :bold t :underline t)) |
'((((class color)) (:foreground "Gold3" :bold t :underline t)) |
457 |
(t (:bold t))) |
(t (:bold t))) |
458 |
"Face used for marking a misspelled word that appears twice in the buffer. |
"Face used for marking a misspelled word that appears twice in the buffer. |
459 |
See also `flyspell-duplicate-distance'." |
See also `flyspell-duplicate-distance'." |
460 |
:group 'flyspell) |
:group 'flyspell) |
461 |
|
;; backward-compatibility alias |
462 |
|
(put 'flyspell-duplicate-face 'face-alias 'flyspell-duplicate) |
463 |
|
|
464 |
(defvar flyspell-overlay nil) |
(defvar flyspell-overlay nil) |
465 |
|
|
544 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
545 |
(defun flyspell-mode-on () |
(defun flyspell-mode-on () |
546 |
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead." |
"Turn Flyspell mode on. Do not use this; use `flyspell-mode' instead." |
547 |
(setq ispell-highlight-face 'flyspell-incorrect-face) |
(setq ispell-highlight-face 'flyspell-incorrect) |
548 |
;; local dictionaries setup |
;; local dictionaries setup |
549 |
(or ispell-local-dictionary ispell-dictionary |
(or ispell-local-dictionary ispell-dictionary |
550 |
(if flyspell-default-dictionary |
(if flyspell-default-dictionary |
1574 |
(overlay-put flyspell-overlay |
(overlay-put flyspell-overlay |
1575 |
flyspell-overlay-keymap-property-name |
flyspell-overlay-keymap-property-name |
1576 |
flyspell-mouse-map)) |
flyspell-mouse-map)) |
1577 |
(when (eq face 'flyspell-incorrect-face) |
(when (eq face 'flyspell-incorrect) |
1578 |
(and (stringp flyspell-before-incorrect-word-string) |
(and (stringp flyspell-before-incorrect-word-string) |
1579 |
(overlay-put flyspell-overlay 'before-string |
(overlay-put flyspell-overlay 'before-string |
1580 |
flyspell-before-incorrect-word-string)) |
flyspell-before-incorrect-word-string)) |
1614 |
;; now we can use a new overlay |
;; now we can use a new overlay |
1615 |
(setq flyspell-overlay |
(setq flyspell-overlay |
1616 |
(make-flyspell-overlay |
(make-flyspell-overlay |
1617 |
beg end 'flyspell-incorrect-face 'highlight))))))) |
beg end 'flyspell-incorrect 'highlight))))))) |
1618 |
|
|
1619 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1620 |
;* flyspell-highlight-duplicate-region ... */ |
;* flyspell-highlight-duplicate-region ... */ |
1640 |
;; now we can use a new overlay |
;; now we can use a new overlay |
1641 |
(setq flyspell-overlay |
(setq flyspell-overlay |
1642 |
(make-flyspell-overlay beg end |
(make-flyspell-overlay beg end |
1643 |
'flyspell-duplicate-face |
'flyspell-duplicate |
1644 |
'highlight))))))) |
'highlight))))))) |
1645 |
|
|
1646 |
;*---------------------------------------------------------------------*/ |
;*---------------------------------------------------------------------*/ |
1702 |
(let ((num (car pos))) |
(let ((num (car pos))) |
1703 |
(put-text-property num |
(put-text-property num |
1704 |
(+ num (length flyspell-auto-correct-word)) |
(+ num (length flyspell-auto-correct-word)) |
1705 |
'face |
'face 'flyspell-incorrect |
|
'flyspell-incorrect-face |
|
1706 |
string)) |
string)) |
1707 |
(setq pos (cdr pos))) |
(setq pos (cdr pos))) |
1708 |
(if (fboundp 'display-message) |
(if (fboundp 'display-message) |
1879 |
;; check if its face has changed |
;; check if its face has changed |
1880 |
(not (eq (get-char-property |
(not (eq (get-char-property |
1881 |
(overlay-start new-overlay) 'face) |
(overlay-start new-overlay) 'face) |
1882 |
'flyspell-incorrect-face)))) |
'flyspell-incorrect)))) |
1883 |
(setq new-overlay (car-safe overlay-list)) |
(setq new-overlay (car-safe overlay-list)) |
1884 |
(setq overlay-list (cdr-safe overlay-list))) |
(setq overlay-list (cdr-safe overlay-list))) |
1885 |
|
|