bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22097: Ispell: lazy highlighting doesn't work properly.


From: Juri Linkov
Subject: bug#22097: Ispell: lazy highlighting doesn't work properly.
Date: Sun, 06 Dec 2015 01:04:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

> \(   \|  \|                                                                   
>       \)
>   --+  _+  \(   \|                      \)\(  \|    \)*\(                     
>    \)+
>              /\w  \(                  \)    \w  [-_]     [.:/@]+\(  \|        
> \)+
>                     \(  \|    \)+[.:@]                            \w  [-_~=?&]
>                       \w  [-_]

This is a nice ASCII-art in itself :-), but the problem is in another place -
in ispell-highlight-spelling-error-overlay you can see word boundaries
"\\b" that were added for every search string to not highlight parts
of words, such as when the current check is for e.g. "init", we don't
want to highlight "init" in the words "initialize", "initially", etc.
The drawback of this approach is that it depends on the word syntax in a
particular mode.

Another limitation is limiting lazy-highlighting by reg-start/reg-end
instead of a wider area of window-start/window-end.

Finally, we need now here this fix:

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index fe27f0f..aa51446 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2809,6 +2809,7 @@ ispell-highlight-spelling-error-overlay
                  (regexp-quote (buffer-substring-no-properties start end))
                  "\\b"))
                (isearch-regexp t)
+               (isearch-regexp-function nil)
                (isearch-case-fold-search nil)
                (isearch-forward t)
                (isearch-other-end start)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]