From unknown Mon Jun 16 23:41:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60841 <60841@debbugs.gnu.org> To: bug#60841 <60841@debbugs.gnu.org> Subject: Status: 30.0.50; kill-ring-save pauses despite region being highlighted Reply-To: bug#60841 <60841@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:41:03 +0000 retitle 60841 30.0.50; kill-ring-save pauses despite region being highlight= ed reassign 60841 emacs submitter 60841 K=C3=A9vin Le Gouguec severity 60841 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 15 18:38:11 2023 Received: (at submit) by debbugs.gnu.org; 15 Jan 2023 23:38:11 +0000 Received: from localhost ([127.0.0.1]:59901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHCZm-0001e6-So for submit@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 ) id 1pHCZl-0001dz-Nb for submit@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 ) id 1pHCZl-0001kk-Df for bug-gnu-emacs@gnu.org; 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 ) id 1pHCZj-0005WJ-AI for bug-gnu-emacs@gnu.org; Sun, 15 Jan 2023 18:38:09 -0500 Received: by mail-wr1-x436.google.com with SMTP id az7so25945219wrb.5 for ; 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 (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?= To: bug-gnu-emacs@gnu.org 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@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=kevin.legouguec@gmail.com; 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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?= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 07:47:35 2023 Received: (at 60841) by debbugs.gnu.org; 16 Jan 2023 12:47:35 +0000 Received: from localhost ([127.0.0.1]:60768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHOti-00011H-Rn for submit@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 ) id 1pHOth-000110-5R for 60841@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87h6wrs71h.fsf@gmail.com> (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@gmail.com> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 16:58:19 2023 Received: (at 60841) by debbugs.gnu.org; 16 Jan 2023 21:58:19 +0000 Received: from localhost ([127.0.0.1]:35131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHXUg-0002ym-Mt for submit@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 ) id 1pHXUf-0002ya-HT for 60841@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@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?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83zgai4peg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Jan 2023 14:47:35 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> Date: Mon, 16 Jan 2023 22:58:09 +0100 Message-ID: <87lem2w39q.fsf@gmail.com> 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@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 17:28:09 2023 Received: (at 60841) by debbugs.gnu.org; 16 Jan 2023 22:28:09 +0000 Received: from localhost ([127.0.0.1]:35166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHXxZ-0003mp-4S for submit@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 ) id 1pHXxV-0003md-97 for 60841@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 To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83zgai4peg.fsf@gnu.org> Message-ID: <5583fd58387746ce7ddc@heytings.org> References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> 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@debbugs.gnu.org, =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 02:53:16 2023 Received: (at 60841) by debbugs.gnu.org; 17 Jan 2023 07:53:16 +0000 Received: from localhost ([127.0.0.1]:35580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHgmR-00046O-M0 for submit@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 ) id 1pHgmN-000468-OW for 60841@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@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?= To: Gregory Heytings Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <5583fd58387746ce7ddc@heytings.org> (Gregory Heytings's message of "Mon, 16 Jan 2023 22:28:03 +0000") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> Date: Tue, 17 Jan 2023 08:53:03 +0100 Message-ID: <87cz7dbns0.fsf@gmail.com> 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 , 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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? (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. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 03:27:00 2023 Received: (at 60841) by debbugs.gnu.org; 17 Jan 2023 08:27:00 +0000 Received: from localhost ([127.0.0.1]:35603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHhJ6-0004sH-Gh for submit@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 ) id 1pHhJ1-0004s5-3z for 60841@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 To: =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <87cz7dbns0.fsf@gmail.com> Message-ID: <4c2c6cf44ad37e405b06@heytings.org> References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="TXNU8XMNCK" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 60841 Cc: Eli Zaretskii , 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 17:03:45 2023 Received: (at 60841) by debbugs.gnu.org; 17 Jan 2023 22:03:45 +0000 Received: from localhost ([127.0.0.1]:38449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHu3U-0001uw-M3 for submit@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 ) id 1pHu3Q-0001ud-DD for 60841@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@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?= To: Gregory Heytings Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <4c2c6cf44ad37e405b06@heytings.org> (Gregory Heytings's message of "Tue, 17 Jan 2023 08:26:53 +0000") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> Date: Tue, 17 Jan 2023 23:03:32 +0100 Message-ID: <878ri0g6ob.fsf@gmail.com> 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 , 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Gregory Heytings 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@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 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 08:12:02 2023 Received: (at 60841) by debbugs.gnu.org; 18 Jan 2023 13:12:02 +0000 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 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 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==; 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 Date: Wed, 18 Jan 2023 15:12:03 +0200 Message-Id: <83pmbc0yxo.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec 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) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted 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 X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 60841 Cc: gregory@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.1 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 17:16:44 2023 Received: (at 60841) by debbugs.gnu.org; 18 Jan 2023 22:16:44 +0000 Received: from localhost ([127.0.0.1]:41990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIGjc-0004tq-FA for submit@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 ) id 1pIGja-0004tb-8p for 60841@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@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?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83pmbc0yxo.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Jan 2023 15:12:03 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> Date: Wed, 18 Jan 2023 23:16:34 +0100 Message-ID: <87y1pzo5dp.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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*) From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 21 03:08:31 2023 Received: (at 60841) by debbugs.gnu.org; 21 Jan 2023 08:08:31 +0000 Received: from localhost ([127.0.0.1]:47964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJ8vP-0002Hk-5u for submit@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 ) id 1pJ8vN-0002HX-HA for 60841@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87y1pzo5dp.fsf@gmail.com> (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@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Cc: gregory@heytings.org, 60841@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? From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 22 17:45:37 2023 Received: (at 60841) by debbugs.gnu.org; 22 Jan 2023 22:45:37 +0000 Received: from localhost ([127.0.0.1]:52781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJj5k-0003bu-Em for submit@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 ) id 1pJj5f-0003bb-Kb for 60841@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@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?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <834jskmhs8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Jan 2023 10:08:23 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> Date: Sun, 22 Jan 2023 23:45:23 +0100 Message-ID: <87fsc2qjcs.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: K=C3=A9vin Le Gouguec >> Cc: gregory@heytings.org, 60841@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?= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 23 08:02:01 2023 Received: (at 60841) by debbugs.gnu.org; 23 Jan 2023 13:02:02 +0000 Received: from localhost ([127.0.0.1]:53593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJwSX-00068F-9v for submit@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 ) id 1pJwSR-00067U-ME for 60841@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87fsc2qjcs.fsf@gmail.com> (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@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Cc: gregory@heytings.org, 60841@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? From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 23 17:29:11 2023 Received: (at 60841) by debbugs.gnu.org; 23 Jan 2023 22:29:11 +0000 Received: from localhost ([127.0.0.1]:55509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK5JO-0003OQ-J1 for submit@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 ) id 1pK5JM-0003OA-Et for 60841@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@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?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <833581jtff.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Jan 2023 15:01:56 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> Date: Mon, 23 Jan 2023 23:29:00 +0100 Message-ID: <87lelsga1f.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii 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). From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 24 08:23:08 2023 Received: (at 60841) by debbugs.gnu.org; 24 Jan 2023 13:23:09 +0000 Received: from localhost ([127.0.0.1]:56139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKJGW-0004aI-GX for submit@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 ) id 1pKJGU-0004Zm-QD for 60841@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87lelsga1f.fsf@gmail.com> (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@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Cc: gregory@heytings.org, 60841@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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 12:45:19 2023 Received: (at 60841) by debbugs.gnu.org; 28 Jan 2023 17:45:19 +0000 Received: from localhost ([127.0.0.1]:41458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLpGQ-00066e-N8 for submit@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 ) id 1pLpGN-00066J-J2 for 60841@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@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?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83r0vkgj7l.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Jan 2023 15:23:10 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> Date: Sat, 28 Jan 2023 18:45:07 +0100 Message-ID: <87h6wawo2k.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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@gnu.org>, 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?= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 13:07:41 2023 Received: (at 60841) by debbugs.gnu.org; 28 Jan 2023 18:07:41 +0000 Received: from localhost ([127.0.0.1]:41487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLpc5-0006kS-2Y for submit@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 ) id 1pLpc2-0006kC-N7 for 60841@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87h6wawo2k.fsf@gmail.com> (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@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Cc: gregory@heytings.org, 60841@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. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 09:54:26 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 14:54:26 +0000 Received: from localhost ([127.0.0.1]:42554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM94b-0006N4-Di for submit@debbugs.gnu.org; Sun, 29 Jan 2023 09:54:26 -0500 Received: from mail-wm1-f54.google.com ([209.85.128.54]:44630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM94Y-0006Mo-M4 for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 09:54:24 -0500 Received: by mail-wm1-f54.google.com with SMTP id l41-20020a05600c1d2900b003daf986faaeso6528140wms.3 for <60841@debbugs.gnu.org>; Sun, 29 Jan 2023 06:54:22 -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=CFqjxTehHg56GKv5bIlrv/PIXLt3QEZAgj1slFLbmxc=; b=X8mcQ5PhOepRT6xcxIBAfxPHvktqgyKkmONx2uZRYgEfQRPdldjcZl97sDRuRIrMnI JzU6OZwhVufaWxxxKmSnV1RoP8tpK295oc1UNS16zRDmDUfebZSidMPLeDPCyXcwmq5D 7BhfH1eJRhlciDuS8NODOYRjFa/5w59hkuUdw3+0j3sBXeOfyji/YzF0wjbiPgagYKAS j7JyTR+jlsjb3NzxoTSsrsYL8f5DfGT2bPJbwIDHqGlMHRC41DuLohN+WeMCWC0XfFXf 4Ex5ViZEaZYyeNbjfjdgFnb/xYXmA+cd7IvLdO0ZralbZy74AURhkhPpLTdgcgcaMqRK fSiQ== 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=CFqjxTehHg56GKv5bIlrv/PIXLt3QEZAgj1slFLbmxc=; b=AMDNW0+k0UIcwb2wwJlNWYdwuuWCD5za5R0fRQHndrGa5nCcSvDMR0q6wPCu/ZSpSw nBWQ3BPrpsBMvQaFRWnC28OZWpoM1ALdb4HuA6Tfd7kOb3lS9XRkNLZ9aB9Y+G3iHN6/ Pslge565ysHmY2h3Cle5o1TAmfdP9U6dsTuj/5OhTD46xCvkI0Bb6Hv7nMYUIW7Qt2PX 38+5e6LCjHw0U73XP7UQJOy3nxIZarFydTs95EK7RAvdRS6EtboGSZzCMU8YkwoxX9XX PdZvD0vrxYBXs9B/Ze940oDjd5iKKS5LGxFH9IBLCl3gc5EkupP71lGvwptqDOYhFQ+z 5P6w== X-Gm-Message-State: AO0yUKVkjn2EAtZkVeOvqamUp5YCIJIxAV5ycL7od3CKOUvz5D/pgpcw asgHkwpglXTk0U3xEJcQJDE= X-Google-Smtp-Source: AK7set9dWwtHW/yQr6pcXkCRid5i2Hz8bfIKhWe76jpWPkXN6KAvkGQClr/OqqLI98t9vVQSoe4ZGA== X-Received: by 2002:a05:600c:6008:b0:3da:282b:e774 with SMTP id az8-20020a05600c600800b003da282be774mr2626336wmb.38.1675004056458; Sun, 29 Jan 2023 06:54:16 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id j6-20020a05600c42c600b003dc521f336esm2856786wme.14.2023.01.29.06.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 06:54:15 -0800 (PST) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <831qnea5ye.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Jan 2023 20:07:21 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> Date: Sun, 29 Jan 2023 15:54:14 +0100 Message-ID: <87357t2xyh.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: K=C3=A9vin Le Gouguec >> Cc: gregory@heytings.org, 60841@debbugs.gnu.org >> Date: Sat, 28 Jan 2023 18:45:07 +0100 >>=20 >> 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 >>=20 >> * :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 >>=20 >> 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)? The only place where this "matters" is in replace.el, AFAICT: 1. Customize list-matching-lines-prefix-face to 'default, 2. (face-differs-from-default-p list-matching-lines-prefix-face) =E2=86=A6 :stipple 3. Luckily this does not impact replace-el:occur-1, since this check=E2=80= =A6 (if (face-differs-from-default-p list-matching-lines-prefix-face) list-matching-lines-prefix-face) =E2=80=A6 is redundant AFAIU: the goal is to _not_ apply list-matching-lines-prefix-face if it is close to 'default, and instead=E2=80=A6 leave the default face? So why bother checking? CC'ing Juri, who installed this check in bug#14017, for comment in case I missed something. (Hi Juri =F0=9F=91=8B For context, the current report is about refining indicate-copied-region to avoid spuriously considering the region as "unhighlighted" and triggering the point-mark swap; see attached patches. I believe this aspect of the report might also be of interest to you, given your participation in bug#42865) >> > 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. >>=20 >> 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. OK, two tentative patches attached, because I don't know which makes for the better UX: =E2=96=BC Copy Region Inhibit Blink: Choice: (*) region-stands-out-p Whether the region can be distinguished visually. More ( ) always Always inhibit: never blink point and mark. ( ) ignore Never inhibit: always blink point and mark. ( ) Other predicate function.: ignore State : STANDARD. Whether we should refrain from blinking the cursor after a copy. =E2= =96=BC When this condition holds, =E2=80=98kill-ring-save=E2=80=99 will not= blink the cursor between point and mark to denote the copied region. Groups: Killing =E2=81=82 VS =E2=81=82 =E2=96=BC Copy Region Blink Predicate: Choice: (*) region-indistinguishable-p Whether the current region is not denoted visually. =E2=96=BC This holds when the region is inactive, or when the =E2=80=98region= =E2=80=99 face cannot be distinguished from the =E2=80=98default=E2=80=99 face. ( ) always Always blink point and mark. ( ) ignore Never blink point and mark. ( ) Other predicate function.: ignore State : STANDARD. Whether the cursor must be blinked after a copy. =E2=96=BC When this condition holds, and the copied region fits in the current window, =E2=80=98kill-ring-save=E2=80=99 will blink the curs= or between point and mark for =E2=80=98copy-region-blink-delay=E2=80=99 seconds. Groups: Killing inhibit-vs-predicate.diff shows a comparison of both patches once applied. Boldly marked the new options with "---" in NEWS, because copy-region-blink-delay is not documented in the manual either, but let me know if that should be remedied. Thank you for your time. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=copy-region-blink-predicate.patch >From 7ba1128b72fda681f1368d862e5979d8e340957a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 29 Jan 2023 11:23:01 +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/faces.el (face-differs-from-default-p): Filter out :extend; add rationale for the attributes we ignore. * lisp/simple.el (copy-region-blink-predicate): Add option to let user explicitly opt into or out of blinking point and mark. (region-indistinguishable-p): New function to detect "if there is currently no active region highlighting", leveraging face-differs-from-default-p. (indicate-copied-region): Use it. * etc/NEWS: Announce user option. --- etc/NEWS | 13 +++++++++++++ lisp/faces.el | 11 ++++++++++- lisp/simple.el | 22 ++++++++++++++++++++-- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index e0175bacfdf..56b6add5d98 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -59,6 +59,19 @@ This allows the user to customize the prompt that is appended by * Editing Changes in Emacs 30.1 +--- +** New user option 'copy-region-blink-predicate'. +By default, when copying a region with 'kill-ring-save', Emacs only +blinks point and mark when the region is not denoted visually, that +is, when either the region is inactive, or the 'region' face is +indistinguishable from the 'default' face. + +The way Emacs evaluated this latter condition sometimes yielded false +positives, so point and mark would blink despite the region being +active and visually distinct. The false positive was fixed; users who +consider blinking unconditionally to be a feature can now set this +user option to 'always'. + --- ** New command 'kill-matching-buffers-no-ask'. This works like 'kill-matching-buffers', but without asking for 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..5832d6449bf 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5871,6 +5871,25 @@ copy-region-blink-delay :group 'killing :version "28.1") +(defcustom copy-region-blink-predicate #'region-indistinguishable-p + "Whether the cursor must be blinked after a copy. +When this condition holds, and the copied region fits in the +current window, `kill-ring-save' will blink the cursor between +point and mark for `copy-region-blink-delay' seconds." + :type '(radio (function-item region-indistinguishable-p) + (function-item :doc "Always blink point and mark." always) + (function-item :doc "Never blink point and mark." ignore) + (function :tag "Other predicate function.")) + :group 'killing + :version "30.1") + +(defun region-indistinguishable-p () + "Whether the current region is not denoted visually. +This holds when the region is inactive, or when the `region' face +cannot be distinguished from the `default' face." + (not (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 +5910,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)))) + (funcall copy-region-blink-predicate)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) -- 2.39.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=copy-region-inhibit-blink.patch >From 5fc9250f02cbb26d6c2765a3fa7893f66fa4e6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 29 Jan 2023 11:23:01 +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/faces.el (face-differs-from-default-p): Filter out :extend; add rationale for the attributes we ignore. * lisp/simple.el (copy-region-inhibit-blink): Add option to let user explicitly opt into or out of blinking point and mark. (region-stands-out-p): New function to detect "if the region is highlighted", leveraging face-differs-from-default-p. (indicate-copied-region): Use it. * etc/NEWS: Announce user option. --- etc/NEWS | 13 +++++++++++++ lisp/faces.el | 11 ++++++++++- lisp/simple.el | 21 +++++++++++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index e0175bacfdf..b69b5af9101 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -59,6 +59,19 @@ This allows the user to customize the prompt that is appended by * Editing Changes in Emacs 30.1 +--- +** New user option 'copy-region-inhibit-blink. +By default, when copying a region with 'kill-ring-save', Emacs +refrains from blinking point and mark when the region is denoted +visually, that is, when the region is active, and the 'region' face is +visibly distinct from the 'default' face. + +The way Emacs evaluated this latter condition sometimes yielded false +negatives, so point and mark would blink despite the region being +active and visually distinct. The false negative was fixed; users who +consider blinking unconditionally to be a feature can now set this +user option to 'ignore'. + --- ** New command 'kill-matching-buffers-no-ask'. This works like 'kill-matching-buffers', but without asking for 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..b5e6255fca9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5871,6 +5871,24 @@ copy-region-blink-delay :group 'killing :version "28.1") +(defcustom copy-region-inhibit-blink #'region-stands-out-p + "Whether we should refrain from blinking the cursor after a copy. +When this condition holds, `kill-ring-save' will not blink the +cursor between point and mark to denote the copied region." + :type '(radio (function-item region-stands-out-p) + (function-item :doc "Always inhibit: never blink point and mark." always) + (function-item :doc "Never inhibit: always blink point and mark." ignore) + (function :tag "Other predicate function.")) + :group 'killing + :version "30.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 +5909,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 (funcall copy-region-inhibit-blink))) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) -- 2.39.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=inhibit-vs-predicate.diff diff --git a/etc/NEWS b/etc/NEWS index b69b5af9101..56b6add5d98 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -60,17 +60,17 @@ This allows the user to customize the prompt that is appended by * Editing Changes in Emacs 30.1 --- -** New user option 'copy-region-inhibit-blink. -By default, when copying a region with 'kill-ring-save', Emacs -refrains from blinking point and mark when the region is denoted -visually, that is, when the region is active, and the 'region' face is -visibly distinct from the 'default' face. +** New user option 'copy-region-blink-predicate'. +By default, when copying a region with 'kill-ring-save', Emacs only +blinks point and mark when the region is not denoted visually, that +is, when either the region is inactive, or the 'region' face is +indistinguishable from the 'default' face. The way Emacs evaluated this latter condition sometimes yielded false -negatives, so point and mark would blink despite the region being -active and visually distinct. The false negative was fixed; users who +positives, so point and mark would blink despite the region being +active and visually distinct. The false positive was fixed; users who consider blinking unconditionally to be a feature can now set this -user option to 'ignore'. +user option to 'always'. --- ** New command 'kill-matching-buffers-no-ask'. diff --git a/lisp/simple.el b/lisp/simple.el index b5e6255fca9..5832d6449bf 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5871,23 +5871,24 @@ copy-region-blink-delay :group 'killing :version "28.1") -(defcustom copy-region-inhibit-blink #'region-stands-out-p - "Whether we should refrain from blinking the cursor after a copy. -When this condition holds, `kill-ring-save' will not blink the -cursor between point and mark to denote the copied region." - :type '(radio (function-item region-stands-out-p) - (function-item :doc "Always inhibit: never blink point and mark." always) - (function-item :doc "Never inhibit: always blink point and mark." ignore) +(defcustom copy-region-blink-predicate #'region-indistinguishable-p + "Whether the cursor must be blinked after a copy. +When this condition holds, and the copied region fits in the +current window, `kill-ring-save' will blink the cursor between +point and mark for `copy-region-blink-delay' seconds." + :type '(radio (function-item region-indistinguishable-p) + (function-item :doc "Always blink point and mark." always) + (function-item :doc "Never blink point and mark." ignore) (function :tag "Other predicate function.")) :group 'killing :version "30.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 region-indistinguishable-p () + "Whether the current region is not denoted visually. +This holds when the region is inactive, or when the `region' face +cannot be distinguished from the `default' face." + (not (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. @@ -5909,7 +5910,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) - (not (funcall copy-region-inhibit-blink))) + (funcall copy-region-blink-predicate)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 10:41:14 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 15:41:14 +0000 Received: from localhost ([127.0.0.1]:45233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM9nu-0008EG-9I for submit@debbugs.gnu.org; Sun, 29 Jan 2023 10:41:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pM9ns-0008Dz-FH for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 10:41:13 -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 ) id 1pM9nm-0006eP-7a; Sun, 29 Jan 2023 10:41:06 -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=joeRJAopu+BMewDLDwn7stLUk2as7ePlttNl4hYmfMQ=; b=Of96vp5eqCyGYUZEYmCq OErmrhLc/cFM41NQDnhAHsdFe/t4fcU7czxw8zYKfc3dZxMZsedWwiHf3oj0TVBq5ncAdC+VYLT2F ELlUjJKxfCiAhz5x8Sxa8LEwgJnkVC27DBHpfBuoVuSkdNi5bHDj3OFu2AqVytNygwmbpfq1zUT4u yYYS4+sD3EmNzf19aGdkSDEkPAvx88Xjfh7dCNws08IXjYXXkXSbpegqXfxnMfpHxi0Y2BqHDmAj4 BtO8QBNCsLvqTEagSTUk+NhyrlOkrjsRov4G7vLNU2K5ENete1C+tqliDz8diXLdByXoTrDhDShPJ C+kWoO31vEn0OA==; 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 1pM9nl-00023p-MK; Sun, 29 Jan 2023 10:41:06 -0500 Date: Sun, 29 Jan 2023 17:40:56 +0200 Message-Id: <83k01573hz.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87357t2xyh.fsf@gmail.com> (message from =?utf-8?Q?K=C3=A9vin?= Le Gouguec on Sun, 29 Jan 2023 15:54:14 +0100) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Cc: gregory@heytings.org, 60841@debbugs.gnu.org, Juri Linkov > Date: Sun, 29 Jan 2023 15:54:14 +0100 > > OK, two tentative patches attached, because I don't know which makes for > the better UX: > > ▼ Copy Region Inhibit Blink: > Choice: > (*) region-stands-out-p > Whether the region can be distinguished visually. More > ( ) always > Always inhibit: never blink point and mark. > ( ) ignore > Never inhibit: always blink point and mark. > ( ) Other predicate function.: ignore > State : STANDARD. > Whether we should refrain from blinking the cursor after a copy. ▼ > When this condition holds, ‘kill-ring-save’ will not blink the > cursor between point and mark to denote the copied region. > Groups: Killing > > ⁂ VS ⁂ > > ▼ Copy Region Blink Predicate: > Choice: > (*) region-indistinguishable-p > Whether the current region is not denoted visually. ▼ > This holds when the region is inactive, or when the ‘region’ face > cannot be distinguished from the ‘default’ face. > ( ) always > Always blink point and mark. > ( ) ignore > Never blink point and mark. > ( ) Other predicate function.: ignore > State : STANDARD. > Whether the cursor must be blinked after a copy. ▼ > When this condition holds, and the copied region fits in the > current window, ‘kill-ring-save’ will blink the cursor between > point and mark for ‘copy-region-blink-delay’ seconds. > Groups: Killing I prefer the second one, since inhibit-SOMETHING is slightly harder to grasp, due to the negation. The second paragraph of the NEWS entry shouldn't be there: it tells that we fixed a bug. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 13:32:54 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 18:32:54 +0000 Received: from localhost ([127.0.0.1]:45372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMCU2-0006pt-1C for submit@debbugs.gnu.org; Sun, 29 Jan 2023 13:32:54 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:51615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMCU0-0006pa-Di for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 13:32:52 -0500 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 09841240004; Sun, 29 Jan 2023 18:32:41 +0000 (UTC) From: Juri Linkov To: =?iso-8859-1?Q?K=E9vin?= Le Gouguec Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <87357t2xyh.fsf@gmail.com> (=?iso-8859-1?Q?=22K=E9vin?= Le Gouguec"'s message of "Sun, 29 Jan 2023 15:54:14 +0100") Organization: LINKOV.NET References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> Date: Sun, 29 Jan 2023 19:55:00 +0200 Message-ID: <86ilgpb3lv.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60841 Cc: Eli Zaretskii , 60841@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> * :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)? > > The only place where this "matters" is in replace.el, AFAICT: > > 1. Customize list-matching-lines-prefix-face to 'default, > > 2. (face-differs-from-default-p list-matching-lines-prefix-face) > ↦ :stipple I still don't understand why (face-differs-from-default-p 'default) should return :stipple even in a clean state after emacs -Q. This means that the default face always differs from itself? Isn't it natural to expect that this relation should be reflexive? > 3. Luckily this does not impact replace-el:occur-1, since this check… > > (if (face-differs-from-default-p list-matching-lines-prefix-face) > list-matching-lines-prefix-face) > > … is redundant AFAIU: the goal is to _not_ apply > list-matching-lines-prefix-face if it is close to 'default, and > instead… leave the default face? So why bother checking? > > CC'ing Juri, who installed this check in bug#14017, for comment in case > I missed something. Sorry, I don't remember the reason for this check. But looking now it seems it's just optimization to not run the code that puts unnecessary font-lock-face properties. > (Hi Juri 👋 For context, the current report is about refining > indicate-copied-region to avoid spuriously considering the region as > "unhighlighted" and triggering the point-mark swap; see attached > patches. I believe this aspect of the report might also be of interest > to you, given your participation in bug#42865) Thanks, I like your patch that adds copy-region-blink-predicate. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 14:09:35 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 19:09:35 +0000 Received: from localhost ([127.0.0.1]:45399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMD3X-0007lG-G6 for submit@debbugs.gnu.org; Sun, 29 Jan 2023 14:09:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMD3V-0007l4-VL for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 14:09:35 -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 ) id 1pMD3Q-0003wV-3E; Sun, 29 Jan 2023 14:09:28 -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=ylXg3fqXwO6M6dnbB7pQ+yiGS4mesjwPmq57av2Geok=; b=gA2x14iR0QLcXiTbu3lZ KSZJRhQDqp2bX7pgyZ+AZC7uj/dnid+OAtWsRVnmU3zZpbNIXPW/eA/agMehLNs9iQbpSebX8Iu+b Z4n6L2GveFdiFwxrZ+BGPImSmw+KsxaBQxPpCWgyExSP2DtEjDBfrNUZZiEL++BhSf5he82gIq4rq mazT2jvrWCb3wJrgAneAEnJcNSqqppzvwnhG+E3fDXrYIhJc37dFGnE8oZERxAn0nzDGC438ynv1t opma3e8mS2QJ9HXguzdKNhYpp/4uonvlPV29xEwTXpTyGmsRDj8hMxiTRqwG/QHj2l5svenZA5d9x bNaNVTUoNznImw==; 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 1pMD3P-0001Od-IZ; Sun, 29 Jan 2023 14:09:27 -0500 Date: Sun, 29 Jan 2023 21:09:18 +0200 Message-Id: <831qnd6tup.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86ilgpb3lv.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 29 Jan 2023 19:55:00 +0200) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <86ilgpb3lv.fsf@mail.linkov.net> 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@heytings.org, 60841@debbugs.gnu.org, kevin.legouguec@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: Eli Zaretskii , gregory@heytings.org, 60841@debbugs.gnu.org > Date: Sun, 29 Jan 2023 19:55:00 +0200 > > > The only place where this "matters" is in replace.el, AFAICT: > > > > 1. Customize list-matching-lines-prefix-face to 'default, > > > > 2. (face-differs-from-default-p list-matching-lines-prefix-face) > > ↦ :stipple > > I still don't understand why (face-differs-from-default-p 'default) > should return :stipple even in a clean state after emacs -Q. > This means that the default face always differs from itself? Because face-differs-from-default-p thinks attributes are unset only if their value is 'unspecified'. We should fix that so the function knows about nil as well. (:stipple is simply the last attribute in the list returned by (delq :inherit (mapcar 'car face-attribute-name-alist)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 14:33:57 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 19:33:57 +0000 Received: from localhost ([127.0.0.1]:45426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMDR6-0008Mc-Sz for submit@debbugs.gnu.org; Sun, 29 Jan 2023 14:33:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMDR4-0008MP-Ul for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 14:33:55 -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 ) id 1pMDQy-0007bM-L9; Sun, 29 Jan 2023 14:33:48 -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=66VmD1EFhcDpin46EzYeXxlV09os8gDUHp9PClpFAT8=; b=bXHxLu/wVbGWpXaaGxlx HK8H+qJUX0DBRfsqex8IDqkJ/xraCF4G/JPCUPo8VZP8ZG3IpAHc8cgStLTjsj9l0MHuVCDtDD47U z3pIHs+ryejz6kTYZ2HptsFejXK8pCzmaHe0w6FuuR3H79Q7gZtvLmRYwR3BXOy1zxQIq8ItVjKdk xP9RD64gnic0qsrPfEzDisq6JY++cssr7iR00ahpWQduzWGHFKFEP5OHhTqnqjXQM69H+dyzb4Ak5 2vAJMe9QBkH5On99m5owtU/tBZKUZ4x91nXXjxefSkKk/JDERcGuI9DL0lWu6Ju2Ss3YKW5EeP70/ 58dqq+G4XS7RQQ==; 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 1pMDQy-0007Vm-4n; Sun, 29 Jan 2023 14:33:48 -0500 Date: Sun, 29 Jan 2023 21:33:38 +0200 Message-Id: <83zga15e5p.fsf@gnu.org> From: Eli Zaretskii To: juri@linkov.net In-Reply-To: <831qnd6tup.fsf@gnu.org> (message from Eli Zaretskii on Sun, 29 Jan 2023 21:09:18 +0200) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <86ilgpb3lv.fsf@mail.linkov.net> <831qnd6tup.fsf@gnu.org> 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@heytings.org, 60841@debbugs.gnu.org, kevin.legouguec@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: gregory@heytings.org, 60841@debbugs.gnu.org, kevin.legouguec@gmail.com > Date: Sun, 29 Jan 2023 21:09:18 +0200 > From: Eli Zaretskii > > > > 2. (face-differs-from-default-p list-matching-lines-prefix-face) > > > ↦ :stipple > > > > I still don't understand why (face-differs-from-default-p 'default) > > should return :stipple even in a clean state after emacs -Q. > > This means that the default face always differs from itself? > > Because face-differs-from-default-p thinks attributes are unset only > if their value is 'unspecified'. We should fix that so the function > knows about nil as well. I think face-differs-from-default-p should look like this: (defun face-differs-from-default-p (face &optional frame) "Return non-nil if FACE displays differently from the default face. 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 (delq :extend (mapcar 'car face-attribute-name-alist)))) (differs nil)) (while (and attrs (not differs)) (let* ((attr (pop attrs)) (attr-val (face-attribute face attr frame t))) (when (and (not (eq attr-val 'unspecified)) (not (equal attr-val (face-attribute 'default attr frame))) (display-supports-face-attributes-p (list attr attr-val) frame)) (setq differs attr)))) differs)) From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 15:32:58 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 20:32:59 +0000 Received: from localhost ([127.0.0.1]:45457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMEME-0001M5-Hv for submit@debbugs.gnu.org; Sun, 29 Jan 2023 15:32:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMEMC-0001Lq-R2 for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 15:32: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 ) id 1pMEM7-0000DW-10; Sun, 29 Jan 2023 15:32:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=S66l9SMXp2ljNFdkAWLgaux2gLI1yopJnr2SGihhtTU=; b=KxwLFMdxKBJv Kw0Dx1XxrNAh9UMbx8F5WI8HmUcblOcleTkpz8co3dmfo/gLdBhphfYYa2qEbzPx3iIF+2g82ba8S firo4Uvu+1JNYeCrw9Z8vAmwtxzzxCtAMIxr4aQDAQSO2Ebf27C/+lVUkoVtTW17H3eNB6/5RosMS PLf5stRay9ZZZ5SfsRb9rt8fFt0G2DgnSQvLldE449L1kMVtdSAtAiBgkl75cEzbWgzk0nRbTY2iZ L8J3ZC7RhfPK1F6U/RXN3713AvhDJ8EvocGw+3ORzfAPlASAGUzf2rMdtjZhplGBE+75190Yc2RCi 8yvNTTi+CB6kUUJMKNNc3A==; 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 1pMEM5-0002wc-MS; Sun, 29 Jan 2023 15:32:50 -0500 Date: Sun, 29 Jan 2023 22:32:40 +0200 Message-Id: <83tu095bfb.fsf@gnu.org> From: Eli Zaretskii To: kevin.legouguec@gmail.com In-Reply-To: <83zga15e5p.fsf@gnu.org> (message from Eli Zaretskii on Sun, 29 Jan 2023 21:33:38 +0200) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <86ilgpb3lv.fsf@mail.linkov.net> <831qnd6tup.fsf@gnu.org> <83zga15e5p.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60841 Cc: gregory@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: gregory@heytings.org, 60841@debbugs.gnu.org, kevin.legouguec@gmail.com > Date: Sun, 29 Jan 2023 21:33:38 +0200 > From: Eli Zaretskii > > I think face-differs-from-default-p should look like this: > > (defun face-differs-from-default-p (face &optional frame) > "Return non-nil if FACE displays differently from the default face. > 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 (delq :extend (mapcar 'car face-attribute-name-alist)))) > (differs nil)) > (while (and attrs (not differs)) > (let* ((attr (pop attrs)) > (attr-val (face-attribute face attr frame t))) > (when (and > (not (eq attr-val 'unspecified)) > (not (equal attr-val (face-attribute 'default attr frame))) > (display-supports-face-attributes-p (list attr attr-val) > frame)) > (setq differs attr)))) > differs)) Actually, I take this back: the 'equal' part is already done by display-supports-face-attributes-p. The problem with :stipple is that we don't allow nil as the value of :stipple. If you evaluate (setq list-matching-lines-prefix-face 'default) (face-differs-from-default-p list-matching-lines-prefix-face) then look in *Messages*, you will see: Invalid face attribute :stipple nil So we need to treat :stipple specially, or maybe fix merge_face_ref to allow the nil value. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 17:57:43 2023 Received: (at 60841) by debbugs.gnu.org; 29 Jan 2023 22:57:43 +0000 Received: from localhost ([127.0.0.1]:45548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMGcI-00057S-Dj for submit@debbugs.gnu.org; Sun, 29 Jan 2023 17:57:43 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:37505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMGcG-00057G-NU for 60841@debbugs.gnu.org; Sun, 29 Jan 2023 17:57:41 -0500 Received: by mail-wr1-f50.google.com with SMTP id q10so9534383wrm.4 for <60841@debbugs.gnu.org>; Sun, 29 Jan 2023 14:57:40 -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=MVV1NTd/1yHtKczL/qvHAgtKkml7ilpUCW0r92/UF6c=; b=B97kMLYDy17udLUhTZmGwk9omy3AREsLzCQTJ9cKdiTtIRdrhrujHq3PUfAlks84et m8O8AZ0dK955oSuvta4U5jhUKFGyi5CS9ovoCt6xU8TA8MXCMfm3jXHM4ROI4grGoRpy rVbCpL4UEG9/4V/+AzwrY6TkqALx3KhNBLcWRR4dHgzb/i7SkfTMokbPMX2fxxrjxXjI K+GR8G4WdW1Y3QwHBx5P/7r+JFai73u2J11oFee2b3v7CikOPv0SEfFe/pmIj5OFRBYd yro8lT7swZMztm5bf0X7bDv7CiXo7cwVhtbUlmVMPTrBqppLs8WbfCt4Q5wSWvaAFlzP LOMQ== 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=MVV1NTd/1yHtKczL/qvHAgtKkml7ilpUCW0r92/UF6c=; b=oFMIlayG+2XZFyQ/9Nc/YQrApcso9/9tVjN/HDaZLvvXER58n32t4G51GXGrjphR+a aaY5LIvaGYWIGuX2xYe+gDRZc9CyxyQTeYcDFpD0Jq3Yqf7a0FTDyU69hrEURqoYBloi o1f0rLl4F00SNc+ORixRrMJW/k8xtvC0Soj0N1ctpi5DPFZ+HZiLlmRp8wK/i10Z0gn7 gpiW3gGq6BcornpyeBZe4/aMtWmkRZGKuow9AYXJw5FPgUwO93IWjV62MhpO5CwC4bHl JuRtOFrmmrFzRpMLxP9QKs5CaGm9RW8b5fxBu/wYPrTXMFMZzvfp9UpxU5/5eq9mMCqK ZX/w== X-Gm-Message-State: AO0yUKXfDr4U+034AvaikL3uMoyxA+oQ9JxK9ZWeb10zMkI1Ljc6Iu+k wkWKqMlCPbymgSZf7EX5XWg= X-Google-Smtp-Source: AK7set+WvW6FtS3P1cZ0Rk2LKJPzqqPUyzXISFZZ9VTJXWBp8p0+NSVoTSMnYt0Gu2eZf3UThosv0A== X-Received: by 2002:a5d:4951:0:b0:2bf:d425:11ba with SMTP id r17-20020a5d4951000000b002bfd42511bamr8886350wrs.22.1675033054647; Sun, 29 Jan 2023 14:57:34 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id r6-20020adff106000000b002bfe05bf6dcsm4882477wro.88.2023.01.29.14.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 14:57:33 -0800 (PST) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83k01573hz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 29 Jan 2023 17:40:56 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <83k01573hz.fsf@gnu.org> Date: Sun, 29 Jan 2023 23:57:33 +0100 Message-ID: <87v8kpj6ea.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> =E2=96=BC Copy Region Inhibit Blink: >> Choice: >> (*) region-stands-out-p >> Whether the region can be distinguished visually. More >> ( ) always >> Always inhibit: never blink point and mark. >> ( ) ignore >> Never inhibit: always blink point and mark. >> ( ) Other predicate function.: ignore >> State : STANDARD. >> Whether we should refrain from blinking the cursor after a copy. = =E2=96=BC >> When this condition holds, =E2=80=98kill-ring-save=E2=80=99 will = not blink the >> cursor between point and mark to denote the copied region. >> Groups: Killing >>=20 >> =E2=81=82 VS =E2=81=82 >>=20 >> =E2=96=BC Copy Region Blink Predicate: >> Choice: >> (*) region-indistinguishable-p >> Whether the current region is not denoted visually. =E2=96=BC >> This holds when the region is inactive, or when the =E2=80=98reg= ion=E2=80=99 face >> cannot be distinguished from the =E2=80=98default=E2=80=99 face. >> ( ) always >> Always blink point and mark. >> ( ) ignore >> Never blink point and mark. >> ( ) Other predicate function.: ignore ^ (Booh, that's ugly. Removed in the attached) >> State : STANDARD. >> Whether the cursor must be blinked after a copy. =E2=96=BC >> When this condition holds, and the copied region fits in the >> current window, =E2=80=98kill-ring-save=E2=80=99 will blink the c= ursor between >> point and mark for =E2=80=98copy-region-blink-delay=E2=80=99 seco= nds. >> Groups: Killing > > I prefer the second one, since inhibit-SOMETHING is slightly harder to > grasp, due to the negation. ACK. > The second paragraph of the NEWS entry shouldn't be there: it tells > that we fixed a bug. Right; in this instance I wondered if we should call out what some users could perceive as a "regression". I suppose it doesn't matter; if they are indeed reading NEWS, they'll find this entry whether it mentions the bug or not (since it mentions kill-ring-save). Adjusted the entry in the attached. Re. :stipple: > The problem with :stipple is that we don't allow nil as the value of > :stipple. If you evaluate >=20 > (setq list-matching-lines-prefix-face 'default) > (face-differs-from-default-p list-matching-lines-prefix-face) >=20 > then look in *Messages*, you will see: >=20 > Invalid face attribute :stipple nil (=C5=92il de lynx !) > So we need to treat :stipple specially, or maybe fix merge_face_ref to > allow the nil value. You mean something like the following? (Thoroughly untested, beside passing the (null (face-differs-from-default-p 'default)) test) diff --git a/src/xfaces.c b/src/xfaces.c index 35b79154805..62d7823f308 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2780,8 +2780,7 @@ merge_face_ref (struct window *w, else if (EQ (keyword, QCstipple)) { #if defined (HAVE_WINDOW_SYSTEM) - Lisp_Object pixmap_p =3D Fbitmap_spec_p (value); - if (!NILP (pixmap_p)) + if (NILP (value) || !NILP (Fbitmap_spec_p (value))) to[LFACE_STIPPLE_INDEX] =3D value; else err =3D true; OT1H that's the kind of sleeping dragon that I wouldn't want to tickle, OTOH I see that other spots in the code seem to accept QCstipple mapping to a NILP value: else if (EQ (attr, QCstipple)) { #if defined (HAVE_WINDOW_SYSTEM) if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) && !RESET_P (value) && !NILP (value) && NILP (Fbitmap_spec_p (value))) signal_error ("Invalid stipple attribute", value); old_value =3D LFACE_STIPPLE (lface); ASET (lface, LFACE_STIPPLE_INDEX, value); #endif /* HAVE_WINDOW_SYSTEM */ } =E2=80=94 Finternal_set_lisp_face_attribute --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Avoid-spurious-pause-in-kill-ring-save-Bug-60841.patch >From d767d5c658278bb102dea9a716da7a04dccb34aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 29 Jan 2023 11:23:01 +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/faces.el (face-differs-from-default-p): Filter out :extend; add rationale for the attributes we ignore. * lisp/simple.el (copy-region-blink-predicate): Add option to let user explicitly opt into or out of blinking point and mark. (region-indistinguishable-p): New function to detect "if there is currently no active region highlighting", leveraging face-differs-from-default-p. (indicate-copied-region): Use it. * etc/NEWS: Announce user option. --- etc/NEWS | 12 ++++++++++++ lisp/faces.el | 11 ++++++++++- lisp/simple.el | 22 ++++++++++++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index e0175bacfdf..6a069b74332 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -59,6 +59,18 @@ This allows the user to customize the prompt that is appended by * Editing Changes in Emacs 30.1 +--- +** New user option 'copy-region-blink-predicate'. +By default, when copying a region with 'kill-ring-save', Emacs only +blinks point and mark when the region is not denoted visually, that +is, when either the region is inactive, or the 'region' face is +indistinguishable from the 'default' face. + +Users who would rather enable blinking unconditionally can now set +this user option to 'always'. To disable blinking unconditionally, +either set this option to 'ignore', or set 'copy-region-blink-delay' +to 0. + --- ** New command 'kill-matching-buffers-no-ask'. This works like 'kill-matching-buffers', but without asking for 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..94b08543f44 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5871,6 +5871,25 @@ copy-region-blink-delay :group 'killing :version "28.1") +(defcustom copy-region-blink-predicate #'region-indistinguishable-p + "Whether the cursor must be blinked after a copy. +When this condition holds, and the copied region fits in the +current window, `kill-ring-save' will blink the cursor between +point and mark for `copy-region-blink-delay' seconds." + :type '(radio (function-item region-indistinguishable-p) + (function-item :doc "Always blink point and mark." always) + (function-item :doc "Never blink point and mark." ignore) + (function :tag "Other predicate function")) + :group 'killing + :version "30.1") + +(defun region-indistinguishable-p () + "Whether the current region is not denoted visually. +This holds when the region is inactive, or when the `region' face +cannot be distinguished from the `default' face." + (not (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 +5910,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)))) + (funcall copy-region-blink-predicate)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) -- 2.39.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 30 07:42:07 2023 Received: (at 60841) by debbugs.gnu.org; 30 Jan 2023 12:42:07 +0000 Received: from localhost ([127.0.0.1]:46581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMTU7-0000mu-9x for submit@debbugs.gnu.org; Mon, 30 Jan 2023 07:42:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMTU6-0000mM-38 for 60841@debbugs.gnu.org; Mon, 30 Jan 2023 07:42:06 -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 ) id 1pMTU0-0006P9-22; Mon, 30 Jan 2023 07:42:00 -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=gKqMJ6UaT4F9OGorXl8ot+hvFFtIkPG506RQ8DHF5ks=; b=jYEP6iL12DWSATEPF2TV v8NXC2fGX1nBukJ+StBmvVVv5VovvXfB9bzP8RNPzW/Bu+MarabYwyc40Ppne2B7EcSvHsQg2B0E0 RAA+r7x+If0R1oz6d3VwOHDjBOCBwzjMamAmzvQQUplCuuc3OAi/yeF93IReTkHeFgKsPAljYinpe m0dwK/d0pPR7nXT9AOvF4GNaxkLETrGyzsrC7tZD5BGJDx+u+BUatexpaLUz3mZpa5tpVMERa6i9a wsiBku3WsjSrTP1tcGGZ2vptdsL1gObDUqedvhVHeKWMsTIQBVFdDuNQ6aignfTIvsdMAPYJ59Vpz CLoYriWtNsrxyw==; 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 1pMTTz-00049A-2f; Mon, 30 Jan 2023 07:41:59 -0500 Date: Mon, 30 Jan 2023 14:41:52 +0200 Message-Id: <83mt605h4f.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec In-Reply-To: <87v8kpj6ea.fsf@gmail.com> (message from =?utf-8?Q?K=C3=A9vin?= Le Gouguec on Sun, 29 Jan 2023 23:57:33 +0100) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <83k01573hz.fsf@gnu.org> <87v8kpj6ea.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kévin Le Gouguec > Cc: gregory@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net > Date: Sun, 29 Jan 2023 23:57:33 +0100 > > > So we need to treat :stipple specially, or maybe fix merge_face_ref to > > allow the nil value. > > You mean something like the following? Yes. > OT1H that's the kind of sleeping dragon that I wouldn't want to tickle, > OTOH I see that other spots in the code seem to accept QCstipple mapping > to a NILP value: Exactly. The nil value is also documented as a valid one. So we must make that change in xfaces.c. > >From d767d5c658278bb102dea9a716da7a04dccb34aa Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= > Date: Sun, 29 Jan 2023 11:23:01 +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/faces.el (face-differs-from-default-p): Filter out :extend; add > rationale for the attributes we ignore. > * lisp/simple.el (copy-region-blink-predicate): Add option to let user > explicitly opt into or out of blinking point and mark. > (region-indistinguishable-p): New function to detect > "if there is currently no active region highlighting", leveraging > face-differs-from-default-p. > (indicate-copied-region): Use it. > * etc/NEWS: Announce user option. Please add the xfaces.c change, and then this can go in (to the emacs-29 branch). Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 30 17:38:34 2023 Received: (at 60841) by debbugs.gnu.org; 30 Jan 2023 22:38:34 +0000 Received: from localhost ([127.0.0.1]:50825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMcnJ-0000yX-GY for submit@debbugs.gnu.org; Mon, 30 Jan 2023 17:38:34 -0500 Received: from mail-wm1-f54.google.com ([209.85.128.54]:40896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMcnI-0000yH-9o for 60841@debbugs.gnu.org; Mon, 30 Jan 2023 17:38:32 -0500 Received: by mail-wm1-f54.google.com with SMTP id j32-20020a05600c1c2000b003dc4fd6e61dso4315505wms.5 for <60841@debbugs.gnu.org>; Mon, 30 Jan 2023 14:38:32 -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=+KENGRCnG9psf88qOMlHKdVEc17gw4dUna2uL6qfAHg=; b=FnwXp6w8ekg2X+oFGKon//Loy98wb8RAO0T/OHMEdpynmj4csEF51xMJaEtGv926Sn ArU740MB1Y5XcYFbkbfhFkDeupDDOlXhY+ntu0RKq0fw7jhRQQmnPcsakPpRgJ0A6Dlo 4lvS4CCZEUrhj4sBT4GZbGoYdOmJ3lE+Tf6hkBgERsjjCpFTqCEGeVaZttMYQx+c9HS/ UoQ/ANX2e0AbZ0vwrCj/Y7LB70ODHEmvgb60x532lgfbvaBhemyfklKkb6u6vECQdcPp zO1j2XiBPHA2PcgG27M3kb3NlcEXD4+Psio3KKGFZ7ecDP+RNWOlMO29VJyzFWvD52Wt O5DQ== 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=+KENGRCnG9psf88qOMlHKdVEc17gw4dUna2uL6qfAHg=; b=DAs5XQy+8tNq0zFpLEi6OXRFueTlSebPIgkB/fddOzlwLD5KS89sXb1Vfw/o6qWJOC 9uzvZlclCbWd9hnvp0zJMVP94xQynvxmCS3oKQgYOvHnj36mkVKFkMsJWPM67CrYewM5 ZMGZpHZDUMcSoPqYK7AHxfPnYfopVsnOZLvyT7f1ua+d2YYrN0mtHOANaWbRf/yaizRn itRSmBO+j26Hj6R6QJesRU4/3p/1zdx4og8CFpCtoOuvgY+6Yg4/faED+qYje6fmzc7z pr4z0rGQPvCGG39wRFgkyPKfftUKgdIHUwcX62pedegrHaUmLeujnNcRDUBFsT3lz1Kk kIQQ== X-Gm-Message-State: AO0yUKXKzLZd5Uxt1srcq3poZ7GKWoQySJsL5hmoFlJ++Qh3ieTTCH6l k6TZkl3MRBQ5g5YMmZ5Awo0= X-Google-Smtp-Source: AK7set+6rYzQTiO7O8vUp2B9h4gwsZ8VxwZwIAjEV0eTS5/mhw8QVrBs9QI90jCBOdTx0wPf1jChSw== X-Received: by 2002:a05:600c:358d:b0:3da:282b:e774 with SMTP id p13-20020a05600c358d00b003da282be774mr1045464wmq.38.1675118306175; Mon, 30 Jan 2023 14:38:26 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id y21-20020a05600c17d500b003dc46242c4csm8826881wmo.10.2023.01.30.14.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 14:38:25 -0800 (PST) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83mt605h4f.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 30 Jan 2023 14:41:52 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <83k01573hz.fsf@gnu.org> <87v8kpj6ea.fsf@gmail.com> <83mt605h4f.fsf@gnu.org> Date: Mon, 30 Jan 2023 23:38:24 +0100 Message-ID: <87fsbrfy1r.fsf@gmail.com> 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@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Please add the xfaces.c change, and then this can go in (to the > emacs-29 branch). Done; see attached. * lightly amended the commit message (added a third paragraph); * tried to find an appropriate spot in NEWS; * de-bumped the defcustom :version; * ran a couple of sanity checks in *scratch* after applying this on top of 2023-01-30 "Update to Transient v0.3.7-196-gb91f509" (1684e254a3b). (face-differs-from-default-p 'default) nil (face-differs-from-default-p 'region) :background (set-face-attribute 'region nil :background 'unspecified) nil (face-differs-from-default-p 'region) nil ;; Tested all 3 function-item values of copy-region-blink-predicate. (set-face-attribute 'region nil :inverse-video t) nil (face-differs-from-default-p 'region) :inverse-video ;; Tested all 3 function-item values of copy-region-blink-predicate. Let me know if anything is amiss. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-Avoid-spurious-pause-in-kill-ring-save-Bug-60841.patch Content-Transfer-Encoding: quoted-printable >From fa7426224d5c5dbccd22d19720acbbd620dc8723 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?K=3DC3=3DA9vin=3D20Le=3D20Gouguec?=3D Date: Sun, 29 Jan 2023 11:23:01 +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 the more extensive predicate face-differs-from-default-p. The patch also fixes a couple of issues with the predicate's implementation, and introduces a new user option in case anyone happened to enjoy unconditional blinking. * lisp/faces.el (face-differs-from-default-p): Filter out :extend; add rationale for the attributes we ignore. * lisp/simple.el (copy-region-blink-predicate): Add option to let users explicitly opt into or out of blinking point and mark. (region-indistinguishable-p): New function to detect "if there is currently no active region highlighting", leveraging face-differs-from-default-p. (indicate-copied-region): Use it. * src/xfaces.c (merge_face_ref): Allow :stipple to be nil, since it is a documented valid value for that attribute. * etc/NEWS: Announce user option. --- etc/NEWS | 12 ++++++++++++ lisp/faces.el | 11 ++++++++++- lisp/simple.el | 22 ++++++++++++++++++++-- src/xfaces.c | 3 +-- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index fb211f9b7d0..13472de9e6e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1339,6 +1339,18 @@ dragged. Customize this option to limit the number of entries in the menu "Edit =E2=86=92 Paste from Kill Menu". The default is 60. =20 +--- +** New user option 'copy-region-blink-predicate'. +By default, when copying a region with 'kill-ring-save', Emacs only +blinks point and mark when the region is not denoted visually, that +is, when either the region is inactive, or the 'region' face is +indistinguishable from the 'default' face. + +Users who would rather enable blinking unconditionally can now set +this user option to 'always'. To disable blinking unconditionally, +either set this option to 'ignore', or set 'copy-region-blink-delay' +to 0. + +++ ** Performing a pinch gesture on a touchpad now increases the text scale. =20 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 861fe193fb8..c58acfe3adc 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5852,6 +5852,25 @@ copy-region-blink-delay :group 'killing :version "28.1") =20 +(defcustom copy-region-blink-predicate #'region-indistinguishable-p + "Whether the cursor must be blinked after a copy. +When this condition holds, and the copied region fits in the +current window, `kill-ring-save' will blink the cursor between +point and mark for `copy-region-blink-delay' seconds." + :type '(radio (function-item region-indistinguishable-p) + (function-item :doc "Always blink point and mark." always) + (function-item :doc "Never blink point and mark." ignore) + (function :tag "Other predicate function")) + :group 'killing + :version "29.1") + +(defun region-indistinguishable-p () + "Whether the current region is not denoted visually. +This holds when the region is inactive, or when the `region' face +cannot be distinguished from the `default' face." + (not (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 @@ -5872,8 +5891,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)))) + (funcall copy-region-blink-predicate)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char mark) diff --git a/src/xfaces.c b/src/xfaces.c index 35b79154805..62d7823f308 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2780,8 +2780,7 @@ merge_face_ref (struct window *w, else if (EQ (keyword, QCstipple)) { #if defined (HAVE_WINDOW_SYSTEM) - Lisp_Object pixmap_p =3D Fbitmap_spec_p (value); - if (!NILP (pixmap_p)) + if (NILP (value) || !NILP (Fbitmap_spec_p (value))) to[LFACE_STIPPLE_INDEX] =3D value; else err =3D true; --=20 2.39.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 02 05:43:26 2023 Received: (at 60841) by debbugs.gnu.org; 2 Feb 2023 10:43:27 +0000 Received: from localhost ([127.0.0.1]:60904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNX3u-00017s-JU for submit@debbugs.gnu.org; Thu, 02 Feb 2023 05:43:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNX3q-00017d-9H for 60841@debbugs.gnu.org; Thu, 02 Feb 2023 05:43:25 -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 ) id 1pNX3k-0006qI-7M; Thu, 02 Feb 2023 05:43:16 -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=39VBxr2QB8RMXmFiKA9Vxvqs2TdE8P07/1juIKQTI5E=; b=nxBUsgZYG+mfzIpC0BFL ghw45GnnpmYOBqDOeXbawOOnaqaAjM/QZWvM5JAG7aSgSMYSixp/nKy07cXBL7a73IyFrqg2mlCBL Byjjff2lv/2jSkqaDVxlIO9ty2jVHqhLX4uvAVUPVBEDq2N3ayUMZFjJgp5/6kWgbrwB60C2m8t8S MgxOew+KlSW6/2VSCPVlB4QzBR8Xm8vN7gcqCO9FFWWw95Fv9+PwT6IY9/HdSvnkF0nwG3MPjBpQT VK2TmlCc5sBR4v+A/z8RM3JI1QCvtlVpuKkEcWOl+uHrh3ld3beuYOa06U07ayLJz9bJl/ZA7hSft 5dOE5d2brE640g==; 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 1pNX3j-0005sb-CQ; Thu, 02 Feb 2023 05:43:15 -0500 Date: Thu, 02 Feb 2023 12:43:15 +0200 Message-Id: <83edr8xs8s.fsf@gnu.org> From: Eli Zaretskii To: =?iso-8859-1?Q?K=E9vin?= Le Gouguec In-Reply-To: <87fsbrfy1r.fsf@gmail.com> (message from =?iso-8859-1?Q?K=E9v?= =?iso-8859-1?Q?in?= Le Gouguec on Mon, 30 Jan 2023 23:38:24 +0100) Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <83k01573hz.fsf@gnu.org> <87v8kpj6ea.fsf@gmail.com> <83mt605h4f.fsf@gnu.org> <87fsbrfy1r.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60841 Cc: gregory@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Kvin Le Gouguec > Cc: gregory@heytings.org, 60841@debbugs.gnu.org, juri@linkov.net > Date: Mon, 30 Jan 2023 23:38:24 +0100 > > Eli Zaretskii writes: > > > Please add the xfaces.c change, and then this can go in (to the > > emacs-29 branch). > > Done; see attached. > > * lightly amended the commit message (added a third paragraph); > * tried to find an appropriate spot in NEWS; > * de-bumped the defcustom :version; > * ran a couple of sanity checks in *scratch* after applying this on top > of 2023-01-30 "Update to Transient v0.3.7-196-gb91f509" (1684e254a3b). > > (face-differs-from-default-p 'default) > nil > (face-differs-from-default-p 'region) > :background > (set-face-attribute 'region nil :background 'unspecified) > nil > (face-differs-from-default-p 'region) > nil > ;; Tested all 3 function-item values of copy-region-blink-predicate. > (set-face-attribute 'region nil :inverse-video t) > nil > (face-differs-from-default-p 'region) > :inverse-video > ;; Tested all 3 function-item values of copy-region-blink-predicate. > > Let me know if anything is amiss. LGTM, please install on the emacs-29 branch. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 02 16:15:48 2023 Received: (at 60841-done) by debbugs.gnu.org; 2 Feb 2023 21:15:48 +0000 Received: from localhost ([127.0.0.1]:35983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNgvs-0003P4-1T for submit@debbugs.gnu.org; Thu, 02 Feb 2023 16:15:48 -0500 Received: from mail-wm1-f44.google.com ([209.85.128.44]:41872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNgvp-0003Or-Q5 for 60841-done@debbugs.gnu.org; Thu, 02 Feb 2023 16:15:46 -0500 Received: by mail-wm1-f44.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so948501wms.0 for <60841-done@debbugs.gnu.org>; Thu, 02 Feb 2023 13:15:45 -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=oDbN1EL4nSVVRZxPWcMsXaHe1fe8aAsriuoN3PGMdqI=; b=B6lLj2vhsCy3D/P68an3KtdktrIvgs80/qwAukiNkIRTwpoYb+qwufM0/5IwVoImk1 luyDqeIIsEEwe+ONlTEltP1tdP/Feby8NuTdtTuVcFLZx4bEwUI076JQoIS0MiZ4CfZB h3UKnAlxjHb3w/sLruW/OlNkVxCigx8UyeuNPADeHi6r69mjm6tBRwuKwGsZOPBWN+fP aSFSxjStjmSni36odtChrVJepoZW0C8ZpU3xWrbu4j9JAVevNQ56EoRERNvj4//ToVSu lYfYsfujSmsfu3T7v5ykTJyyXX1/LyQGyAnb49tZBVr4VMjZJEqLcMmmq3I0y2NZ36vu 7ixg== 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=oDbN1EL4nSVVRZxPWcMsXaHe1fe8aAsriuoN3PGMdqI=; b=U8Oq/EMCjVF/vw/cClgtb3QrTRKA1DhYrsL2xf++yJF7WGbrWa8fMOEMm3aiqmsJ8Y NsIvPXBDf3sruA7/sCxKU9zJ9ixur+14mL+9l3yWMlLdt6tVVcYL0vvYwVuDK2DjXfu/ fJl6cI8GLYHLeBYRWN5vRTkYhzZwWSxL4TzagZKL7CxX3ocGmUzj3bl9Pi64joaimOpB qX2NWTa0zkHAyvf7fLaIbbdVXh0bv7ogBp8u9YQUXtMZ/MJWJzYy9/sPoIdGwREoeb43 OF+rx267B9fCQvqwx2ulXuBT3Xwe9xqso9EB8hVLQaRxy2nX2vd+cdprDYAzHle7DjOw 3GgQ== X-Gm-Message-State: AO0yUKWLnzRAhAp1CHpSqfP+tBQBqjDg9mIN9sPv8vZNPaegcRg447vI uRtkyX6LmwyqB8TTgYO8gBw= X-Google-Smtp-Source: AK7set/h/aOHCgvZAskB4OnlV9OjljWfFDlQstuEx1nhXp1+xpNQXwqyB3UREcfyGGcqm1ia9S+cbg== X-Received: by 2002:a05:600c:3b8e:b0:3df:9858:c03e with SMTP id n14-20020a05600c3b8e00b003df9858c03emr2758842wms.19.1675372539853; Thu, 02 Feb 2023 13:15:39 -0800 (PST) Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id q14-20020a05600c46ce00b003dc47d458cdsm846533wmo.15.2023.02.02.13.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 13:15:38 -0800 (PST) From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= To: Eli Zaretskii Subject: Re: bug#60841: 30.0.50; kill-ring-save pauses despite region being highlighted In-Reply-To: <83edr8xs8s.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Feb 2023 12:43:15 +0200") References: <87h6wrs71h.fsf@gmail.com> <83zgai4peg.fsf@gnu.org> <5583fd58387746ce7ddc@heytings.org> <87cz7dbns0.fsf@gmail.com> <4c2c6cf44ad37e405b06@heytings.org> <878ri0g6ob.fsf@gmail.com> <83pmbc0yxo.fsf@gnu.org> <87y1pzo5dp.fsf@gmail.com> <834jskmhs8.fsf@gnu.org> <87fsc2qjcs.fsf@gmail.com> <833581jtff.fsf@gnu.org> <87lelsga1f.fsf@gmail.com> <83r0vkgj7l.fsf@gnu.org> <87h6wawo2k.fsf@gmail.com> <831qnea5ye.fsf@gnu.org> <87357t2xyh.fsf@gmail.com> <83k01573hz.fsf@gnu.org> <87v8kpj6ea.fsf@gmail.com> <83mt605h4f.fsf@gnu.org> <87fsbrfy1r.fsf@gmail.com> <83edr8xs8s.fsf@gnu.org> Date: Thu, 02 Feb 2023 22:15:37 +0100 Message-ID: <87zg9vlqfa.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60841-done Cc: gregory@heytings.org, 60841-done@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > LGTM, please install on the emacs-29 branch. Done; closing with this message. > Thanks. Thank you all for your help. From unknown Mon Jun 16 23:41:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 03 Mar 2023 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator