GNU bug report logs - #53773
27.2; Flyspell delays region overlay update when the region is overwritten

Previous Next

Package: emacs;

Reported by: Andrea Greselin <greselin.andrea <at> gmail.com>

Date: Fri, 4 Feb 2022 10:01:01 UTC

Severity: normal

Tags: moreinfo, patch

Found in version 27.2

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrea Greselin <greselin.andrea <at> gmail.com>
To: 53773 <at> debbugs.gnu.org
Subject: bug#53773: 27.2; Flyspell delays region overlay update when the region is overwritten
Date: Fri, 4 Feb 2022 11:00:05 +0100
[Message part 1 (text/plain, inline)]
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))))
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.