From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted Date: Wed, 18 Jan 2023 15:12:03 +0200 Message-ID: <83pmbc0yxo.fsf@gnu.org> References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29148"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gregory@heytings.org, 60841@debbugs.gnu.org To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 18 14:13:08 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pI8FY-0007Nk-DW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Jan 2023 14:13:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI8FU-0006t3-B5; Wed, 18 Jan 2023 08:13:04 -0500 Original-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 ) id 1pI8FS-0006su-OC for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 08:13:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI8FS-0005SN-Bl for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 08:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pI8FR-0002Q7-RL for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 08:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jan 2023 13:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60841 X-GNU-PR-Package: emacs Original-Received: via spool by 60841-submit@debbugs.gnu.org id=B60841.16740475229229 (code B ref 60841); Wed, 18 Jan 2023 13:13:01 +0000 Original-Received: (at 60841) by debbugs.gnu.org; 18 Jan 2023 13:12:02 +0000 Original-Received: from localhost ([127.0.0.1]:39788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI8EU-0002Om-0V for submit@debbugs.gnu.org; Wed, 18 Jan 2023 08:12:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54992) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI8ES-0002OH-42 for 60841@debbugs.gnu.org; Wed, 18 Jan 2023 08:12:00 -0500 Original-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 ) 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==; Original-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 ) id 1pI8EI-0006CY-0t; Wed, 18 Jan 2023 08:11:50 -0500 In-Reply-To: <878ri0g6ob.fsf@gmail.com> (message from =?UTF-8?Q?K=C3=A9vin?= Le Gouguec on Tue, 17 Jan 2023 23:03:32 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253630 Archived-At: > From: Kévin Le Gouguec > Cc: Eli Zaretskii , 60841@debbugs.gnu.org > Date: Tue, 17 Jan 2023 23:03:32 +0100 > > Gregory Heytings 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@zamazal.org> (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.