Subject: Re: bug#72636: [PATCH] Modify the pulsation effect of pulse.el
From: Eli Zaretskii <[email-masked]>
To: Gautier Ponsinet <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Sat, 24 Aug 2024 11:40:09 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: Protesilaos Stavrou <[email-masked]>, [email-masked]
> From: Gautier Ponsinet <[email-masked]>
> 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.