From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72636: [PATCH] Modify the pulsation effect of pulse.el Date: Sat, 24 Aug 2024 11:40:09 +0300 Message-ID: <86h6banwk6.fsf@gnu.org> References: <87ed6q1bvo.fsf@gautierponsinet.xyz> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72636-done@debbugs.gnu.org, zappo@gnu.org, public@protesilaos.com To: Gautier Ponsinet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 24 10:41:50 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 1shmLF-0006Bl-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Aug 2024 10:41:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shmKi-0006sv-NH; Sat, 24 Aug 2024 04:41:16 -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 1shmKh-0006sZ-5E for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 04:41:15 -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 1shmKg-0008Qc-S0 for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 04:41:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=4DOPRGI87Qqt5I7EVSrWUzFYffMh2x3USRZrQEh5kmo=; b=HOaCJYLMRTAjB0Pn85vY4OwC70k8GFyCIL2jJ+/74OU0LgfWvwuhM44dHh9C607teDYbKRr/xl1U9mrCWMyTcLr20IMqulNKIdAk+eOGYm1OmIGwYTG/efvJkUjqXgPnpzyeha1uzMfame8jTd1hqvzSNp62QWPuuGf5b8KGlswaf8NHQJqhhmnPy3zlm/Q4MYvBLkqVXSuHgke+sC/TVgjp5KRD48e7GctF09nHRE+suRu3Q+0yeH0A6JT3EGlIzltVY3CyWOBw7ZjxWvxIPVFbHDVTwPe4cLCkPGIX7Yd0eIuvvefn4hnH+X4iz1foKWlIluDXtvX+xAkyJbUwpA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1shmLS-0007JP-Bo for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 04:42:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Aug 2024 08:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 72636 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 72636@debbugs.gnu.org, eliz@gnu.org, gautier@gautierponsinet.xyz Original-Received: via spool by 72636-done@debbugs.gnu.org id=D72636.172448887428037 (code D ref 72636); Sat, 24 Aug 2024 08:42:02 +0000 Original-Received: (at 72636-done) by debbugs.gnu.org; 24 Aug 2024 08:41:14 +0000 Original-Received: from localhost ([127.0.0.1]:40435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shmKf-0007I9-RW for submit@debbugs.gnu.org; Sat, 24 Aug 2024 04:41:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shmKc-0007Hq-U8 for 72636-done@debbugs.gnu.org; Sat, 24 Aug 2024 04:41:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shmJj-0008D1-Qu; Sat, 24 Aug 2024 04:40:15 -0400 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=4DOPRGI87Qqt5I7EVSrWUzFYffMh2x3USRZrQEh5kmo=; b=hWvMFdWP1AgF 7iF3ZlahQ0rEnv6q/ZC2j84SNIS/5nL4OfwrE49b1DAufDom0EV8FVd19o3V/F+gO5vy9qx634NNx MsSJw0rVfITeAICc6SIZ1dpuxaq4rA8dG7/MHEZ+kNP6ZtEWhbVaTxZdZlapZwJni0u2uoHfetj7i TZjpKPJMnIMeNegi5XBl6XmqeTgOMSlphkHieyYii7r6w84pwQt+9+ZA0hu95zxIiKcKpFmfm+kGg 3JE/W1g/wqUPNtEnmdsVkJXZHJxcUK3jRInLHWIVarfakis87ssoFkUqe5ZL7whUkpM+tJd8HqseS OirY7YonwucqBtKf8em1oQ==; In-Reply-To: <87ed6q1bvo.fsf@gautierponsinet.xyz> (message from Gautier Ponsinet on Thu, 15 Aug 2024 09:30:35 +0200) 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:290642 Archived-At: > Cc: Protesilaos Stavrou , zappo@gnu.org > From: Gautier Ponsinet > Date: Thu, 15 Aug 2024 09:30:35 +0200 > > 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. Thanks, I installed this improvement on the master branch, and I'm therefore closing this bug.