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: Tue, 08 Dec 2015 02:47:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

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

This patch addresses this limitation: it limits the highlighting area
either to the region boundaries, or to the window boundaries.

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index aa51446..82c589d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2786,6 +2786,8 @@ ispell-highlight-spelling-error-xemacs
   ;;(sit-for 0)
   )
 
+(defvar ispell-reg-start nil)
+(defvar ispell-reg-end nil)
 
 (defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
   "Highlight the word from START to END using overlays.
@@ -2815,8 +2817,8 @@ ispell-highlight-spelling-error-overlay
                (isearch-other-end start)
                (isearch-error nil))
            (isearch-lazy-highlight-new-loop
-            (if (boundp 'reg-start) reg-start)
-            (if (boundp 'reg-end)   reg-end)))
+            (if (not (eq ispell-reg-start (point-min))) ispell-reg-start 
(window-start))
+            (if (not (eq ispell-reg-end   (point-max))) ispell-reg-end   
(window-end))))
        (lazy-highlight-cleanup lazy-highlight-cleanup)
        (setq isearch-lazy-highlight-last-string nil))))
 
@@ -3211,6 +3213,7 @@ ispell-region
 amount for last line processed."
   (interactive "r")                    ; Don't flag errors on read-only bufs.
   (ispell-set-spellchecker-params)      ; Initialize variables and dicts alists
+  (setq ispell-reg-start reg-start ispell-reg-end reg-end)
   (if (not recheckp)
       (ispell-accept-buffer-local-defs)) ; set up dictionary, local words, etc.
   (let ((skip-region-start (make-marker))





reply via email to

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