/[emacs]/emacs/lisp/textmodes/flyspell.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/flyspell.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by lute, Wed Jun 8 09:47:58 2005 UTC revision 1.68 by miles, Fri Jun 10 10:46:38 2005 UTC
# Line 94  Non-nil means use highlight, nil means u Line 94  Non-nil means use highlight, nil means u
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."
# Line 444  property of the major mode name.") Line 444  property of the major mode name.")
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    
# Line 540  in your .emacs file. Line 544  in your .emacs file.
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
# Line 1570  for the overlay." Line 1574  for the overlay."
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))
# Line 1610  for the overlay." Line 1614  for the overlay."
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 ...                          */
# Line 1636  for the overlay." Line 1640  for the overlay."
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  ;*---------------------------------------------------------------------*/  ;*---------------------------------------------------------------------*/
# Line 1698  misspelled words backwards." Line 1702  misspelled words backwards."
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)
# Line 1876  But don't look beyond what's visible on Line 1879  But don't look beyond what's visible on
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                    

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26