*** flyspell.el.~1.116.~ Mon Apr 2 07:45:14 2007 --- flyspell.el Sat Apr 7 08:37:24 2007 *************** *** 79,91 **** :type 'boolean) (defcustom flyspell-duplicate-distance -1 ! "The maximum distance for finding duplicates of unrecognized words. ! This applies to the feature that when a word is not found in the dictionary, ! if the same spelling occurs elsewhere in the buffer, ! Flyspell uses a different face (`flyspell-duplicate') to highlight it. ! This variable specifies how far to search to find such a duplicate. ! -1 means no limit (search the whole buffer). ! 0 means do not search for duplicate unrecognized spellings." :group 'flyspell :version "21.1" :type 'number) --- 79,92 ---- :type 'boolean) (defcustom flyspell-duplicate-distance -1 ! "Maximum distance of duplicate misspellings. ! By default Flyspell highlights single occurrences of a misspelled word ! with `flyspell-incorrect' face and multiple occurrences with ! `flyspell-duplicate' face. This variable specifies how far Flyspell may ! go to find multiple occurrences. -1 means no limit \(search the entire ! buffer). 0 means do not search at all \(that is, highlight every ! occurrence of a misspelled word with `flyspell-incorrect'). Any other ! non-negative number specifies the maximum number of characters to go." :group 'flyspell :version "21.1" :type 'number) *************** *** 431,437 **** (defface flyspell-incorrect '((((class color)) (:foreground "OrangeRed" :bold t :underline t)) (t (:bold t))) ! "Face used to display a misspelled word in Flyspell." :group 'flyspell) ;; backward-compatibility alias (put 'flyspell-incorrect-face 'face-alias 'flyspell-incorrect) --- 432,441 ---- (defface flyspell-incorrect '((((class color)) (:foreground "OrangeRed" :bold t :underline t)) (t (:bold t))) ! "Face for highlighting misspelled words. ! This face is used for highlighting single occurrences of misspelled ! words. Multiple occurrences are highlighted with `flyspell-duplicate' ! face." :group 'flyspell) ;; backward-compatibility alias (put 'flyspell-incorrect-face 'face-alias 'flyspell-incorrect) *************** *** 439,445 **** (defface flyspell-duplicate '((((class color)) (:foreground "Gold3" :bold t :underline t)) (t (:bold t))) ! "Face used to display subsequent occurrences of a misspelled word. See also `flyspell-duplicate-distance'." :group 'flyspell) ;; backward-compatibility alias --- 443,449 ---- (defface flyspell-duplicate '((((class color)) (:foreground "Gold3" :bold t :underline t)) (t (:bold t))) ! "Face for highlighting multiple occurrences of misspelled words. See also `flyspell-duplicate-distance'." :group 'flyspell) ;; backward-compatibility alias *************** *** 991,997 **** (let ((lw (flyspell-get-word '()))) (if (and (consp lw) (string-equal (car lw) word)) (setq r p) ! (goto-char (1+ p))))) r))) ;;*---------------------------------------------------------------------*/ --- 995,1001 ---- (let ((lw (flyspell-get-word '()))) (if (and (consp lw) (string-equal (car lw) word)) (setq r p) ! (goto-char p)))) r))) ;;*---------------------------------------------------------------------*/ *************** *** 1094,1123 **** (if (> end start) (flyspell-unhighlight-at (- end 1))) t) ! ((or (and (< flyspell-duplicate-distance 0) ! (or (save-excursion ! (goto-char start) ! (flyspell-word-search-backward ! word ! (point-min))) ! (save-excursion ! (goto-char end) ! (flyspell-word-search-forward ! word ! (point-max))))) ! (and (> flyspell-duplicate-distance 0) ! (or (save-excursion ! (goto-char start) ! (flyspell-word-search-backward ! word ! (- start ! flyspell-duplicate-distance))) ! (save-excursion ! (goto-char end) ! (flyspell-word-search-forward ! word ! (+ end ! flyspell-duplicate-distance)))))) ;; This is a misspelled word which occurs ;; twice within flyspell-duplicate-distance. (setq flyspell-word-cache-result nil) --- 1098,1120 ---- (if (> end start) (flyspell-unhighlight-at (- end 1))) t) ! ((and (not (zerop flyspell-duplicate-distance)) ! (or (save-excursion ! (goto-char start) ! (flyspell-word-search-backward ! word ! (if (< flyspell-duplicate-distance 0) ! (point-min) ! (- start ! flyspell-duplicate-distance)))) ! (save-excursion ! (goto-char end) ! (flyspell-word-search-forward ! word ! (if (< flyspell-duplicate-distance 0) ! (point-max) ! (+ end ! flyspell-duplicate-distance)))))) ;; This is a misspelled word which occurs ;; twice within flyspell-duplicate-distance. (setq flyspell-word-cache-result nil)