aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJuri Linkov2005-03-18 10:01:12 +0000
committerJuri Linkov2005-03-18 10:01:12 +0000
commit1332f1a08b5261f4681cf3b01e2cad2c42ff367a (patch)
treec0bcaa9f949c7c1d79c3e90f9ee59cbdc61d09f2 /lisp
parent444697a17ac69ec1d0b7805f448de3c15c9d5467 (diff)
downloademacs-1332f1a08b5261f4681cf3b01e2cad2c42ff367a.tar.gz
emacs-1332f1a08b5261f4681cf3b01e2cad2c42ff367a.zip
(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'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog33
-rw-r--r--lisp/textmodes/ispell.el31
2 files changed, 61 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 24b68851034..6a005871549 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,36 @@
12005-03-18 Juri Linkov <juri@jurta.org>
2
3 * isearch.el (isearch-lazy-highlight-new-loop):
4 Make arguments beg and end optional.
5 (isearch-update): Remove optional arguments nil from
6 isearch-lazy-highlight-new-loop.
7 (isearch-lazy-highlight-search): Let-bind case-fold-search to
8 isearch-lazy-highlight-case-fold-search instead of
9 isearch-case-fold-search, and let-bind isearch-regexp to
10 isearch-lazy-highlight-regexp. Use
11 isearch-lazy-highlight-last-string instead of isearch-string.
12
13 * replace.el (perform-replace): Remove bindings of global
14 variables isearch-string, isearch-regexp, isearch-case-fold-search.
15 Add three new arguments to `replace-highlight'.
16 (replace-highlight): Add arguments string, regexp, case-fold.
17 Let-bind isearch-string, isearch-regexp, isearch-case-fold-search
18 to allow isearch-lazy-highlight-new-loop to use these values
19 to set corresponding isearch-lazy-highlight-... internal
20 variables whose values lazy highlighting will use regardless of
21 changes to global variables isearch-string, isearch-regexp,
22 isearch-case-fold-search during lazy highlighting loop.
23 (replace-dehighlight): Rename `isearch-lazy-highlight-cleanup'
24 to `lazy-highlight-cleanup'.
25
26 * textmodes/ispell.el (ispell-lazy-highlight): New defcustom.
27 (ispell-highlight-face): Set default face to `isearch' when
28 lazy highlighting is enabled.
29 (ispell-highlight-spelling-error-overlay): Set `ispell-overlay'
30 priority to 1. Add lazy highlighting.
31 (ispell-highlight-spelling-error-xemacs): Remove obsolete arg
32 from `isearch-dehighlight'.
33
12005-03-18 David Ponce <david@dponce.com> 342005-03-18 David Ponce <david@dponce.com>
2 35
3 * files.el (hack-local-variables): Do a case-insensitive search 36 * files.el (hack-local-variables): Do a case-insensitive search
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 38f69bd2250..a55f79381bb 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -238,7 +238,17 @@ When set to `block', assumes a block cursor with TTY displays."
238 :type '(choice (const block) (const :tag "off" nil) (const :tag "on" t)) 238 :type '(choice (const block) (const :tag "off" nil) (const :tag "on" t))
239 :group 'ispell) 239 :group 'ispell)
240 240
241(defcustom ispell-highlight-face 'highlight 241(defcustom ispell-lazy-highlight (boundp 'lazy-highlight-cleanup)
242 "*Controls the lazy-highlighting of spelling errors.
243When non-nil, all text in the buffer matching the current spelling
244error is highlighted lazily using isearch lazy highlighting (see
245`lazy-highlight-initial-delay' and `lazy-highlight-interval')."
246 :type 'boolean
247 :group 'lazy-highlight
248 :group 'ispell
249 :version "22.1")
250
251(defcustom ispell-highlight-face (if ispell-lazy-highlight 'isearch 'highlight)
242 "*The face used for Ispell highlighting. For Emacses with overlays. 252 "*The face used for Ispell highlighting. For Emacses with overlays.
243Possible values are `highlight', `modeline', `secondary-selection', 253Possible values are `highlight', `modeline', `secondary-selection',
244`region', and `underline'. 254`region', and `underline'.
@@ -2160,7 +2170,7 @@ When the optional third arg HIGHLIGHT is set, the word is highlighted,
2160otherwise it is displayed normally." 2170otherwise it is displayed normally."
2161 (if highlight 2171 (if highlight
2162 (isearch-highlight start end) 2172 (isearch-highlight start end)
2163 (isearch-dehighlight t)) 2173 (isearch-dehighlight))
2164 ;;(sit-for 0) 2174 ;;(sit-for 0)
2165 ) 2175 )
2166 2176
@@ -2174,8 +2184,23 @@ The variable `ispell-highlight-face' selects the face to use for highlighting."
2174 (if highlight 2184 (if highlight
2175 (progn 2185 (progn
2176 (setq ispell-overlay (make-overlay start end)) 2186 (setq ispell-overlay (make-overlay start end))
2187 (overlay-put ispell-overlay 'priority 1) ;higher than lazy overlays
2177 (overlay-put ispell-overlay 'face ispell-highlight-face)) 2188 (overlay-put ispell-overlay 'face ispell-highlight-face))
2178 (delete-overlay ispell-overlay))) 2189 (delete-overlay ispell-overlay))
2190 (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup))
2191 (if highlight
2192 (let ((isearch-string
2193 (concat
2194 "\\b"
2195 (regexp-quote (buffer-substring-no-properties start end))
2196 "\\b"))
2197 (isearch-regexp t)
2198 (isearch-case-fold-search nil))
2199 (isearch-lazy-highlight-new-loop
2200 (if (boundp 'reg-start) reg-start)
2201 (if (boundp 'reg-end) reg-end)))
2202 (lazy-highlight-cleanup lazy-highlight-cleanup)
2203 (setq isearch-lazy-highlight-last-string nil))))
2179 2204
2180 2205
2181(defun ispell-highlight-spelling-error (start end &optional highlight refresh) 2206(defun ispell-highlight-spelling-error (start end &optional highlight refresh)