GNU bug report logs - #60841
30.0.50; kill-ring-save pauses despite region being highlighted

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Kévin Le Gouguec <kevin.legouguec@HIDDEN>; dated Sun, 15 Jan 2023 23:39:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 28 Jan 2023 18:07:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 28 13:07:41 2023
Received: from localhost ([127.0.0.1]:41487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pLpc5-0006kS-2Y
	for submit <at> debbugs.gnu.org; Sat, 28 Jan 2023 13:07:41 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34472)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pLpc2-0006kC-N7
 for 60841 <at> debbugs.gnu.org; Sat, 28 Jan 2023 13:07:39 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pLpbx-00065w-GA; Sat, 28 Jan 2023 13:07:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=H/QN5Rvdw3gU633vlT91Oyh4D2FfhlhSpM8oz/11sSk=; b=eMcJeQp5bk4O5O9Zn2a4
 vGjNWHoIK0h18GpPy8nMlDWa0dnxM1tN0z+uyedL9l6KIFfA8eXY8CWKG4YuQg86oBQeKBDxEH5Zg
 FaAjM92Uar34cD52Ex97ghZkwhR2nBgLfZOLPy0heoRgCbEStmnsO1O7eVM8VSKw1cHE06fuLptPb
 f6RijJdPZ94o0fq2NvdwNmjADxk6FtAnUd6hnd8yO09jSUJS0hSEkf4lM8AH6/mqbdfPOH1SSBKKK
 xOoqWfzPC/+3QSP3IpM/TlX3Sm2SK3t8qvd41a0R7AuWHquPXUky5NpT5oxYRuFndaqznyQNuNepe
 nZMTdIDGrryDtw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pLpbw-0007Wx-NU; Sat, 28 Jan 2023 13:07:33 -0500
Date: Sat, 28 Jan 2023 20:07:21 +0200
Message-Id: <831qnea5ye.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
In-Reply-To: <87h6wawo2k.fsf@HIDDEN> (message from =?utf-8?Q?K=C3=A9vin?=
 Le Gouguec on Sat, 28 Jan 2023 18:45:07 +0100)
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
 <834jskmhs8.fsf@HIDDEN> <87fsc2qjcs.fsf@HIDDEN>
 <833581jtff.fsf@HIDDEN> <87lelsga1f.fsf@HIDDEN>
 <83r0vkgj7l.fsf@HIDDEN> <87h6wawo2k.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Kévin Le Gouguec <kevin.legouguec@HIDDEN>
> Cc: gregory@HIDDEN,  60841 <at> debbugs.gnu.org
> Date: Sat, 28 Jan 2023 18:45:07 +0100
> 
> diff-mode.el (re. smerge-mode.el) can indeed be fooled into thinking
> diff-changed (re. smerge-refined-changed) differs-from-default, if one
> "shoots their own foot", for example, setting…
> 
> * :extend t:         fixed by this patch                    ✔️
> * :stipple nil:      foot blown with or without the patch   🤷
> * :inherit 'default: foot blown with or without the patch   🤷
> 
> Problem with :stipple nil and :inherit 'default explained in [1].
> indicate-copied-region will become affected if the current patch goes
> in.

I wouldn't be bothered by :stipple whose value is nil.  Why would
someone do such a thing, except when the face is meant to be merged
with other faces (which are expected to have non-nil :stipple
attributes)?

> > Alternatively, we could add a user option to make the swap
> > unconditional, because maybe some users would prefer that to splitting
> > hair in this case.  Then we could stop worrying about all those fine
> > differences.
> 
> Should I cook up a user option to unconditionally do the swap before we
> apply the attached?  Otherwise we may disgruntle trunk users who
> actually liked the behaviour I reported in the OP (swapping regardless
> of whether region stands out).

I guess adding such an option would be a good precaution, indeed.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 28 Jan 2023 17:45:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 28 12:45:19 2023
Received: from localhost ([127.0.0.1]:41458 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pLpGQ-00066e-N8
	for submit <at> debbugs.gnu.org; Sat, 28 Jan 2023 12:45:19 -0500
Received: from mail-wr1-f49.google.com ([209.85.221.49]:43878)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pLpGN-00066J-J2
 for 60841 <at> debbugs.gnu.org; Sat, 28 Jan 2023 12:45:16 -0500
Received: by mail-wr1-f49.google.com with SMTP id h12so7631220wrv.10
 for <60841 <at> debbugs.gnu.org>; Sat, 28 Jan 2023 09:45:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=nVcacDduJHITDbTJ6dV+hdQn/wTWgaRXThLOM7Yeb+8=;
 b=W3yIfYnVBTBWo0S09D3TGsIDQnVlmvDSSKSRZPX3Q0+WiwtRoQxOZPIYujML0DTuNz
 KAlsvCEPSLELJCbdMk6SFih1/06G8Ib335iJ6ZvUlrsuyGBl/XhbxVQKNRnjI95MYU2E
 KAkQxOztTHFsGdLG0pJuVFJmOxEq2jP9Dy56JC1tAyRrKNq1D0nySOzwTI0ERS1z2J4M
 4Ntl5dqb326YF3uyY6ZVT8lLR/sc+wa7g9nZW/kITXS2sxleYZ098YnSfjquduMEAuTV
 RvwMRcq3TzR0BZPrNO50/+4Bkn1jq1yZbCuFV9artgfqqAC2B9JsAkiAzGkqMFBi5iDI
 wNuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=nVcacDduJHITDbTJ6dV+hdQn/wTWgaRXThLOM7Yeb+8=;
 b=CPvqfphKcEYxmmtzY2m01L6mpxYiv3bbnMjYvyIOtzA95whm5eTQTBgU25xXMhEXre
 uBfIQRQVDxVICAOYgI+ZcHd9eiL8Tg9c1oVTH0UgzZ2f6oaBZl5jAjeVfdksh79SyMKi
 6mHOpG54D2TwGKQest6gNHa5YLXwYNrObzM87Ildc5EiNKTfMs6uegzId7Eq4nWVAAhA
 +aJZtspcaATR5I21w0g5G2iAyzkXUoV66w0qpEP36vkMuNQcYBNFZm3hTMCJKQWl3mB3
 k4nzB3hcdNmOj2unCMJLem60n7mnFoL/RFz4CCTud00LLWZH1/gVV2kg3gJTUMTxJ2Qi
 3J8Q==
X-Gm-Message-State: AO0yUKWuSRB+ZWY3trnjWYFC+3ZeD3+NpM6+aqiSTkQm1YAp7oHuqcEP
 v+xdOv92aRevl1WOJNd/h48+EAcjcpM=
X-Google-Smtp-Source: AK7set/pjcIclwwyF5MQ2OYkKr3iwqgBHKG+PhPpzLAz8gNJIfvvzV0O8k/WXhyxPwSLCQMi0F648Q==
X-Received: by 2002:a5d:534c:0:b0:2bf:cfc0:ac71 with SMTP id
 t12-20020a5d534c000000b002bfcfc0ac71mr7399511wrv.53.1674927909276; 
 Sat, 28 Jan 2023 09:45:09 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 v14-20020adfe4ce000000b002bfafadb22asm7466150wrm.87.2023.01.28.09.45.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 28 Jan 2023 09:45:08 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <83r0vkgj7l.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 24 Jan
 2023 15:23:10 +0200")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
 <834jskmhs8.fsf@HIDDEN> <87fsc2qjcs.fsf@HIDDEN>
 <833581jtff.fsf@HIDDEN> <87lelsga1f.fsf@HIDDEN>
 <83r0vkgj7l.fsf@HIDDEN>
Date: Sat, 28 Jan 2023 18:45:07 +0100
Message-ID: <87h6wawo2k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Revised patch attached; intended as "good for master".


Answers to open discussion points:

> Can you see if any of these changes cause any trouble in our own use
> of face-differs-from-default-p?  AFAICT, it will actually fix a subtle
> problem in diff-mode.el: if diff-changed face doesn't define
> non-default colors, it will be still taken as different from
> 'default', which I think is contrary to what diff-mode expects.

diff-mode.el (re. smerge-mode.el) can indeed be fooled into thinking
diff-changed (re. smerge-refined-changed) differs-from-default, if one
"shoots their own foot", for example, setting=E2=80=A6

* :extend t:         fixed by this patch                    =E2=9C=94=EF=B8=
=8F
* :stipple nil:      foot blown with or without the patch   =F0=9F=A4=B7
* :inherit 'default: foot blown with or without the patch   =F0=9F=A4=B7

Problem with :stipple nil and :inherit 'default explained in [1].
indicate-copied-region will become affected if the current patch goes
in.

replace.el:occur-1 befuddled me for a moment[2], but the tl;dr is that
it will be none the worse for wear.

> > >> (Hm, and against my better judgement I went ahead and compared
> > >> gui_supports_face_attributes_p vs tty_supports_face_attributes_p, an=
d I
> > >> see that they handle :extend differently and *mashes C-c C-c with
> > >> forehead before fingers can type another wall of text*)
> > >
> > > TTY frames always extend the color, that's the reason for the
> > > difference.
> >=20
> > (Not sure I get your meaning here; on the Linux TTY I have on hand,
> > (set-face-extend 'region nil) does disable color extension)
>=20
> I'm sorry, you will have to look up the discussion that led to the
> development of the :extend attribute; I cannot afford searching for
> it.  The differences between TTY and GUI frames were one of the main
> reasons why we introduced this attribute.

Playing around with more terminals did not yield more insights[3], so it
seems I'll need to dig into the archives, indeed.

Currently squinting at emacs-devel:<83r2fbg5bq.fsf@HIDDEN>, which
singles out NS versus X, Windows & TTYs; could this be what you had in
mind?

> Alternatively, we could add a user option to make the swap
> unconditional, because maybe some users would prefer that to splitting
> hair in this case.  Then we could stop worrying about all those fine
> differences.

Should I cook up a user option to unconditionally do the swap before we
apply the attached?  Otherwise we may disgruntle trunk users who
actually liked the behaviour I reported in the OP (swapping regardless
of whether region stands out).


                                   =E2=81=82
                               footnotes
                                   =E2=81=82

[1]

  (face-differs-from-default-p 'default)
  =E2=86=A6 :stipple
  (display-supports-face-attributes-p '(:stipple nil))
  =E2=86=A6 t

So a face that explicitly inherits from 'default, or sets :stipple to
nil (rather than 'unspecified) differs-from-default-p.

This seems inappropriate, based on display-supports-face-attributes-p's
docstring:

> The definition of =E2=80=98supported=E2=80=99 is somewhat heuristic, but =
basically means
> that a face containing all the attributes in ATTRIBUTES, when merged
> with the default face for display, can be represented in a way that=E2=80=
=99s
>=20
>  (1) different in appearance from the default face, and
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  (2) =E2=80=98close in spirit=E2=80=99 to what the attributes specify, if=
 not exact.

I can debug gui_supports_face_attributes_p if we agree that there is
something to investigate here?

[2]

  (if (face-differs-from-default-p list-matching-lines-prefix-face)
      list-matching-lines-prefix-face)

> If this face will display the same as the default face, the prefix
> column will not be highlighted specially.
=E2=80=94 C-h v list-matching-lines-prefix-face

Why bother with this `if' then?  Isn't this gratuituous complexity?
Just passing the face regardless would have the same effect (the prefix
column will look like it has the default face).

[3]

>                                            Maybe what I remember
> happens only on some terminals.

AFAICT, :extend {nil,t} successfully make the background {stop at,extend
past} EOL on these terminals:

* Linux TTYs (openSUSE Tumbleweed: Linux 6.1.7-1-default x86_64,
              Debian 11:           Linux 5.10.0-19-amd64 x86_64)
* VTE-based pseudo terminals (terminator, xfce4-terminal)
* Plasma's konsole
* xterm

>                                  Or maybe I'm misremembering and it
> was because of underline and not the color.

* Linux TTYs don't support :underline AFAICT,
* all pseudo terminals listed above do, and :extend nil/t both do TRT.

>                                              But there is definitely a
> difference.

ACK.  Based on vc-region-history alone it feels like
tty_supports_face_attributes_p just got left out of the :extend party,
but I'll see what turns up in the lists.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Avoid-spurious-pause-in-kill-ring-save-Bug-60841.patch

From 9ec48654977d7c8b7a26e99fce6693d67d023599 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@HIDDEN>
Date: Sun, 15 Jan 2023 19:23:17 +0100
Subject: [PATCH] Avoid spurious pause in kill-ring-save (Bug#60841)

'indicate-copied-region' checks whether the region is "highlighted"
and if not, briefly moves point to mark to give a visual cue of the
extent of text that was saved to the kill ring.

The region is considered "highlighted" if (a) it is active and (b) its
face specifies a :background.  That latter condition does not account
for the multiple ways in which the face can make the region "visually
distinct" from the default face, so switch to a more extensive
predicate.

* lisp/simple.el (region-stands-out-p): New function to detect "if the
region is highlighted", leveraging face-differs-from-default-p.
(indicate-copied-region): Use it.
* lisp/faces.el (face-differs-from-default-p): Also ignore :extend,
since the answers display-supports-face-attributes-p gives for that
attribute do not help determine whether FACE is visually distinct from
default.
---
 lisp/faces.el  | 11 ++++++++++-
 lisp/simple.el | 10 ++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/lisp/faces.el b/lisp/faces.el
index 3323eab205a..4933b495a6c 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -304,7 +304,16 @@ face-differs-from-default-p
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
   (let ((attrs
-	 (delq :inherit (mapcar 'car face-attribute-name-alist)))
+         ;; The _value_ of :inherit teaches us nothing about how FACE
+         ;; looks compared to the default face.  Instead, we will ask
+         ;; `face-attribute' to take inheritance into account when
+         ;; examining other attributes.
+         (delq :inherit
+               ;; A difference in extension past EOL only matters when
+               ;; relevant attributes (such as :background) also
+               ;; differ from the default; otherwise this difference
+               ;; is a false positive.
+               (delq :extend (mapcar 'car face-attribute-name-alist))))
 	(differs nil))
     (while (and attrs (not differs))
       (let* ((attr (pop attrs))
diff --git a/lisp/simple.el b/lisp/simple.el
index 7bda368d85d..ef816949d36 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5871,6 +5871,13 @@ copy-region-blink-delay
   :group 'killing
   :version "28.1")
 
+(defun region-stands-out-p ()
+  "Whether the region can be distinguished visually.
+This takes into account whether the region is active, and whether
+the `region' face displays differently from the default face."
+  (and (region-active-p)
+       (face-differs-from-default-p 'region)))
+
 (defun indicate-copied-region (&optional message-len)
   "Indicate that the region text has been copied interactively.
 If the mark is visible in the selected window, blink the cursor between
@@ -5891,8 +5898,7 @@ indicate-copied-region
 	;; was selected.  Don't do it if the region is highlighted.
 	(when (and (numberp copy-region-blink-delay)
 		   (> copy-region-blink-delay 0)
-		   (or (not (region-active-p))
-		       (not (face-background 'region nil t))))
+		   (not (region-stands-out-p)))
 	  ;; Swap point and mark.
 	  (set-marker (mark-marker) (point) (current-buffer))
 	  (goto-char mark)
-- 
2.39.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 24 Jan 2023 13:23:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 24 08:23:08 2023
Received: from localhost ([127.0.0.1]:56139 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pKJGW-0004aI-GX
	for submit <at> debbugs.gnu.org; Tue, 24 Jan 2023 08:23:08 -0500
Received: from eggs.gnu.org ([209.51.188.92]:43708)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pKJGU-0004Zm-QD
 for 60841 <at> debbugs.gnu.org; Tue, 24 Jan 2023 08:23:07 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pKJGP-00061a-2u; Tue, 24 Jan 2023 08:23:01 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=VSiJTr3KKbiVhXaFLoeHBsrsU40iMUuYILKou3hDqxo=; b=qvuYPDkZWOLxA1ZnClbX
 HmYyOqisx3SmUovYNZeniGMGreT5T/GVPGrmQrzGP7OB767Itt4BXhnerlA8aJBW9Zq6hBWrHFJ9v
 de/hp0Y20kHkPTKDtKuaXrIPiibVTE1Mb+q0UQkEE7wzPqbD4DaIMbeQ7QjUWXYZX2JKY5WWKr/EW
 KevMY3EVTbFYzykTEBwy5nqb/fdjZoo8RpMgj2J5bdZvicbiKO+gMf3yt2H/HZUNj6dVFqDVZKVL9
 V+gWuuEDciSLtT03LpUIj3GpRtvcoTPLrTkFA2vbLRsHLdBbldXZ96obZ3dQECq7qjRS1n8O2NDvm
 mVgGA1QT7ms7iw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pKJGO-00026w-Dw; Tue, 24 Jan 2023 08:23:00 -0500
Date: Tue, 24 Jan 2023 15:23:10 +0200
Message-Id: <83r0vkgj7l.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
In-Reply-To: <87lelsga1f.fsf@HIDDEN> (message from =?utf-8?Q?K=C3=A9vin?=
 Le Gouguec on Mon, 23 Jan 2023 23:29:00 +0100)
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
 <834jskmhs8.fsf@HIDDEN> <87fsc2qjcs.fsf@HIDDEN>
 <833581jtff.fsf@HIDDEN> <87lelsga1f.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Kévin Le Gouguec <kevin.legouguec@HIDDEN>
> Cc: gregory@HIDDEN,  60841 <at> debbugs.gnu.org
> Date: Mon, 23 Jan 2023 23:29:00 +0100
> 
> > seq.el is indeed preloaded, so that ship has sailed.  But you still
> > need to make sure seq is loaded _before_ any preloaded file which uses
> > it, and in this case faces is loaded before seq, so you cannot use
> > seq-difference.
> 
> (Thanks for spelling this out.  Do we have any documentation that calls
> out the precautions one must take when writing Elisp that will be
> preloaded, or any tooling that can detect whether some of those
> precautions were forgotten?  FWIW I saw no compiler warnings nor runtime
> errors with that patch)

Did you "make bootstrap"?  If not, some errors might not happen,
because the build will use previously compiled foo.elc files.

As for documentation: there's any number of such factoids related to
do's and dont's of Emacs development, and we lack a full-time
documentation fellow to keep all of them documented and up to date...

> >> +(defun region-highlighted-p ()
> >> +  "Say whether the region is visibly highlighted.
> >
> > Please drop the "Say" part, it's not our style.
> 
> ACK.  I see a few matches for "Return whether…" in-tree; would…
> 
>   Return whether the region stands out visually.
> 
> … be OK, or should I just go for…

It's OK, but IMO the "Return" part is almost redundant here.  But I
won't object to having it.

> "(elisp) Documentation Tips" recommends "Return t if", but merely as a
> way to "avoid starting the sentence with “t”", not because we have a
> preference for literally starting with "Return t if")

The point here is that this is a predicate, so it is known up front
that it will "return t" or nil.  The only non-trivial part is the
condition under which it will return non-nil.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 23 Jan 2023 22:29:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 23 17:29:11 2023
Received: from localhost ([127.0.0.1]:55509 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pK5JO-0003OQ-J1
	for submit <at> debbugs.gnu.org; Mon, 23 Jan 2023 17:29:10 -0500
Received: from mail-wr1-f51.google.com ([209.85.221.51]:46738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pK5JM-0003OA-Et
 for 60841 <at> debbugs.gnu.org; Mon, 23 Jan 2023 17:29:09 -0500
Received: by mail-wr1-f51.google.com with SMTP id e3so12184672wru.13
 for <60841 <at> debbugs.gnu.org>; Mon, 23 Jan 2023 14:29:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=1bCYGberoghkt3IpHR2u0FrB9pwa7XUIDCxDcBGSvEs=;
 b=cvecLSkfC8flwr+3bK/kKR6FYR6i5rtCmFnN1GKGSy/SgJPImvkyCKk8LG8lbqrUeI
 Ya38hlC/9NO/ZaXSM/TKufRb7wIJRufyVog9kbvQbMqxlyb4Lf7yXx9TPth8RXmK0MmT
 SajjnYgRabPg9FhH1GaCwsrO0fVfvv1wvOWaAKLd60qQRDWlDiGVx9/BbDAS0rKEVDQm
 k+yd+gPEP5Zc0BPSUB/7EiECq7NVsqOYGJVbG92X27ZRATg+LW7LngycnJwWGpMkmHZ3
 ytgWtyoF2PfLoqYcIaxxJ+bKha3GaD/5pG/jUryXAG9VRqAC+7OftEKMIfciq//idYyZ
 TZ4g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=1bCYGberoghkt3IpHR2u0FrB9pwa7XUIDCxDcBGSvEs=;
 b=QtJpRaIHQgJt/xMMCzidK7S+Xq60WNCyaXKyOnoTxsLeX0Fm+eMmDhrbK4YpO83FZM
 3+rEuMljcMbiOGL4Y5TsidfATnejA3pbMYgT7lhByJJ9EIQUyzhGfpOot6PhdxeGI/ob
 Gt7awXLsRPNdqLMAGzuDSlRbIHU4cCS4WBLcbpsc5L+zIbs4G7S0biWlenXkufWTnsal
 NIhKftSJp7zoGq7PCAQwkF7HsddptNd9I8AA4QMjB2G5McOAcO8StprE5Lb4FZGB6k2Z
 dwiIy/niObgsJ9rV6Xmx8ak0jAoCXg28qc4PU/281gUy3BaPXDREGofCMnG9hV+XhtAI
 m/eA==
X-Gm-Message-State: AFqh2krcSkQpyJNc1fD+L02CJ3MSgqQ68sPF6CstmTIVZNegshsnC/pF
 ds19VJM/2blxkUio4pLgRSqlVN/o4Hk=
X-Google-Smtp-Source: AMrXdXt6NcjeJiXcNNl/D59yfJAG7X5XALufpU59JzQ19saE4SIbtY/Ec9T9UGrSw6yNOo5EjTnqCw==
X-Received: by 2002:adf:dcd2:0:b0:2bb:ebc4:2f5c with SMTP id
 x18-20020adfdcd2000000b002bbebc42f5cmr32034081wrm.43.1674512942143; 
 Mon, 23 Jan 2023 14:29:02 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 v7-20020a5d6107000000b002bdc914a139sm437788wrt.108.2023.01.23.14.29.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 23 Jan 2023 14:29:01 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <833581jtff.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 23 Jan
 2023 15:01:56 +0200")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
 <834jskmhs8.fsf@HIDDEN> <87fsc2qjcs.fsf@HIDDEN>
 <833581jtff.fsf@HIDDEN>
Date: Mon, 23 Jan 2023 23:29:00 +0100
Message-ID: <87lelsga1f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> * that seq-difference call makes me inexplicably nervous; I thought I
>>   vaguely remembered debates on whether preloaded libraries {c,sh}ould
>>   use seq.el functions, but then I see that "emacs-lisp/seq" is already
>>   in preloaded-file-list, and e.g. rmc.el calls some of its functions.
>>   Am I misremembering?
>
> seq.el is indeed preloaded, so that ship has sailed.  But you still
> need to make sure seq is loaded _before_ any preloaded file which uses
> it, and in this case faces is loaded before seq, so you cannot use
> seq-difference.

(Thanks for spelling this out.  Do we have any documentation that calls
out the precautions one must take when writing Elisp that will be
preloaded, or any tooling that can detect whether some of those
precautions were forgotten?  FWIW I saw no compiler warnings nor runtime
errors with that patch)

> And, btw, I cannot say I understand why using seq-difference here is
> justified.  Why not just call delq twice and be done?

That would work, of course; will go with that for the next revision.

(No justification beyond lack of practice at reading or writing
"preloaded Elisp", so my brain takes a couple more cycles to translate
(delq 'a (delq 'b x)) into "x \ {a,b}")

>> >> (Hm, and against my better judgement I went ahead and compared
>> >> gui_supports_face_attributes_p vs tty_supports_face_attributes_p, and=
 I
>> >> see that they handle :extend differently and *mashes C-c C-c with
>> >> forehead before fingers can type another wall of text*)
>> >
>> > TTY frames always extend the color, that's the reason for the
>> > difference.
>>=20
>> (Not sure I get your meaning here; on the Linux TTY I have on hand,
>> (set-face-extend 'region nil) does disable color extension)
>
> I'm sorry, you will have to look up the discussion that led to the
> development of the :extend attribute; I cannot afford searching for
> it.

(Did I mention I'm grateful for the time you and Gregory did afford for
this obscure issue, considering how busy this rc phase is?)

>      The differences between TTY and GUI frames were one of the main
> reasons why we introduced this attribute.  Maybe what I remember
> happens only on some terminals.  Or maybe I'm misremembering and it
> was because of underline and not the color.  But there is definitely a
> difference.

ACK, will look into this.

>> +(defun region-highlighted-p ()
>> +  "Say whether the region is visibly highlighted.
>
> Please drop the "Say" part, it's not our style.

ACK.  I see a few matches for "Return whether=E2=80=A6" in-tree; would=E2=
=80=A6

  Return whether the region stands out visually.

=E2=80=A6 be OK, or should I just go for=E2=80=A6

  Return non-nil if the region stands out visually.

?

(Asking because I have a (tiny, subduable) preference for the former;
predicate docstrings that call out nil/t/non-nil force me to pause and
figure out whether I need to negate the rest of the sentence, whereas
"whether" generally precedes a description of the "true" case.

"(elisp) Documentation Tips" recommends "Return t if", but merely as a
way to "avoid starting the sentence with =E2=80=9Ct=E2=80=9D", not because =
we have a
preference for literally starting with "Return t if")

> And I'd use some other word instead of "highlighted", because that
> could be misinterpreted (the region is supposed to be highlighted).
> Something like "stands-out" perhaps?

Agreed.  stands-out works for me (other candidates that come to mind:
noticeable, conspicuous).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 23 Jan 2023 13:02:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 23 08:02:01 2023
Received: from localhost ([127.0.0.1]:53593 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJwSX-00068F-9v
	for submit <at> debbugs.gnu.org; Mon, 23 Jan 2023 08:02:01 -0500
Received: from eggs.gnu.org ([209.51.188.92]:46482)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pJwSR-00067U-ME
 for 60841 <at> debbugs.gnu.org; Mon, 23 Jan 2023 08:01:57 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJwSL-0003gR-P3; Mon, 23 Jan 2023 08:01:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=YyvjWympu+v8EOEFZLN1CkN22DDj5fadoB5M9ar+FlU=; b=BvFUc2iA/Jiu3yzls71Z
 MctXWWgRpO1IZYNheW5u/72Akx2DXEY4Zp2hoUbR8q4r7/r0JZOodvcOcBHT1C54gVrcgX8MhsGi+
 jTrpq+GN1IoU6kh5fwvCfp9KFFO3t1QStT2bOlKRl7CMXP9o7gIg5FgG+iGyCef9V1wnNEO/YlUhC
 sXRY+LBBc/VVRPYiRQYbejhjg3XOYCCyOZias/YqRaGPYc2+ylk/OBD0tDSk4WC8dvvA3cp14P/Z3
 DBa0otK9tOK02wohE95UUFmtuQGHQA1w3Y/aL+6/w8zIloUHZ5ruvoOg6z5iKutivrx7e1HNSzqPL
 hPGgq22iXUPDgg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJwSK-000099-Ks; Mon, 23 Jan 2023 08:01:49 -0500
Date: Mon, 23 Jan 2023 15:01:56 +0200
Message-Id: <833581jtff.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
In-Reply-To: <87fsc2qjcs.fsf@HIDDEN> (message from =?utf-8?Q?K=C3=A9vin?=
 Le Gouguec on Sun, 22 Jan 2023 23:45:23 +0100)
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
 <834jskmhs8.fsf@HIDDEN> <87fsc2qjcs.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Kévin Le Gouguec <kevin.legouguec@HIDDEN>
> Cc: gregory@HIDDEN,  60841 <at> debbugs.gnu.org
> Date: Sun, 22 Jan 2023 23:45:23 +0100
> 
> > The default face is always extended, so it should be treated as
> > implicitly having the :extend attribute set.
> >
> > I think face-differs-from-default-p should be fixed to either ignore
> > the :extend attribute like it ignores :inherit (since it could be
> > argued that :extend doesn't really control how the face affects
> > characters on display), or it should treat the default face as having
> > the :extend attribute with the value t.
> 
> I have been slowly converging toward "ignore :extend" being TRT.

Fine by me.

> * that seq-difference call makes me inexplicably nervous; I thought I
>   vaguely remembered debates on whether preloaded libraries {c,sh}ould
>   use seq.el functions, but then I see that "emacs-lisp/seq" is already
>   in preloaded-file-list, and e.g. rmc.el calls some of its functions.
>   Am I misremembering?

seq.el is indeed preloaded, so that ship has sailed.  But you still
need to make sure seq is loaded _before_ any preloaded file which uses
it, and in this case faces is loaded before seq, so you cannot use
seq-difference.

And, btw, I cannot say I understand why using seq-difference here is
justified.  Why not just call delq twice and be done?

> >> (Hm, and against my better judgement I went ahead and compared
> >> gui_supports_face_attributes_p vs tty_supports_face_attributes_p, and I
> >> see that they handle :extend differently and *mashes C-c C-c with
> >> forehead before fingers can type another wall of text*)
> >
> > TTY frames always extend the color, that's the reason for the
> > difference.
> 
> (Not sure I get your meaning here; on the Linux TTY I have on hand,
> (set-face-extend 'region nil) does disable color extension)

I'm sorry, you will have to look up the discussion that led to the
development of the :extend attribute; I cannot afford searching for
it.  The differences between TTY and GUI frames were one of the main
reasons why we introduced this attribute.  Maybe what I remember
happens only on some terminals.  Or maybe I'm misremembering and it
was because of underline and not the color.  But there is definitely a
difference.

> +(defun region-highlighted-p ()
> +  "Say whether the region is visibly highlighted.

Please drop the "Say" part, it's not our style.

And I'd use some other word instead of "highlighted", because that
could be misinterpreted (the region is supposed to be highlighted).
Something like "stands-out" perhaps?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 22 Jan 2023 22:45:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 22 17:45:37 2023
Received: from localhost ([127.0.0.1]:52781 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJj5k-0003bu-Em
	for submit <at> debbugs.gnu.org; Sun, 22 Jan 2023 17:45:37 -0500
Received: from mail-wm1-f49.google.com ([209.85.128.49]:40804)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pJj5f-0003bb-Kb
 for 60841 <at> debbugs.gnu.org; Sun, 22 Jan 2023 17:45:35 -0500
Received: by mail-wm1-f49.google.com with SMTP id
 e19-20020a05600c439300b003db1cac0c1fso7928842wmn.5
 for <60841 <at> debbugs.gnu.org>; Sun, 22 Jan 2023 14:45:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=7bpPSPgt3H6kWVVAE0L1Ucduvyn1vf1feVTTAa+DZhQ=;
 b=hMMnV2bt6xJpdGnBYa/x/QyTEt3JNm4eYUuh+kQie4LbbYzQo71vc14KE8xJOnak4H
 lgZPj4U9zGIVPA62ozFAf3tNhP2Q9JtSVfbL2IGt4tVdJCI6w9s31zJgvckN+2r2zkHR
 +Xa1X7aV8Z37hz594oe7eZDkRBEyhpTheeh03Y+Qwa629IzAJSy3+yOAjAYKVh14pqNz
 HZohFJZm6D9A4sDzuj3x/Jx0uB3009oTFXNyUE9yrGjMhgNC1siwUvruubWrz99nE06j
 CNTCuBGkwNPJhkPLCTFaz/dyFp4/doUesHGnkyZo6IxrsBVfuvTMAKVhjrjnrzCIq2Cf
 MkEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=7bpPSPgt3H6kWVVAE0L1Ucduvyn1vf1feVTTAa+DZhQ=;
 b=GCi3FDGwKMASIKnwbeiORwShwC9bU7Jmo7zuLBDQfbNjUWxJV0MGNKE4XV3wND5WHa
 C4rtOljFGsox39RuKdZdX/n5ONHHP0/+G/1YfBRmO69tIPxRxE0hyFLL+PAPvKYYzbOS
 nKIEcQfQVTiQVrKcwvSwueH7OsRboLufVIh9KX6XbOMkoM/5ZBZwkM4Z8jUIihUL1QtU
 C69LNmDSRSonP5gR0lAQKM1DyQBECYeGbt/D+qebr8gYyS2DkwF+C4z7bBoJ5ekVeqgZ
 gv8uz2/m+h1sS2pk5KWl58XVAXZbflXRh6lJaMTJ51jluGXqz3XL6S9CZr1ALJ2t9mw7
 /FVw==
X-Gm-Message-State: AFqh2krKdwWftgWS7o8boK2udba6jBpU0CcIGVlfPrHL8Cf2SP0F2Kin
 8NFWwpRvmNjreUUbDXRUVmRUSZYv/Cw=
X-Google-Smtp-Source: AMrXdXsYtA9Ort5XviAmq+k4hetx+FlOn1ZvEbZ4rccOo9j6qI/+tX2jjGO8UZwMowiVvomXXKxhYw==
X-Received: by 2002:a05:600c:1d0f:b0:3db:9ed:aaf8 with SMTP id
 l15-20020a05600c1d0f00b003db09edaaf8mr20335591wms.33.1674427525231; 
 Sun, 22 Jan 2023 14:45:25 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 i8-20020a05600c4b0800b003da2932bde0sm10230421wmp.23.2023.01.22.14.45.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 22 Jan 2023 14:45:24 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <834jskmhs8.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 21 Jan
 2023 10:08:23 +0200")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
 <834jskmhs8.fsf@HIDDEN>
Date: Sun, 22 Jan 2023 23:45:23 +0100
Message-ID: <87fsc2qjcs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: K=C3=A9vin Le Gouguec <kevin.legouguec@HIDDEN>
>> Cc: gregory@HIDDEN,  60841 <at> debbugs.gnu.org
>> Date: Wed, 18 Jan 2023 23:16:34 +0100
>>=20
>> > * :extend nil for both: they display differently (region will not be
>> >   extended, default will be),
>> > * :extend t for both: they display the same,
>> > * default has nil, region has t: they display the same,
>> > * default has t, region has nil: they display differently.
>
> The default face is always extended, so it should be treated as
> implicitly having the :extend attribute set.
>
> I think face-differs-from-default-p should be fixed to either ignore
> the :extend attribute like it ignores :inherit (since it could be
> argued that :extend doesn't really control how the face affects
> characters on display), or it should treat the default face as having
> the :extend attribute with the value t.

I have been slowly converging toward "ignore :extend" being TRT.

I cannot find a situation where :extend matters.  AFAICT "does this face
stand out vs 'default?" always comes down to whether the face's
:underline or :background _also_ differs, so :extend seems redundant.
Breakdown in footnote[1].

(Have been going back and forth over this; apologies if I've missed
something and that conclusion is wrong)

> Can you see if any of these changes cause any trouble in our own use
> of face-differs-from-default-p?  AFAICT, it will actually fix a subtle
> problem in diff-mode.el: if diff-changed face doesn't define
> non-default colors, it will be still taken as different from
> 'default', which I think is contrary to what diff-mode expects.

Will do; that was on my checklist[2] whichever solution we eventually
pick.

> If we make the above change in face-differs-from-default-p, would
> using it for the purpose of this issue fix the problem?

I think so.  Scribbled the attached patch; will report once I've tested
it more thoroughly against

(a) the :inverse-video use-case from my OP,
(b) the "region with unspecified :background" use-case from emacs-devel,
(c) other in-tree users of face-differs-from-default-p.

In the meantime, let me know if it looks good in principle; there are
still details I'd like to tweak FWIW.  E.g.

* face-differs-from-default-p probably deserves a comment explaining
  what's going on wrt these attributes,

* that seq-difference call makes me inexplicably nervous; I thought I
  vaguely remembered debates on whether preloaded libraries {c,sh}ould
  use seq.el functions, but then I see that "emacs-lisp/seq" is already
  in preloaded-file-list, and e.g. rmc.el calls some of its functions.
  Am I misremembering?

>> (Hm, and against my better judgement I went ahead and compared
>> gui_supports_face_attributes_p vs tty_supports_face_attributes_p, and I
>> see that they handle :extend differently and *mashes C-c C-c with
>> forehead before fingers can type another wall of text*)
>
> TTY frames always extend the color, that's the reason for the
> difference.

(Not sure I get your meaning here; on the Linux TTY I have on hand,
(set-face-extend 'region nil) does disable color extension)

>              But does this affect my proposal above?

Not AFAICT.  Good thing I hit message-send-and-exit in time =F0=9F=A4=95


Bottomline: let me know if the attached seems to go in the right
direction; meanwhile, will check that it does TRT for other in-tree
users of face-differs-from-default-p.

Thanks for your patience.


[1]

Face under test has=E2=80=A6                 |  Does text with that face st=
and out?
:background =3D default   :extend nil  |  no
:background =3D default   :extend t    |  no
:background =E2=89=A0 default   :extend nil  |  yes
:background =E2=89=A0 default   :extend t    |  yes

=E2=87=92 face-differs-from-default-p can just check :background =E2=89=A0 =
default,
which it already does via display-supports-face-attributes-p.
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20
Face under test has=E2=80=A6                 |  Does text with that face st=
and out?
:underline =3D default    :extend nil  |  no
:underline =3D default    :extend t    |  no
:underline =E2=89=A0 default    :extend nil  |  yes
:underline =E2=89=A0 default    :extend t    |  yes

=E2=87=92 face-differs-from-default-p can just check :underline =E2=89=A0 d=
efault,
which it already does via display-supports-face-attributes-p.

NB: as far as I tested, this is is true for :underline's boolean values
as well as for its other forms.

[2] Another thing on that checklist would be adding ERT testcases for
face-differs-from-default-p, but I see the specter of --batch beaming
with mischievous glee at the thought of me invoking display-related
functions with a "headless" Emacs.  Is it=E2=80=A6? - yep, yep, it *is* put=
ting
popcorn in the oven.  =F0=9F=98=AE=E2=80=8D=F0=9F=92=A8

Maybe this time I can convince it to just eat the popcorn and not throw
it at me.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Avoid-spurious-pause-in-kill-ring-save.patch

From 033dec727e6eb381cae288aaacbce63eba76a7bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@HIDDEN>
Date: Sun, 15 Jan 2023 19:23:17 +0100
Subject: [PATCH] Avoid spurious pause in kill-ring-save

'indicate-copied-region' checks whether the region is "highlighted"
and if not, briefly moves point to mark to give a visual cue of the
extent of text that was saved to the kill ring.

The region is considered "highlighted" if (a) it is active and (b) its
face specifies a :background.  That latter condition does not account
for the multiple ways in which the face can make the region "visually
distinct" from the default face, so switch to a more extensive
predicate.

* lisp/simple.el (region-highlighted-p): New function to detect "if
the region is highlighted", leveraging
display-supports-face-attributes-p.
(indicate-copied-region): Use it.
* lisp/faces.el (face-differs-from-default-p): Also ignore :extend,
since the answers display-supports-face-attributes-p gives for that
attribute do not help determine whether FACE is visually distinct from
default.
---
 lisp/faces.el  |  4 ++--
 lisp/simple.el | 10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/faces.el b/lisp/faces.el
index 3323eab205..53a4ee5e09 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -303,8 +303,8 @@ face-differs-from-default-p
 If the optional argument FRAME is given, report on face FACE in that frame.
 If FRAME is t, report on the defaults for face FACE (for new frames).
 If FRAME is omitted or nil, use the selected frame."
-  (let ((attrs
-	 (delq :inherit (mapcar 'car face-attribute-name-alist)))
+  (let ((attrs (seq-difference (mapcar 'car face-attribute-name-alist)
+                               '(:extend :inherit)))
 	(differs nil))
     (while (and attrs (not differs))
       (let* ((attr (pop attrs))
diff --git a/lisp/simple.el b/lisp/simple.el
index 844cfa68b0..e2828caf39 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5865,6 +5865,13 @@ copy-region-blink-delay
   :group 'killing
   :version "28.1")
 
+(defun region-highlighted-p ()
+  "Say whether the region is visibly highlighted.
+This takes into account whether the region is active, and whether
+the `region' face displays differently from the default face."
+  (and (region-active-p)
+       (face-differs-from-default-p 'region)))
+
 (defun indicate-copied-region (&optional message-len)
   "Indicate that the region text has been copied interactively.
 If the mark is visible in the selected window, blink the cursor between
@@ -5885,8 +5892,7 @@ indicate-copied-region
 	;; was selected.  Don't do it if the region is highlighted.
 	(when (and (numberp copy-region-blink-delay)
 		   (> copy-region-blink-delay 0)
-		   (or (not (region-active-p))
-		       (not (face-background 'region nil t))))
+		   (not (region-highlighted-p)))
 	  ;; Swap point and mark.
 	  (set-marker (mark-marker) (point) (current-buffer))
 	  (goto-char mark)
-- 
2.39.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 21 Jan 2023 08:08:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 21 03:08:31 2023
Received: from localhost ([127.0.0.1]:47964 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pJ8vP-0002Hk-5u
	for submit <at> debbugs.gnu.org; Sat, 21 Jan 2023 03:08:31 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56420)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pJ8vN-0002HX-HA
 for 60841 <at> debbugs.gnu.org; Sat, 21 Jan 2023 03:08:29 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJ8vH-0001OH-RP; Sat, 21 Jan 2023 03:08:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=lLQgFlkTK0Uvlw1btZLkTPS/OX2Dz4LLCulg1qSIYOM=; b=nqgziwTqQH2mNxRQMR/r
 ji8Rpkyrf+mZK/cGjrBIc1SC/cfWWo+S+R2khIaXlrajWxh8yPMDkt2px6Wd5Qvlow5lG5gu5GOrz
 pFMpDhuM4M1iU4dhxJOGreyiHLCfeRE/DgyLhLyRDf8gcsXzbdzKqcoBzReZ/zJjAqIghYceLrUaM
 Xf4B7piRecvIr3xVhjbgv9dlXzlQp1thHMgw2bKxVoJXrwFR6/oTENewX3zY/DUmZgGiYdfqhjFRF
 SfylgqW3E6sNbyrvplYKPhX6mrUOxrwkBpjc8+UF558UOeEw/+QKwd8AbT1f6ouPxp4/qTDLljCLk
 Yi6Oyoqyvi3pAQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pJ8vF-0004Zp-3U; Sat, 21 Jan 2023 03:08:22 -0500
Date: Sat, 21 Jan 2023 10:08:23 +0200
Message-Id: <834jskmhs8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
In-Reply-To: <87y1pzo5dp.fsf@HIDDEN> (message from =?utf-8?Q?K=C3=A9vin?=
 Le Gouguec on Wed, 18 Jan 2023 23:16:34 +0100)
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN> <87y1pzo5dp.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Kévin Le Gouguec <kevin.legouguec@HIDDEN>
> Cc: gregory@HIDDEN,  60841 <at> debbugs.gnu.org
> Date: Wed, 18 Jan 2023 23:16:34 +0100
> 
> > * :extend nil for both: they display differently (region will not be
> >   extended, default will be),
> > * :extend t for both: they display the same,
> > * default has nil, region has t: they display the same,
> > * default has t, region has nil: they display differently.

The default face is always extended, so it should be treated as
implicitly having the :extend attribute set.

I think face-differs-from-default-p should be fixed to either ignore
the :extend attribute like it ignores :inherit (since it could be
argued that :extend doesn't really control how the face affects
characters on display), or it should treat the default face as having
the :extend attribute with the value t.

Can you see if any of these changes cause any trouble in our own use
of face-differs-from-default-p?  AFAICT, it will actually fix a subtle
problem in diff-mode.el: if diff-changed face doesn't define
non-default colors, it will be still taken as different from
'default', which I think is contrary to what diff-mode expects.

If we make the above change in face-differs-from-default-p, would
using it for the purpose of this issue fix the problem?

> (Hm, and against my better judgement I went ahead and compared
> gui_supports_face_attributes_p vs tty_supports_face_attributes_p, and I
> see that they handle :extend differently and *mashes C-c C-c with
> forehead before fingers can type another wall of text*)

TTY frames always extend the color, that's the reason for the
difference.  But does this affect my proposal above?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 18 Jan 2023 22:16:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 18 17:16:44 2023
Received: from localhost ([127.0.0.1]:41990 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pIGjc-0004tq-FA
	for submit <at> debbugs.gnu.org; Wed, 18 Jan 2023 17:16:44 -0500
Received: from mail-wr1-f41.google.com ([209.85.221.41]:44934)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pIGja-0004tb-8p
 for 60841 <at> debbugs.gnu.org; Wed, 18 Jan 2023 17:16:42 -0500
Received: by mail-wr1-f41.google.com with SMTP id bk16so55042wrb.11
 for <60841 <at> debbugs.gnu.org>; Wed, 18 Jan 2023 14:16:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=8h/Taf11WmFbI+qTbnUm6QxbpYM84GhU6ALioqvE6c8=;
 b=eLWeHMlTnVCeEWFAt9qEAASOSUCW732WF3G3OC3ykjgpVJAlaY1wym0oajRk2ZBTMF
 iPgjyEnXzwlT+Sh7q+ZittSTIxaf8V1e0E97kjHee9nLLOg/7yYisKA4CwuulC3gxFh+
 4+u3VRPANw/Zbq37EgVFvPr2a6Lrrsaz3ixvbnoopTvQZ04/cpm9ywbA8IyJoV8Qs/wz
 xpHQOWIVEz872tdCXo1y/QllbrPoCbVt0KQ2H32ysjvoZdp7kw2R8Q5hneExcy0ZcKH6
 WcDCg1v+DSviPYDtvazY0MfyVXwY5pBtOGR5hx9h5METmI84o9swZdm0is+wx+ePP7Bm
 ytkA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=8h/Taf11WmFbI+qTbnUm6QxbpYM84GhU6ALioqvE6c8=;
 b=BI09Sa3a/LUINIf6pQzc6d4lFJpgoRdcirahJvNy9nhOvnBWZQV7BiLhMJIhgo3LEg
 7d0qDKjF/mgIkkZJddBBJqXu//6QqjnVBnmHW4O0tNIRzI92h8wyMWNYFInZ6CEikJlH
 iI7S7bivW2sWNPfc9usEphQRQKSYEvhSNiGuNRe5pmoW5V3+xw5tx0kFAe+C1MWrdrU4
 qz1SSji2iOHEJgwVy7+uBX2VuOVilE9S5p5BqDqAghJJN7/Oh891Z831hpqRJBYY8NgQ
 r5l+Euyr7KhfxaCcl2Lcxs8i+n+HVUTjxxiGdG5uo5awNWU27tS8VEz47DRQxUu2idpL
 rbEA==
X-Gm-Message-State: AFqh2kru+1g7AjdXiP87oHkKsviN5aVWb6+o5UkDCZFNARvrBpIYT++8
 9C/HFanW04eCdcuN/X2oK0qbfNbijgM=
X-Google-Smtp-Source: AMrXdXs2eGdaJD2OwN1wDDOsz6Hb743xTKfUJgXjp3FGjEjrL58+c/AMWfvPQjCDV0Djha77o8YoMw==
X-Received: by 2002:a05:6000:1049:b0:2bb:ee8a:4282 with SMTP id
 c9-20020a056000104900b002bbee8a4282mr7363182wrx.34.1674080195952; 
 Wed, 18 Jan 2023 14:16:35 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 s1-20020a5d4ec1000000b002882600e8a0sm32431087wrv.12.2023.01.18.14.16.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 18 Jan 2023 14:16:35 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <83pmbc0yxo.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 18 Jan
 2023 15:12:03 +0200")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
 <83pmbc0yxo.fsf@HIDDEN>
Date: Wed, 18 Jan 2023 23:16:34 +0100
Message-ID: <87y1pzo5dp.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Sorry, but I don't think I understand what you are proposing.

In the message you reply to, not much (and it was quite ingrate of me to
inflict that wall of text on this list, without the shadow of a
conclusion; apologies, will do better next time).

The message before that had a proposal, FWIW:

> So,
>=20
> * :extend nil for both: they display differently (region will not be
>   extended, default will be),
> * :extend t for both: they display the same,
> * default has nil, region has t: they display the same,
> * default has t, region has nil: they display differently.
>=20
> Ergo, assuming (a) I didn't mess something up (b) this is the expected
> behaviour, it seems that when considering :extend,
> (face-differs-from-default-p FACE FRAME) should check
>=20
> (1) whether FACE's :extend is nil (regardless of default's :extend),
>     and
> (2) whether FACE's :underline or :background are "supported", as
>     reported by display-supports-face-attributes-p.

(
 Gregory then suggested that this example, from that same message=E2=80=A6

   (set-face-background 'region (face-background 'default nil t))

 =E2=80=A6 is contrived, and shouldn't justify special-casing :extend in
 face-differs-from-default-p (well, shouldn't justify "adding too much
 complexity").

 To which I replied that the current code in indicate-copied-region was
 in answer to an actual user doing=E2=80=A6

   (set-face-attribute 'region nil :background 'unspecified)

 =E2=80=A6 which runs afoul of the same problem as my contrived example: 'r=
egion
 remains "visually different" from 'default according to
 face-differs-from-default-p because of :extent, but for the purposes of
 indicate-copied-region, it _shouldn't_ be.
)

Now Gregory also suggested just adding an optional list of ignored
attributes to face-differs-from-default-p's parameters, so that
indicate-copied-region can set it to '(:extend) (IIUC; Gregory, let me
know if I've misunderstood).


And TBH I don't have a problem with this suggestion: it punts to the
caller, who can do TRT; it keeps face-differs-from-default-p relatively
simple, we can go with that.  My only objection is that I can't imagine
a caller ever wanting to _not_ pass '(:extend), but I admit that my own
"proposition" sounds convoluted.


(Hm, and against my better judgement I went ahead and compared
gui_supports_face_attributes_p vs tty_supports_face_attributes_p, and I
see that they handle :extend differently and *mashes C-c C-c with
forehead before fingers can type another wall of text*)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 18 Jan 2023 13:12:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 18 08:12:02 2023
Received: from localhost ([127.0.0.1]:39788 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pI8EU-0002Om-0V
	for submit <at> debbugs.gnu.org; Wed, 18 Jan 2023 08:12:02 -0500
Received: from eggs.gnu.org ([209.51.188.92]:54992)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pI8ES-0002OH-42
 for 60841 <at> debbugs.gnu.org; Wed, 18 Jan 2023 08:12:00 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pI8EI-0005FY-HQ; Wed, 18 Jan 2023 08:11:51 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=W6AekHjWya2slfVGe3/bsDrHvg+vKUpkFNOBXUV9Lyg=; b=OrKkYMBkm4awnDm1VdZS
 d+XouLgA4hcczYysxk4NhvH7a3YAxMQ0SQJ0EDXRMiYH0+PhIeMyYgPvfCfFfyr0s+at7dblMfo3o
 X5Go9RixL7toINb8War6KUFTOgLzUfuuojFCRIyMm6mcUPxu1VexHm1GfhjdBoGjvtEnDTjXMjHPk
 rwtwAjSp3+nXAjVn/+5ue1Yt85Y3l/tfVP6v4uTiPrddxq6OIrO59PuMl37aSQp/z3i0+3tYlquAk
 zgSRt0I1MX/EKH8E5s2Wc187zUWb0aljKAKYFpSjaWp+0eAwf2UGbRRI9Fd5CezdEkRxezBYAVBb0
 ZSYiwPjpN7HL1Q==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pI8EI-0006CY-0t; Wed, 18 Jan 2023 08:11:50 -0500
Date: Wed, 18 Jan 2023 15:12:03 +0200
Message-Id: <83pmbc0yxo.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
In-Reply-To: <878ri0g6ob.fsf@HIDDEN> (message from =?utf-8?Q?K=C3=A9vin?=
 Le Gouguec on Tue, 17 Jan 2023 23:03:32 +0100)
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN> <878ri0g6ob.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 60841
Cc: gregory@HIDDEN, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.1 (---)

> From: Kévin Le Gouguec <kevin.legouguec@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  60841 <at> debbugs.gnu.org
> Date: Tue, 17 Jan 2023 23:03:32 +0100
> 
> Gregory Heytings <gregory@HIDDEN> writes:
> 
> >>>> But it would be better to have there a test which would tell us whether the
> >>>> region face is "visually different" from the default face. Can we do
> >>>> something like that?
> >>>
> >>> face-differs-from-default-p?
> >>
> >> Nice catch; IIUC display-supports-face-attributes-p is what is doing the heavy
> >> work.
> >>
> >> Might need to be made smarter wrt :extend though?
> >>
> >
> > Indeed...
> >
> >>
> >> (set-face-background 'region (face-background 'default nil t))
> >> (face-differs-from-default-p 'region nil)
> >> ; ⇒ :extend
> >>
> >
> > ... although that's a really contrived example.
> 
> OK, how about this example:
> 
> >   (defun mtmm-reset-background ()
> >     (set-face-attribute 'region nil :background 'unspecified))
> 
> Straight from <87vfjhre9z.fsf@HIDDEN> (emacs-devel), i.e. the user
> report which resulted in the current code in indicate-copied-region.
> 
> Same result: :extend differs, so (face-differs-from-default-p 'region)
> returns t, which for this user would cause a regression compared to
> (face-background 'region nil t).
> 
> > I'm not sure it's TRT to add too much complexity there, so I would suggest to
> > add an additional optional argument to face-differs-from-default-p, to exclude
> > one or more attributes from the comparison (in this case :extend, but someone
> > else might be interested in excluding other attributes in the future).
> 
> I really think how face-differs-from-default-p examines attributes…
> 
>               (and
>                (not (eq attr-val 'unspecified))
>                (display-supports-face-attributes-p (list attr attr-val)
>                                                    frame))
> 
> … makes no sense for :extend.  Here's an example (and this one is
> contrived alright):
> 
>   (set-face-attribute 'default nil :underline t)
>   (set-face-attribute 'region nil :underline nil :extend VALUE)
> 
> * VALUE is 'unspecified: the condition becomes nil (meaning ":extend
>   does not make this face look different than default"), whereas that
>   actually _does_ make a difference (:underline nil too, obviously, and
>   luckily face-differs-from-default-p picks up on this),
> 
> * VALUE is nil: (display-supports-face-attributes-p '(:extend nil))
>   returns nil (because see gui_supports_face_attributes_p), despite
>   :extend nil procuding different results for :underline.
> 
> * VALUE is t: for the same reason, display-supports-face-attributes-p
>   returns t, despite :extend t making :underline indistinguishable from
>   the default face.
> 
> Granted, yeah, contrived, since that calls for :underline t on the
> default face and who does that.
> 
> But since, as we've seen, :extend causes a false positive (face reported
> as "displaying differently" despite displaying identically) when a face
> has a :background equal to the default's, I don't see how the current
> behaviour helps anyone.

Sorry, but I don't think I understand what you are proposing.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 17 Jan 2023 22:03:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 17 17:03:45 2023
Received: from localhost ([127.0.0.1]:38449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHu3U-0001uw-M3
	for submit <at> debbugs.gnu.org; Tue, 17 Jan 2023 17:03:45 -0500
Received: from mail-wr1-f49.google.com ([209.85.221.49]:40758)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pHu3Q-0001ud-DD
 for 60841 <at> debbugs.gnu.org; Tue, 17 Jan 2023 17:03:43 -0500
Received: by mail-wr1-f49.google.com with SMTP id r2so32084348wrv.7
 for <60841 <at> debbugs.gnu.org>; Tue, 17 Jan 2023 14:03:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=9pCeufmHcEngEwm6UVao+wLTPlUVYl56ZfNArRFerE4=;
 b=e0T6i0e7f6R2BJZV56Ebl0uvCvIwcGKEz79NZQoVqYnQg7/ZWLeGFBjs+YcHXefmNQ
 VohJFy3NWWzmYETfwBeTCKH6rC3cULKwbz9MFfIk98J+28Tux1omHi4qHPM3bXoHRG4Q
 JnZEkeE0QiALsThDjhd8trLZJHXcK7abHfXzbK5Duz9j5TxlD0kb0kqTFxzcLb+nJhw6
 fTZeECAzAnyKMpRs4DfDdNGuDMI+1R3dVrJ4X5OURlmZJetq+lycaCtQdDEfD17ddZlL
 I3n9redTyunR/M0+zVO4PQLbU/fgJBwZuU1GXPDDOL5KFs6vEqjrwxxPoO6rxtgv18e4
 Gq9A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=9pCeufmHcEngEwm6UVao+wLTPlUVYl56ZfNArRFerE4=;
 b=XKf2EX93s23Ht4pv19iowOalXD5o0S8AGSlo66IS3WlQ+XYyw4QWPCxq7iAPnOOUe7
 GUgQK3KV8O3bkY1xCZRenIQWn3NO46ha0jGR3cE5agOaSq1hSGKHwilJmUrajT9wzaeq
 Wcu6JILJ8rTJB6+tijgGHIsKTOqoJfzW1/i+OCRX8cqFHAF3+RJ0uqetIDyseDJzmea0
 dxkQUK3AkPtRA5+OQk4c677pZWK4yu2w1kAb8S2ZJsm7BjoSRGdtPSy/sU2UvMYjCsKP
 68Zd5OUA8nkv7Xj0ax/9zT0ZFPjvuyrq+H3dEzdnxco78YEnxJNeJY+HvHTNIQda3Y5B
 hoNQ==
X-Gm-Message-State: AFqh2krjtO3FfheV1S7qteWeHjj4P1YXCzNd7e8ApJQP76kRSE6STITk
 fKOqMI3i/7DbaVM+4EH4DbhXv02dhd4=
X-Google-Smtp-Source: AMrXdXvi5H7Ku/xldAUaLLI/r+VTda/kVqH6TekGmBjvwRkIxEfwT3r5uXvyQEX8mi6i5+DV8zPNbQ==
X-Received: by 2002:adf:e551:0:b0:2bb:3367:3b1c with SMTP id
 z17-20020adfe551000000b002bb33673b1cmr4053311wrm.31.1673993014184; 
 Tue, 17 Jan 2023 14:03:34 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 m1-20020a5d6241000000b002bbdaf21744sm26970893wrv.113.2023.01.17.14.03.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 17 Jan 2023 14:03:33 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <4c2c6cf44ad37e405b06@HIDDEN> (Gregory Heytings's message
 of "Tue, 17 Jan 2023 08:26:53 +0000")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
 <4c2c6cf44ad37e405b06@HIDDEN>
Date: Tue, 17 Jan 2023 23:03:32 +0100
Message-ID: <878ri0g6ob.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 60841
Cc: Eli Zaretskii <eliz@HIDDEN>, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Gregory Heytings <gregory@HIDDEN> writes:

>>>> But it would be better to have there a test which would tell us whethe=
r the
>>>> region face is "visually different" from the default face. Can we do
>>>> something like that?
>>>
>>> face-differs-from-default-p?
>>
>> Nice catch; IIUC display-supports-face-attributes-p is what is doing the=
 heavy
>> work.
>>
>> Might need to be made smarter wrt :extend though?
>>
>
> Indeed...
>
>>
>> (set-face-background 'region (face-background 'default nil t))
>> (face-differs-from-default-p 'region nil)
>> ; =E2=87=92 :extend
>>
>
> ... although that's a really contrived example.

OK, how about this example:

>   (defun mtmm-reset-background ()
>     (set-face-attribute 'region nil :background 'unspecified))

Straight from <87vfjhre9z.fsf@HIDDEN> (emacs-devel), i.e. the user
report which resulted in the current code in indicate-copied-region.

Same result: :extend differs, so (face-differs-from-default-p 'region)
returns t, which for this user would cause a regression compared to
(face-background 'region nil t).

> I'm not sure it's TRT to add too much complexity there, so I would sugges=
t to
> add an additional optional argument to face-differs-from-default-p, to ex=
clude
> one or more attributes from the comparison (in this case :extend, but som=
eone
> else might be interested in excluding other attributes in the future).

I really think how face-differs-from-default-p examines attributes=E2=80=A6

              (and
               (not (eq attr-val 'unspecified))
               (display-supports-face-attributes-p (list attr attr-val)
                                                   frame))

=E2=80=A6 makes no sense for :extend.  Here's an example (and this one is
contrived alright):

  (set-face-attribute 'default nil :underline t)
  (set-face-attribute 'region nil :underline nil :extend VALUE)

* VALUE is 'unspecified: the condition becomes nil (meaning ":extend
  does not make this face look different than default"), whereas that
  actually _does_ make a difference (:underline nil too, obviously, and
  luckily face-differs-from-default-p picks up on this),

* VALUE is nil: (display-supports-face-attributes-p '(:extend nil))
  returns nil (because see gui_supports_face_attributes_p), despite
  :extend nil procuding different results for :underline.

* VALUE is t: for the same reason, display-supports-face-attributes-p
  returns t, despite :extend t making :underline indistinguishable from
  the default face.

Granted, yeah, contrived, since that calls for :underline t on the
default face and who does that.

But since, as we've seen, :extend causes a false positive (face reported
as "displaying differently" despite displaying identically) when a face
has a :background equal to the default's, I don't see how the current
behaviour helps anyone.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 17 Jan 2023 08:27:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 17 03:27:00 2023
Received: from localhost ([127.0.0.1]:35603 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHhJ6-0004sH-Gh
	for submit <at> debbugs.gnu.org; Tue, 17 Jan 2023 03:27:00 -0500
Received: from heytings.org ([95.142.160.155]:47804)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pHhJ1-0004s5-3z
 for 60841 <at> debbugs.gnu.org; Tue, 17 Jan 2023 03:26:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1673944013;
 bh=kgo04oRnbDq/KGZxHBkxVU5ULT1fRmmFVpNazI5fQnE=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=Mkwv+xpn7YUX4XNs3msZeNnKCKNPjIQQ/M6caiSjfZ9KMoE7fO0lr6Dbd1GdvWpNz
 AChLRAN3JYdSiLc3ua+0zCXgAWjc7k8WQq7nIbb+A0Aumx113iElSr0xY563BZtHjA
 4LcCR9OCuSFd+1dtR/AbJQEVis9j5z1rYuYbF+RXopW+Q797OjbCsdEv66LAat62SV
 3cx6PMIAx2gGL8Jxu9m8CXBSxu8KV40E2R5qItRinpOykfgv3j4nqeWlZk0HTWenHw
 Ulr4ejX7NS0cbNSRZmJDs1J6JUUvc8S/kDhLqIjUrrDgckoeenZep7T9BbuU9ojEhI
 xgIvCFvOcJ52Q==
Date: Tue, 17 Jan 2023 08:26:53 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <87cz7dbns0.fsf@HIDDEN>
Message-ID: <4c2c6cf44ad37e405b06@HIDDEN>
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN> <87cz7dbns0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="TXNU8XMNCK"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: Eli Zaretskii <eliz@HIDDEN>, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--TXNU8XMNCK
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable


>>> But it would be better to have there a test which would tell us=20
>>> whether the region face is "visually different" from the default face.=
=20
>>> Can we do something like that?
>>
>> face-differs-from-default-p?
>
> Nice catch; IIUC display-supports-face-attributes-p is what is doing the=
=20
> heavy work.
>
> Might need to be made smarter wrt :extend though?
>

Indeed...

>
> (set-face-background 'region (face-background 'default nil t))
> (face-differs-from-default-p 'region nil)
> ; =E2=87=92 :extend
>

=2E.. although that's a really contrived example.

I'm not sure it's TRT to add too much complexity there, so I would suggest=
=20
to add an additional optional argument to face-differs-from-default-p, to=
=20
exclude one or more attributes from the comparison (in this case :extend,=
=20
but someone else might be interested in excluding other attributes in the=
=20
future).

--TXNU8XMNCK--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 17 Jan 2023 07:53:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 17 02:53:16 2023
Received: from localhost ([127.0.0.1]:35580 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHgmR-00046O-M0
	for submit <at> debbugs.gnu.org; Tue, 17 Jan 2023 02:53:15 -0500
Received: from mail-wr1-f51.google.com ([209.85.221.51]:46633)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pHgmN-000468-OW
 for 60841 <at> debbugs.gnu.org; Tue, 17 Jan 2023 02:53:13 -0500
Received: by mail-wr1-f51.google.com with SMTP id e3so20434418wru.13
 for <60841 <at> debbugs.gnu.org>; Mon, 16 Jan 2023 23:53:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=+eKochrdVAbw3ysSKSGr9Gx1aPaP65ofebrZmN9k33Q=;
 b=SKCVgwAuywcEFFUzULGY/rDw/QMwDD0SjC60SJP8w7ksc+jGIgCpzlcjVZNg5pbUVZ
 VLcJ78IfA/JNXO/AHc+HhZ0eNazSrd4N3kVg4ZdBIIV9TOoXkxlH6nCalNyFQPDlyz/z
 06vugWZkL/YjUpQASp5RmkM7zYzyU2wj4Www+FZ8B7y93g8ihewK0KQTmJ4Jeo+5QsTn
 Djg9n12Oi255DZtVcVe3MOpRJd43A8XfG8fTwZfT2a79eGSSOAz6aqwakm18Bvl6u82C
 pm0S0ucEn07xy/6t1b8j+rYPTLwqxR0Ca+QUlmoDikaJG1vX/U3w2QYjuqyjYD/EUY9U
 6kLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=+eKochrdVAbw3ysSKSGr9Gx1aPaP65ofebrZmN9k33Q=;
 b=vw6YS0WhjgQrwPyASGpmUlC9hOb2j7fIEzyyXHuvEVynvyswNA7JY9PwPKGRpvp75F
 ekfjBkaVfswIKH2rKfCUpHhHHa+mUhfqVeHwACGtjrNKYRy9i3Sle07w0lpI9xXJQ29V
 FmrwQbsLT9UeEZv76KR+mSvcFyrvESJyo2WWWnVrVECDxI0VOgDBOancJJyff053QERB
 75WWG8WoErBt2Nj2zjydOvmneyQMafW5yzCaghHKwvsqixh6rOpfmO+DY5P26OHhWkVm
 ZZt++dMje9qxll7Nm8xMbG97ATBFsocOknjMImpc8At0dFOk8RynCwt3q/fSO0rA2ZFs
 2a4Q==
X-Gm-Message-State: AFqh2koQBK4YfUSuzVSTM9yU78pndGDrdzUYp6CuBV1qAhpiqKo0DXJJ
 NczqlC2mWQDeKpwnROovWwhywo1U0QY=
X-Google-Smtp-Source: AMrXdXsuX8R1HkmAF6QCd1l+/a4rJUx5ZkYqhZP82lFG4UuV+/XgZo9LV8URZREf5kcAi1EimOiZVw==
X-Received: by 2002:a5d:698e:0:b0:2bd:fa7c:bb9e with SMTP id
 g14-20020a5d698e000000b002bdfa7cbb9emr1874024wru.6.1673941985329; 
 Mon, 16 Jan 2023 23:53:05 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 l1-20020adfe9c1000000b00289bdda07b7sm27416842wrn.92.2023.01.16.23.53.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 16 Jan 2023 23:53:04 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Gregory Heytings <gregory@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <5583fd58387746ce7ddc@HIDDEN> (Gregory Heytings's message
 of "Mon, 16 Jan 2023 22:28:03 +0000")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
 <5583fd58387746ce7ddc@HIDDEN>
Date: Tue, 17 Jan 2023 08:53:03 +0100
Message-ID: <87cz7dbns0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: Eli Zaretskii <eliz@HIDDEN>, 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Gregory Heytings <gregory@HIDDEN> writes:

>> But it would be better to have there a test which would tell us whether =
the
>> region face is "visually different" from the default face.  Can we do
>> something like that?
>>
>
> face-differs-from-default-p?

Nice catch; IIUC display-supports-face-attributes-p is what is doing the
heavy work.

Might need to be made smarter wrt :extend though?

(set-face-background 'region (face-background 'default nil t))
(face-differs-from-default-p 'region nil)
; =E2=87=92 :extend

AFAICT (from messing around without any kind of scripted recipe, so
caveat lector),

* :extend nil on 'default does not prevent its background/underline from
  spanning the whole window width,

* but :extend t on 'default does not mean that other faces will be
  extended, even if they have :extend 'unspecified.

(This last point might have gone without saying for the audience; I
admit to not knowing enough about face internals to understand which
attributes are implicitly "inherited" from 'default)

So,

* :extend nil for both: they display differently (region will not be
  extended, default will be),
* :extend t for both: they display the same,
* default has nil, region has t: they display the same,
* default has t, region has nil: they display differently.

Ergo, assuming (a) I didn't mess something up (b) this is the expected
behaviour, it seems that when considering :extend,
(face-differs-from-default-p FACE FRAME) should check

(1) whether FACE's :extend is nil (regardless of default's :extend),
    and
(2) whether FACE's :underline or :background are "supported", as
    reported by display-supports-face-attributes-p.

Hope the coffee kicked in and the above made sense.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 16 Jan 2023 22:28:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 16 17:28:09 2023
Received: from localhost ([127.0.0.1]:35166 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHXxZ-0003mp-4S
	for submit <at> debbugs.gnu.org; Mon, 16 Jan 2023 17:28:09 -0500
Received: from heytings.org ([95.142.160.155]:47322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pHXxV-0003md-97
 for 60841 <at> debbugs.gnu.org; Mon, 16 Jan 2023 17:28:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1673908084;
 bh=YqPDQCcgW6S8es2tKRqiOpu5arCrctpIDVUuzbIIo5k=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=AWDLRkbLX3F4fErFPGvLBjXQDtJBAYvI2eZJxgmG7WDDUPBk0B2X5RaFWGPDz/0ua
 CkTozUC5FS8AaykUJQStpx527o4IcQaKq4iznVNprds+SpkWPmmC8t0tBoCPOPzdnJ
 3haNoRbcZnS/R+dVYDI+LT4vyBgYwI7Pc4W7lVdmtwmgqdoBnyh8DI6LNKp8DTtG2C
 rD1soNVWqsFDXFeMqTz/KZ69RzJd+rxORq7c2TQv0Ql9hKpaTdazyeoC0YLjsHGVqd
 jHp1V1CYljF3/gCgrvUdig/ae8k8GQw3PUW+Z19gpEp91S98XVeIrpJVkdBpwXGuj4
 8WHmQFw+hsqSA==
Date: Mon, 16 Jan 2023 22:28:03 +0000
From: Gregory Heytings <gregory@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <83zgai4peg.fsf@HIDDEN>
Message-ID: <5583fd58387746ce7ddc@HIDDEN>
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: 60841 <at> debbugs.gnu.org,
 =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> But it would be better to have there a test which would tell us whether 
> the region face is "visually different" from the default face.  Can we 
> do something like that?
>

face-differs-from-default-p?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 16 Jan 2023 21:58:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 16 16:58:19 2023
Received: from localhost ([127.0.0.1]:35131 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHXUg-0002ym-Mt
	for submit <at> debbugs.gnu.org; Mon, 16 Jan 2023 16:58:19 -0500
Received: from mail-wm1-f43.google.com ([209.85.128.43]:40450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pHXUf-0002ya-HT
 for 60841 <at> debbugs.gnu.org; Mon, 16 Jan 2023 16:58:18 -0500
Received: by mail-wm1-f43.google.com with SMTP id
 j34-20020a05600c1c2200b003da1b054057so8808252wms.5
 for <60841 <at> debbugs.gnu.org>; Mon, 16 Jan 2023 13:58:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=YtFIH3cyjGXTj/rwZsZ51oHLoK4MA3JNBVxIgmazGNs=;
 b=aA1EOyzw4eYmP3Q/7GX4++qd7Gye8gj+1+glkqR3A872vpquq5CwDoxAwN2ew4a0hf
 M++mrC9cY+/lwP5xEXiCXzlUWm9eCS+7uplMce6WTqaGVBvy+WcsqrAlgRKkOOAuekem
 6fJeQqkLpjDSHOuzLnjNmvkI2B4TaTGZk12PNosCltWOsTPvokssczZN+TjvxRKHI+Np
 LXttLQg6v6OmZD8UG/pwFXY7K1RQnQs/w/weOgijkPkY44RDKJZQMDCjJDNAwXgdTHwT
 BQUvCNErUg6nYKGxtW5YR0Aw95s73IOLDnYODpYQnHgI575zXdrdghMzIfbSpd90Eq0y
 h8KQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=YtFIH3cyjGXTj/rwZsZ51oHLoK4MA3JNBVxIgmazGNs=;
 b=NxqpsvVdLrreP40peK5zu8TXaYM2qtNhSaD4hZmG1D2mLDuA0zuKlasAzwTI0rqCj7
 /3p7xFDuDjZQFtWXTjtPy/SgnfKjlhpIv32kf7t3LGzEM/b60Y0hmZcDTgK9dp0JAEME
 5/1Gnr5kJI+nOCi6Vwl3WE1RpH8aYtENSaEscmiLIeqQd5jM/PTSnhEgdE60jCDOied1
 JMVaByqxfhJ0rjt3eORIdc0dWBjI+nJzfVdYl+pl7JJWAnOJR1pFJTSA6E4kC1B7EpA8
 Z3hAJzhMJssv2HiKU+MsyK/KE/l9jTx2hh6u44AQShVZi8+eb5L6EFfbopVgPUGk7eC1
 SLPA==
X-Gm-Message-State: AFqh2krE/EeK6v77QRhPkHj7Uhjw/TEHmS5iuliT4Ekp2Ij4jgMH80fz
 QP0bEyEo/3l4SJpX5i++xSIa/xogby4=
X-Google-Smtp-Source: AMrXdXtv6NGOHMs5mYgrV0z5p7HymF/4IamhCdqMIvNwsGlk6I83V865AIsEN2rBdTot2c5ci5H+0w==
X-Received: by 2002:a05:600c:314b:b0:3d2:3ca2:2d4f with SMTP id
 h11-20020a05600c314b00b003d23ca22d4fmr814569wmo.36.1673906291296; 
 Mon, 16 Jan 2023 13:58:11 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 y6-20020a1c4b06000000b003da119d7251sm15709138wma.21.2023.01.16.13.58.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 16 Jan 2023 13:58:10 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being
 highlighted
In-Reply-To: <83zgai4peg.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 16 Jan
 2023 14:47:35 +0200")
References: <87h6wrs71h.fsf@HIDDEN> <83zgai4peg.fsf@HIDDEN>
Date: Mon, 16 Jan 2023 22:58:09 +0100
Message-ID: <87lem2w39q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60841
Cc: 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> The attached patch handles this foreground + inverse-video switcheroo.
>> Not sure how many themes actually do that in the wild, so I'd understand
>> if there wasn't much enthusiasm for applying.  That face-background
>> check has been with us since 2004; haven't found any hint in the BTS
>> that anyone else has been bothered by this false negative.
>
> IMNSHO, this just makes another mini-step (albeit in the right
> direction), instead of going all the way.  There are other face
> attributes that can make the region stand out on display: what about
> underline or italics, for example?  And vice versa: the face could
> have a background that is identical or almost identical to the default
> face.

Indeed.  I wasn't sure how much brain-racking we would feel like
devoting to this issue, hence the naive patch; thank you for prompting
more discussion.

> We could keep adding conditions for more and more face attributes, one
> by one.  But it would be better to have there a test which would tell
> us whether the region face is "visually different" from the default
> face.  Can we do something like that?

I struggle to find a heuristic that I'd dare call "smart", so here's a
dumb one: if _any_ attribute of the region face differs from that of the
default face, then odds are whoever customized the region face (theme
author or end user) intended for it to "stand out" to some extent?

(defun dumb/stands-out-from-default-p ()
  (seq-some
   (lambda (attribute)
     (unless (memq attribute '(:extend :inherit))
       (let ((default-value (face-attribute 'default attribute nil t))
             (region-value (face-attribute 'region attribute nil t)))
         (and (not (eq region-value 'unspecified))
              (not (equal region-value default-value))))))
   (mapcar 'car (face-all-attributes 'default))))

> Alternatively, we could add a user option to make the swap
> unconditional, because maybe some users would prefer that to splitting
> hair in this case.  Then we could stop worrying about all those fine
> differences.

Right, after discovering the feature swap I was surprised to find no way
to enable it regardless of whether the region is highlighted.  Sure,
OT1H I thought Emacs was bugging out on me; OTOH now knowing what's
happening (and in particular, knowing that we're in sit-for so not
frozen), considering that the region is deactivated when M-w ends, I
could imagine some people finding this swap helpful and preferring to
have it on always.


Wrapping up=E2=80=A6

(a) Would it make sense to introduce a defcustom
    (copy-region-indication-predicate?) that allows nil, t, or a
    predicate function?  The default value being:

    (and (region-active-p)
         (smart/stands-out-from-default-p))

    (Random considerations:
     * nil would be redundant with copy-region-blink-delay 0 or nil,
       not sure how much we care,
     * we could require this to always be a function instead, since
       'always is a thing)

(b) No flash of genius on how to determine whether the region face
    "stands out", yet.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at 60841 <at> debbugs.gnu.org:


Received: (at 60841) by debbugs.gnu.org; 16 Jan 2023 12:47:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 16 07:47:35 2023
Received: from localhost ([127.0.0.1]:60768 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHOti-00011H-Rn
	for submit <at> debbugs.gnu.org; Mon, 16 Jan 2023 07:47:35 -0500
Received: from eggs.gnu.org ([209.51.188.92]:59490)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pHOth-000110-5R
 for 60841 <at> debbugs.gnu.org; Mon, 16 Jan 2023 07:47:33 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pHOtb-0006xt-VN; Mon, 16 Jan 2023 07:47:27 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=NHbW22di+jC6FLH2ZUFsu/4KTZA4ShNQaTuaoZ4Pwao=; b=ZrR28tsxdIAknClLkceO
 xqbrphtP5Jv8mbDkO6XkbSI0MyPFiyDMnJL1E+A9RDNAChR3hNhYM9dIILLIFcb5eHeN9AxgeRqvn
 uyWKqThAFzyQ8txd1gTQ9ymyO7USdTyiKsYqnRO9Iqgjc5mGDlxa/hmdKidC+2W3UKVNMWrVTy2aQ
 4FEwuaeZl5uMHn81KCP69zhv0jEP84+oSStg9Bub9lwLsdzOg+fN53X0GAbWgXlCN/BMGMB59kK19
 VmjM4kC2/+roa4RavX2h5ls+XYfTb2yj0pZ2n356QUbpeC2Dn3XYwj8AbQWyGGtAW5k8LFW9NHyZW
 WupXWRSVbgl/Og==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pHOtb-0003Q3-Ep; Mon, 16 Jan 2023 07:47:27 -0500
Date: Mon, 16 Jan 2023 14:47:35 +0200
Message-Id: <83zgai4peg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
In-Reply-To: <87h6wrs71h.fsf@HIDDEN> (message from =?utf-8?Q?K=C3=A9vin?=
 Le Gouguec on Mon, 16 Jan 2023 00:38:02 +0100)
Subject: Re: bug#60841: 30.0.50;
 kill-ring-save pauses despite region being highlighted
References: <87h6wrs71h.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 60841
Cc: 60841 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Kévin Le Gouguec <kevin.legouguec@HIDDEN>
> Date: Mon, 16 Jan 2023 00:38:02 +0100
> 
> The docstring says that this is done "if there is currently no active
> region highlighting"; in practice, this translates to:
> 
> 	;; Swap point-and-mark quickly so as to show the region that
> 	;; was selected.  Don't do it if the region is highlighted.
> 	(when (and (numberp copy-region-blink-delay)
> 		   (> copy-region-blink-delay 0)
> 		   (or (not (region-active-p))                  ; (a)
> 		       (not (face-background 'region nil t))))  ; (b)
> 
> IOW "active region highlighting" means "(a) an active region, and (b)
> any background for the region face".  face-background, however, is not
> enough to asses (b); consider, from emacs -Q:
> 
> M-: (custom-set-faces '(region ((t (:foreground "blue" :inverse-video t)))))
> C-x h
> M-w
> 
> In this situation, the region face has a clearly visible background, yet
> indicate-copied-region still behaves as if the region is not
> "highlighted", and triggers the (harmless and entirely interruptible)
> point-and-mark swap followed by a pause.

Yes, the existing conditions are a bit naïve.

> The attached patch handles this foreground + inverse-video switcheroo.
> Not sure how many themes actually do that in the wild, so I'd understand
> if there wasn't much enthusiasm for applying.  That face-background
> check has been with us since 2004; haven't found any hint in the BTS
> that anyone else has been bothered by this false negative.

IMNSHO, this just makes another mini-step (albeit in the right
direction), instead of going all the way.  There are other face
attributes that can make the region stand out on display: what about
underline or italics, for example?  And vice versa: the face could
have a background that is identical or almost identical to the default
face.

We could keep adding conditions for more and more face attributes, one
by one.  But it would be better to have there a test which would tell
us whether the region face is "visually different" from the default
face.  Can we do something like that?

Alternatively, we could add a user option to make the swap
unconditional, because maybe some users would prefer that to splitting
hair in this case.  Then we could stop worrying about all those fine
differences.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Jan 2023 23:38:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 15 18:38:11 2023
Received: from localhost ([127.0.0.1]:59901 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pHCZm-0001e6-So
	for submit <at> debbugs.gnu.org; Sun, 15 Jan 2023 18:38:11 -0500
Received: from lists.gnu.org ([209.51.188.17]:49980)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1pHCZl-0001dz-Nb
 for submit <at> debbugs.gnu.org; Sun, 15 Jan 2023 18:38:10 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <kevin.legouguec@HIDDEN>)
 id 1pHCZl-0001kk-Df
 for bug-gnu-emacs@HIDDEN; Sun, 15 Jan 2023 18:38:09 -0500
Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <kevin.legouguec@HIDDEN>)
 id 1pHCZj-0005WJ-AI
 for bug-gnu-emacs@HIDDEN; Sun, 15 Jan 2023 18:38:09 -0500
Received: by mail-wr1-x436.google.com with SMTP id az7so25945219wrb.5
 for <bug-gnu-emacs@HIDDEN>; Sun, 15 Jan 2023 15:38:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=qdvnpzRwEmByxxWyR93wa+YnvCSYbSalt2GTTRE8CXI=;
 b=bYRsrMrpNJVayfLhjs4sPcAiBVQ/yYZDhX7svsmEkic4yOci7uQzsGBMFvr1oKARuB
 E5xhq54xI9u1Rp/2x4T1VHNQh4Ce39rr7HKtrOKHXdEaTv6NrcBCGMS4jUFIgAryaS8x
 Ks9yd3htimWWc+998mZY+wKdJdOeKqlGczI6l1sqvblL0qvaBjGJ+Ezh9tm/HW/idvPU
 97itcdSc7+Hx+pdttRYPnMYh6b7DSO4VYpZs/sWyxRvkRJUSeuQUHAPFKKMs6U0rouXh
 j1kHYB1jmaPCHOB6OSlSylVmhX4jSUIyooRwTsSuHYmGfQZWEX07NE/y9kHOaM9lPED3
 fWWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=qdvnpzRwEmByxxWyR93wa+YnvCSYbSalt2GTTRE8CXI=;
 b=RaUVsOKpOTXDQ88p9WYNRhiLbwSJvIY32wFY9CbnjI5dgM2OZDWXkqKyBorgpC7xeA
 P0ppj+RZjz0xuxyiLmhZuCOTKCDphtZiLdO/+2tbgcK8Bs0qrkfT4e4cv9cowmAmIDPY
 Awml+tSInQY+1zqZdsbvR/K+3Xns1/RZfqKW8OTCAqFcBirCzEYdILWP/sotI1utpJdG
 sQyGuOS53Zme1+V2u931pucGZjGEcgABdhyJE/6O/bOri5vXC7g/SEUKEUOkYR/ue9Yc
 JDK3ryYjJXo/EElazx24KsdcxZHrj3PODF+SAVNBys3zpgWBPib/fnf41wqrqR54FBnm
 8hJw==
X-Gm-Message-State: AFqh2kpuSfBVlBjuuFJKnTp8UjlILBJw8shVUOg9NhRJ6gqAZ8N2hxR9
 oT5xOeEXN9isWzu8k9rztJcE85JTdtk=
X-Google-Smtp-Source: AMrXdXuNFN4f95wU647yM0xBQHuNx1FWdhyTd2e8E2nRllu1qYmQ/yMUAWLpGn9905OxCV3xSRLxEQ==
X-Received: by 2002:a5d:55c5:0:b0:242:3812:f948 with SMTP id
 i5-20020a5d55c5000000b002423812f948mr6257697wrw.24.1673825884188; 
 Sun, 15 Jan 2023 15:38:04 -0800 (PST)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 u5-20020adfdb85000000b002ba2646fd30sm29271902wri.36.2023.01.15.15.38.03
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 15 Jan 2023 15:38:03 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; kill-ring-save pauses despite region being highlighted
Date: Mon, 16 Jan 2023 00:38:02 +0100
Message-ID: <87h6wrs71h.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::436;
 envelope-from=kevin.legouguec@HIDDEN; helo=mail-wr1-x436.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello Emacs,

kill-ring-save calls indicate-copied-region, which does a quick
point-and-mark swap (for copy-region-blink-delay seconds) to give the
user an idea of the extent of text that has been saved.

The docstring says that this is done "if there is currently no active
region highlighting"; in practice, this translates to:

	;; Swap point-and-mark quickly so as to show the region that
	;; was selected.  Don't do it if the region is highlighted.
	(when (and (numberp copy-region-blink-delay)
		   (> copy-region-blink-delay 0)
		   (or (not (region-active-p))                  ; (a)
		       (not (face-background 'region nil t))))  ; (b)

IOW "active region highlighting" means "(a) an active region, and (b)
any background for the region face".  face-background, however, is not
enough to asses (b); consider, from emacs -Q:

M-: (custom-set-faces '(region ((t (:foreground "blue" :inverse-video t)))))
C-x h
M-w

In this situation, the region face has a clearly visible background, yet
indicate-copied-region still behaves as if the region is not
"highlighted", and triggers the (harmless and entirely interruptible)
point-and-mark swap followed by a pause.

I did not know about this feature, and only found out about it by
accident after customizing the region face.  Only after (1) assuming
something was off between Emacs and the system clipboard (2) failing to
use debug-on-quit to figure out where Emacs was "stuck" (it wasn't, of
course) (3) diving into kill-ring-save, did I realize what was going on.

The attached patch handles this foreground + inverse-video switcheroo.
Not sure how many themes actually do that in the wild, so I'd understand
if there wasn't much enthusiasm for applying.  That face-background
check has been with us since 2004; haven't found any hint in the BTS
that anyone else has been bothered by this false negative.


(FWIW, I stumbled on this while working on a dark theme with a limited
 palette; having exhausted all backgrounds on other faces and struggling
 to find one to dedicate to the region, I figured I could combine one of
 my bright foreground colors with :inverse-video, and leave :background
 unspecified.

 Of course, instead of:

   :foreground SOMETHING-BRIGHT
   :inverse-video t

 I could specify:

   :background SOMETHING-BRIGHT
   :foreground SOMETHING-DARK

 =E2=80=A6 but my initial idea was to let the chips fall where they may and
 allow any text background to become a foreground within the region,
 since all of the theme's backgrounds ought to be dark enough to
 contrast with SOMETHING-BRIGHT)


Thanks for your time.


 GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2023-01-02 built on amdahl30
Repository revision: c209802f7b3721a1b95113290934a23fee88f678
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101006
System Description: openSUSE Tumbleweed

Configured using:
 'configure --with-cairo --with-gconf --with-sqlite3 --with-xinput2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=3Dlocal
  locale-coding-system: utf-8-unix


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Avoid-spurious-pause-in-kill-ring-save.patch

From 7bfb6883fb39fe44282a547a4562f9f4d60058ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@HIDDEN>
Date: Sun, 15 Jan 2023 19:23:17 +0100
Subject: [PATCH] Avoid spurious pause in kill-ring-save

'indicate-copied-region' checks whether the region is highlighted and
if not, briefly moves point to mark to give a visual cue of the extent
of text that was saved to the kill ring.

The region is assumed to be "highlighted" if (a) it is active and (b)
its face specifies a :background.  That latter condition does not
account for this somewhat adversarial face definition:

(custom-set-faces
  '(region ((t (:foreground "blue" :inverse-video t)))))

With this customization, the check will fail and users will experience
an (interruptible) pause, despite the region being clearly
highlighted.

* lisp/simple.el (region-highlighted-p): New function to detect "if
the region is highlighted".  If :background is nil, double-check
:foreground and :inverse-video.
(indicate-copied-region): Use it.
---
 lisp/simple.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 4b09f41de5..2029584a94 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5853,6 +5853,15 @@ copy-region-blink-delay
   :group 'killing
   :version "28.1")
 
+(defun region-highlighted-p ()
+  "Say whether the region is visibly highlighted.
+This takes into account whether the region is active, and whether
+the `region' face has a colored background."
+  (and (region-active-p)
+       (or (face-background 'region nil t)
+           (and (face-foreground 'region nil t)
+                (face-inverse-video-p 'region nil t)))))
+
 (defun indicate-copied-region (&optional message-len)
   "Indicate that the region text has been copied interactively.
 If the mark is visible in the selected window, blink the cursor between
@@ -5873,8 +5882,7 @@ indicate-copied-region
 	;; was selected.  Don't do it if the region is highlighted.
 	(when (and (numberp copy-region-blink-delay)
 		   (> copy-region-blink-delay 0)
-		   (or (not (region-active-p))
-		       (not (face-background 'region nil t))))
+		   (not (region-highlighted-p)))
 	  ;; Swap point and mark.
 	  (set-marker (mark-marker) (point) (current-buffer))
 	  (goto-char mark)
-- 
2.39.0


--=-=-=--




Acknowledgement sent to Kévin Le Gouguec <kevin.legouguec@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#60841; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 28 Jan 2023 18:15:01 UTC

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