unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53773: 27.2; Flyspell delays region overlay update when the region is overwritten
@ 2022-02-04 10:00 Andrea Greselin
  2022-08-02 16:11 ` Andrea Greselin
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Greselin @ 2022-02-04 10:00 UTC (permalink / raw)
  To: 53773

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

Hello everyone :-)

When ‘delete-selection-mode’ and ‘transient-mark-mode’ are enabled,
there’s an active region and I type a character, the region is
immediately deactivated. In Flyspell mode, though, the unhighlighting
of the deactivated region is delayed by the function
‘flyspell-check-word-p’. The region is deactivated but the overlay is
not updated to reflect that.

If I understand correctly the delay (indicated by ‘<---’ below) is
used by Flyspell to give the user some time for typing before
highlighting a word as mispelled, but in this case it ends up
delaying also the refresh of the region overlay.

(defun flyspell-check-word-p ()
 "Return t when the word at `point' has to be checked.
The answer depends of several criteria.
Mostly we check word delimiters."
 (let ((ispell-otherchars (ispell-get-otherchars)))
   (cond
    ((<= (- (point-max) 1) (point-min))
     ;; The buffer is not filled enough.
     nil)
    ((and (and (> (current-column) 0)
(not (eq (current-column) flyspell-pre-column)))
  (save-excursion
    (backward-char 1)
    (and (looking-at (flyspell-get-not-casechars))
 (or (string= "" ispell-otherchars)
     (not (looking-at ispell-otherchars)))
 (or flyspell-consider-dash-as-word-delimiter-flag
     (not (looking-at "-"))))))
     ;; Yes because we have reached or typed a word delimiter.
     t)
    ((symbolp this-command)
     (cond
      ((get this-command 'flyspell-deplacement)
(not (eq flyspell-previous-command this-command)))
      ((get this-command 'flyspell-delayed)
;; The current command is not delayed, that
;; is that we must check the word now.
(and (not unread-command-events)
    (sit-for flyspell-delay))) ; <---
      (t t)))
    (t t))))

[-- Attachment #2: Type: text/html, Size: 2084 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-04  6:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 10:00 bug#53773: 27.2; Flyspell delays region overlay update when the region is overwritten Andrea Greselin
2022-08-02 16:11 ` Andrea Greselin
2022-08-03 11:17   ` Lars Ingebrigtsen
2022-08-03 12:30     ` Eli Zaretskii
2022-08-04  6:16       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).