[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f3b876fa75 1/2: Fix ispell-word on colorless TTY frames
From: |
Eli Zaretskii |
Subject: |
master f3b876fa75 1/2: Fix ispell-word on colorless TTY frames |
Date: |
Sun, 26 Jun 2022 04:11:37 -0400 (EDT) |
branch: master
commit f3b876fa75042a1c00886e07d8491ac11824a892
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix ispell-word on colorless TTY frames
* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-generic): Keep marker position of
END intact, deletion of text notwithstanding. (Bug#56219)
---
lisp/textmodes/ispell.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 1810d7bcae..8c8522a6e5 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2615,15 +2615,18 @@ Optional REFRESH will unhighlighted then highlight,
using block cursor
(text (buffer-substring-no-properties start end))
; Save highlight region.
(inhibit-quit t) ; inhibit interrupt processing here.
- (buffer-undo-list t)) ; don't clutter the undo list.
+ (buffer-undo-list t) ; don't clutter the undo list.
+ (end1 (if (markerp end) (marker-position end) end)))
(goto-char end)
(delete-region start end)
- (insert-char ? (- end start)) ; minimize amount of redisplay
+ (insert-char ? (- end1 start)) ; minimize amount of redisplay
(sit-for 0) ; update display
(if highlight (setq inverse-video (not inverse-video))) ; toggle video
- (delete-region start end) ; delete whitespace
+ (delete-region start end1) ; delete whitespace
(insert text) ; insert text in inverse video.
(sit-for 0) ; update display showing
inverse video.
+ (if (markerp end)
+ (set-marker end end1)) ; restore marker position
(if (not highlight)
(goto-char end)
(setq inverse-video (not inverse-video)) ; toggle video
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f3b876fa75 1/2: Fix ispell-word on colorless TTY frames,
Eli Zaretskii <=