From: Juri Linkov <juri@linkov.net>
To: Alan Mackenzie <acm@muc.de>
Cc: 22097@debbugs.gnu.org
Subject: bug#22097: Ispell: lazy highlighting doesn't work properly.
Date: Tue, 08 Dec 2015 02:47:32 +0200 [thread overview]
Message-ID: <87oae1sr4r.fsf@mail.linkov.net> (raw)
In-Reply-To: <87fuzgebv4.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 06 Dec 2015 01:04:15 +0200")
> 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))
next prev parent reply other threads:[~2015-12-08 0:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-05 11:42 bug#22097: Ispell: lazy highlighting doesn't work properly Alan Mackenzie
2015-12-05 13:23 ` Eli Zaretskii
2015-12-05 14:06 ` Alan Mackenzie
2015-12-05 14:20 ` Eli Zaretskii
2015-12-05 16:04 ` Alan Mackenzie
2015-12-05 16:47 ` Eli Zaretskii
2015-12-05 23:04 ` Juri Linkov
2015-12-08 0:47 ` Juri Linkov [this message]
2015-12-09 21:59 ` Alan Mackenzie
2020-09-07 16:34 ` Lars Ingebrigtsen
2015-12-10 0:04 ` Juri Linkov
2015-12-10 16:08 ` Alan Mackenzie
2015-12-11 22:45 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87oae1sr4r.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=22097@debbugs.gnu.org \
--cc=acm@muc.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.