(ispell-lazy-highlight): New defcustom.

(ispell-highlight-face): Set default face to `isearch' when
lazy highlighting is enabled.
(ispell-highlight-spelling-error-overlay): Set `ispell-overlay'
priority to 1.  Add lazy highlighting.
(ispell-highlight-spelling-error-xemacs): Remove obsolete arg
from `isearch-dehighlight'.
This commit is contained in:
Juri Linkov 2005-03-18 10:01:12 +00:00
parent 444697a17a
commit 1332f1a08b
2 changed files with 61 additions and 3 deletions

View file

@ -1,3 +1,36 @@
2005-03-18 Juri Linkov <juri@jurta.org>
* isearch.el (isearch-lazy-highlight-new-loop):
Make arguments beg and end optional.
(isearch-update): Remove optional arguments nil from
isearch-lazy-highlight-new-loop.
(isearch-lazy-highlight-search): Let-bind case-fold-search to
isearch-lazy-highlight-case-fold-search instead of
isearch-case-fold-search, and let-bind isearch-regexp to
isearch-lazy-highlight-regexp. Use
isearch-lazy-highlight-last-string instead of isearch-string.
* replace.el (perform-replace): Remove bindings of global
variables isearch-string, isearch-regexp, isearch-case-fold-search.
Add three new arguments to `replace-highlight'.
(replace-highlight): Add arguments string, regexp, case-fold.
Let-bind isearch-string, isearch-regexp, isearch-case-fold-search
to allow isearch-lazy-highlight-new-loop to use these values
to set corresponding isearch-lazy-highlight-... internal
variables whose values lazy highlighting will use regardless of
changes to global variables isearch-string, isearch-regexp,
isearch-case-fold-search during lazy highlighting loop.
(replace-dehighlight): Rename `isearch-lazy-highlight-cleanup'
to `lazy-highlight-cleanup'.
* textmodes/ispell.el (ispell-lazy-highlight): New defcustom.
(ispell-highlight-face): Set default face to `isearch' when
lazy highlighting is enabled.
(ispell-highlight-spelling-error-overlay): Set `ispell-overlay'
priority to 1. Add lazy highlighting.
(ispell-highlight-spelling-error-xemacs): Remove obsolete arg
from `isearch-dehighlight'.
2005-03-18 David Ponce <david@dponce.com>
* files.el (hack-local-variables): Do a case-insensitive search

View file

@ -238,7 +238,17 @@ When set to `block', assumes a block cursor with TTY displays."
:type '(choice (const block) (const :tag "off" nil) (const :tag "on" t))
:group 'ispell)
(defcustom ispell-highlight-face 'highlight
(defcustom ispell-lazy-highlight (boundp 'lazy-highlight-cleanup)
"*Controls the lazy-highlighting of spelling errors.
When non-nil, all text in the buffer matching the current spelling
error is highlighted lazily using isearch lazy highlighting (see
`lazy-highlight-initial-delay' and `lazy-highlight-interval')."
:type 'boolean
:group 'lazy-highlight
:group 'ispell
:version "22.1")
(defcustom ispell-highlight-face (if ispell-lazy-highlight 'isearch 'highlight)
"*The face used for Ispell highlighting. For Emacses with overlays.
Possible values are `highlight', `modeline', `secondary-selection',
`region', and `underline'.
@ -2160,7 +2170,7 @@ When the optional third arg HIGHLIGHT is set, the word is highlighted,
otherwise it is displayed normally."
(if highlight
(isearch-highlight start end)
(isearch-dehighlight t))
(isearch-dehighlight))
;;(sit-for 0)
)
@ -2174,8 +2184,23 @@ The variable `ispell-highlight-face' selects the face to use for highlighting."
(if highlight
(progn
(setq ispell-overlay (make-overlay start end))
(overlay-put ispell-overlay 'priority 1) ;higher than lazy overlays
(overlay-put ispell-overlay 'face ispell-highlight-face))
(delete-overlay ispell-overlay)))
(delete-overlay ispell-overlay))
(if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup))
(if highlight
(let ((isearch-string
(concat
"\\b"
(regexp-quote (buffer-substring-no-properties start end))
"\\b"))
(isearch-regexp t)
(isearch-case-fold-search nil))
(isearch-lazy-highlight-new-loop
(if (boundp 'reg-start) reg-start)
(if (boundp 'reg-end) reg-end)))
(lazy-highlight-cleanup lazy-highlight-cleanup)
(setq isearch-lazy-highlight-last-string nil))))
(defun ispell-highlight-spelling-error (start end &optional highlight refresh)