From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Greselin Newsgroups: gmane.emacs.bugs 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-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000cf81b605d72e529b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33690"; mail-complaints-to="usenet@ciao.gmane.io" To: 53773@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 04 11:09:37 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFvX7-0008da-5a for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Feb 2022 11:09:37 +0100 Original-Received: from localhost ([::1]:57862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFvX5-0003jq-Jz for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Feb 2022 05:09:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFvP7-0003b7-S9 for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2022 05:01:25 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFvOo-0007Ta-7p for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2022 05:01:15 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nFvOo-0006Lb-61 for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2022 05:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Greselin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Feb 2022 10:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53773 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164396885824381 (code B ref -1); Fri, 04 Feb 2022 10:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Feb 2022 10:00:58 +0000 Original-Received: from localhost ([127.0.0.1]:58813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFvOk-0006LA-6h for submit@debbugs.gnu.org; Fri, 04 Feb 2022 05:00:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:47596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFvOi-0006L2-5l for submit@debbugs.gnu.org; Fri, 04 Feb 2022 05:00:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFvOb-0003U3-Lp for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2022 05:00:55 -0500 Original-Received: from [2607:f8b0:4864:20::f30] (port=44784 helo=mail-qv1-xf30.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFvOZ-0007QU-3L for bug-gnu-emacs@gnu.org; Fri, 04 Feb 2022 05:00:48 -0500 Original-Received: by mail-qv1-xf30.google.com with SMTP id s6so4879675qvv.11 for ; Fri, 04 Feb 2022 02:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=jaEaLs7WcoB+8n39Pd7n+nGBSsnlKnfpOetDrfUzDqc=; b=ZrLfjJLMYVoimYLfwF/5nMpBD4eYWprxdaKbVCHRTIjZ3GxkytzNyw6JEiJJJ0lQOZ VmKkH8WeWvAeHNisWmV9eKUc3/ySVENJhJjjsS8+W9A0YQUsJHZwCXb2ZWAjadPtJs8d qXYnGxdfwKLrgwPRGNhkayAd6jG+Kh80qhwoQUscuPG5+X3O5MPFOtuB4Z3QuRQ1lCgJ 36NBe/s2PVmr/Ob/Mik22QpwSl8qPOrJWU2ObjCnpdbavHHSnRbK4C6ii1BqdRdMxQoD oIXlFRTUv6fvWvPrJfslQxC811P63Pt7ZOjp+SIx5Z5ADHhFLa2zoDIdu59bZh4LL2oF FdtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=jaEaLs7WcoB+8n39Pd7n+nGBSsnlKnfpOetDrfUzDqc=; b=0GYUV7iVaevG3EQKp4d/2E8M/sL8m8YYK4A65HZbfG6BzV8xxlPTEpogakAO17fP7Z HtKc2GNH5cUl4Ct9vlAdcIh/uFjrlJFoL75Vlxxa5yeXmcSwaDaqNf36TgSzlzpe/VKP qAWDItTYxhnUu1aLytJCC5tap8VhvWRKKKhFi79OdHJmPrHNjkPaupzh8k4r6ydQGkUy eaCNDGJwyhMGcl+JeZsKqph5bxwn8mqO2B0vlEb534tUldutRRsQuH7XvPrw+4N4RFvd W5Ex7BqfQxM7hARLiZ/6zYyzAQYR/0Rjp/l5aHo+tG/wbmGEZu7O+2ubnQALSfxRlMCC /i5Q== X-Gm-Message-State: AOAM533SNMWUlFbSmbZHy2VOtVGGXQHV5uKnft2p8Xzni3qZFwpohWwm E4PSbk/qgHzg27v/Ev6J89S0TqHa/zRH8cv5UghnQ0ADyss= X-Google-Smtp-Source: ABdhPJySnhyyhy4FLnnTeoTwySjtU5OFfbgm48noB3IL4VIZXStDRdGGMgnDN3r17fXnkkMbZUG9qNj7EkOEj+Y/eqs= X-Received: by 2002:a05:6214:3010:: with SMTP id ke16mr1415554qvb.57.1643968841349; Fri, 04 Feb 2022 02:00:41 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f30 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f30; envelope-from=greselin.andrea@gmail.com; helo=mail-qv1-xf30.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:225978 Archived-At: --000000000000cf81b605d72e529b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello everyone :-) When =E2=80=98delete-selection-mode=E2=80=99 and =E2=80=98transient-mark-mo= de=E2=80=99 are enabled, there=E2=80=99s 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 =E2=80=98flyspell-check-word-p=E2=80=99. The region is deactivated but the = overlay is not updated to reflect that. If I understand correctly the delay (indicated by =E2=80=98<---=E2=80=99 be= low) 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 ((<=3D (- (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=3D "" 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)))) --000000000000cf81b605d72e529b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello everyone :-)

When = =E2=80=98delete-selection-mode=E2=80=99 and =E2=80=98transient-mark-mode=E2= =80=99 are enabled,
there=E2=80=99s an active region and I type a char= acter, the region is
immediately deactivated. In Flyspell mode, though, = the unhighlighting
of the deactivated region is delayed by the function<= br>=E2=80=98flyspell-check-word-p=E2=80=99. The region is deactivated but t= he overlay is
not updated to reflect that.

If I understand correc= tly the delay (indicated by =E2=80=98<---=E2=80=99 below) is
used by = Flyspell to give the user some time for typing before
highlighting a wor= d as mispelled, but in this case it ends up
delaying also the refresh of= the region overlay.

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