From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gautier Ponsinet Newsgroups: gmane.emacs.bugs Subject: bug#72636: [PATCH] Modify the pulsation effect of pulse.el Date: Thu, 15 Aug 2024 09:30:35 +0200 Message-ID: <87ed6q1bvo.fsf@gautierponsinet.xyz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11576"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Protesilaos Stavrou , zappo@gnu.org To: 72636@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 15 10:12:00 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1seVaJ-0002d1-Ip for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Aug 2024 10:11:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1seVZz-0005ti-G3; Thu, 15 Aug 2024 04:11:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seVZx-0005o7-1F for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 04:11:30 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1seVZu-0002Bf-UX for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 04:11:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=cUSykgrewFBJLOsCTppeKTowxksvqcc2t2xYyxMDnQE=; b=kIwNZLO1VmbEmkWOwl9lb9c+Wt8oEyjB3kOs++dw4px1OOlF2+xOKA2Q2fQgy+YGdCPLtxDLsMd5ecJ/VB+zvHqyczULyHXp73WF2Mcz1J7rvTfJ5abbgd10H5/JTwrWjZcoq3o9DcCKbT4s1kFCoRAMdBRsOA8odWK5Ah3Kff3rK8cU65I6puxwuSKCc1DIDK5eafTkxKAjB6kfyOuRmFFXhR/vCHcIbidgXUAj3/Se48/ucoW7+u8Y13D3ZENQVzwFsb/FXp6Gab49RHJ4Wh5JrV6h8ZR8j2hNxT04JjAfjmdyHCCLQ9u1CALy2+W3OfgNEZ5kgMFMY8Om0REy6Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1seVaU-0005BE-Hd for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 04:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gautier Ponsinet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2024 08:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72636 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172370951619897 (code B ref -1); Thu, 15 Aug 2024 08:12:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Aug 2024 08:11:56 +0000 Original-Received: from localhost ([127.0.0.1]:48306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seVaN-0005Aq-Gh for submit@debbugs.gnu.org; Thu, 15 Aug 2024 04:11:56 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:45536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1seUxI-000478-1u for submit@debbugs.gnu.org; Thu, 15 Aug 2024 03:31:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seUwh-00008u-SL for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 03:30:55 -0400 Original-Received: from 11.mo584.mail-out.ovh.net ([46.105.34.195]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seUwf-0004ms-6B for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2024 03:30:55 -0400 Original-Received: from director5.ghost.mail-out.ovh.net (unknown [10.109.140.5]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4WkxcR1QLFz1D2r for ; Thu, 15 Aug 2024 07:30:47 +0000 (UTC) Original-Received: from ghost-submission-6684bf9d7b-bv82q (unknown [10.110.188.21]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 5191B1FE68; Thu, 15 Aug 2024 07:30:46 +0000 (UTC) Original-Received: from gautierponsinet.xyz ([37.59.142.99]) by ghost-submission-6684bf9d7b-bv82q with ESMTPSA id 076eDaauvWYDnA0AnZV3Uw (envelope-from ); Thu, 15 Aug 2024 07:30:46 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-99G0034e7b0a77-a8ce-4782-a2c7-1268ad3f6ead, 19F201BFFDC4C2452DC7AC0C77E4B9C6AB6BA584) smtp.auth=gautier@gautierponsinet.xyz X-OVh-ClientIp: 2.87.16.101 X-Ovh-Tracer-Id: 12584746211240830835 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 70 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddruddthedguddvvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecufghrlhcuvffnffculdejtddmnecujfgurhephffvvefufffkgggtsehmtderredttddtnecuhfhrohhmpefirghuthhivghrucfrohhnshhinhgvthcuoehgrghuthhivghrsehgrghuthhivghrphhonhhsihhnvghtrdighiiiqeenucggtffrrghtthgvrhhnpeejieevheduveduieeguddukeethefgheekleetuddvkeetleetudejvdeutedtfeenucfkphepuddvjedrtddrtddruddpvddrkeejrdduiedruddtuddpfeejrdehledrudegvddrleelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpehgrghuthhivghrsehgrghuthhivghrphhonhhsihhnvghtrdighiiipdhnsggprhgtphhtthhopedupdhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht DKIM-Signature: a=rsa-sha256; bh=cUSykgrewFBJLOsCTppeKTowxksvqcc2t2xYyxMDnQE=; c=relaxed/relaxed; d=gautierponsinet.xyz; h=From; s=ovhmo4576755-selector1; t=1723707047; v=1; b=HHGCOMGY9iVpw7nj0j3kQFgYUyU6b82ZS94/DJJF6AAR74YXCceBBqc1XIIwmWRh0BntBOAj 7p4rlobcBqO/Yo6WZ7j5gRrNS/3+ZFqDfH8Hk2j8iZ3lKGU/LWNbpstwkxRLidHjmYQgxrnYcDw Bq0c+uySBh65XYNAmvipERmGosHGX8TuYv6A4fjhayAR34ejXB7ouDWp0CZug8oMMhz6lPkpl9d U5Md50ntuJVeXdDtqFUyhR+8t4HD5cQcChBhqeC0H7/l0uRDrN18XyOkLlH6Nsk5POeONgl6i+R BblasisPWJjWpNJwkngW3mKiNwt90axhkSIW6dYRKAhag== Received-SPF: pass client-ip=46.105.34.195; envelope-from=gautier@gautierponsinet.xyz; helo=11.mo584.mail-out.ovh.net 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 15 Aug 2024 04:11:54 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290170 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Hello everyone, CC: Eric M. Ludlam (author of pulse.el) and Protesilaos Stavrou (author of pulsar.el). I wanted to use pulse.el without the pulse effect, that is, I have set the variable pulse-iterations to 1, and I was expecting the pulse library to simply highlight a region or line for the duration specified in the variable pulse-delay with the face pulse-highlight-start-face. It works, except that the face used is not pulse-highlight-start-face. To reproduce in emacs -Q: (require 'pulse) (setopt pulse-iterations 1) (setopt pulse-delay 5) (set-face-background 'pulse-highlight-start-face "#ff0000") (pulse-momentary-highlight-one-line) Note that the color used by pulse is not pulse-highlight-start-face (pure red). If I understand correctly, this behavior comes from the function pulse-momentary-highlight-overlay. The function pulse-momentary-highlight-overlay sets an overlay using the face pulse-highlight-face (reseted to pulse-highlight-start-face by default, that is, if the argument of pulse-momentary-highlight-overlay is nil), the function then immediatly starts the pulsation effect. The list of colors for the pulsation effect is generated by the function color-gradient, but the documentation of color-gradient says about its output: "It does not include the START and STOP color in the resulting list". Thus the first visible color is the first color of the list returned by color-gradient which is different that the starting face (pulse-highlight-start-face by default). A simple solution would be to add the starting color (pulse-highlight-start-face by default) at the beginning of the list of colors used for the pulsation effect in pulse-momentary-highlight-overlay. Please find attached to this mail a patch for pulse.el which does this modification. All the best, Gautier ------------------------------------------------------------------------ In GNU Emacs 31.0.50 (build 61, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw3d scroll bars) of 2024-08-08 built on gautier-laptop Repository revision: 8b662047074f7413c280c9092d1c39763f8b0e5b Repository branch: makepkg Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Arch Linux Configured using: 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-modules --without-m17n-flt --without-gconf --with-native-compilation=no --with-xinput2 --with-x-toolkit=lucid --without-xft --with-xaw3d --with-sound=no --with-tree-sitter --without-gpm --without-compress-install '--program-transform-name=s/\([ec]tags\)/\1.emacs/' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/home/gautier/.packages/aur/emacs-git/src=/usr/src/debug/emacs-git -flto=auto' 'LDFLAGS=-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto'' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Modify-the-pulsation-effect-of-pulse.el.patch >From 9def4e3b1536a1eba73adb351954569d396fb164 Mon Sep 17 00:00:00 2001 From: Gautier Ponsinet Date: Thu, 15 Aug 2024 09:17:42 +0200 Subject: [PATCH] Modify the pulsation effect of pulse.el * lisp/cedet/pulse.el (pulse-momentary-highlight-overlay): Add the start color to the list of colors used for the pulsation effect. --- lisp/cedet/pulse.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index d9f6a40865a..53256ba3a81 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el @@ -158,7 +158,7 @@ ;;; Convenience Functions (face-background 'pulse-highlight-face nil 'default))) (stop (color-name-to-rgb (face-background 'default))) (colors (mapcar (apply-partially 'apply 'color-rgb-to-hex) - (color-gradient start stop pulse-iterations)))) + (cons start (color-gradient start stop (1- pulse-iterations)))))) (setq pulse-momentary-timer (run-with-timer 0 pulse-delay #'pulse-tick colors -- 2.46.0 --=-=-=--