GNU bug report logs - #72636
[PATCH] Modify the pulsation effect of pulse.el

Previous Next

Package: emacs;

Reported by: Gautier Ponsinet <gautier <at> gautierponsinet.xyz>

Date: Thu, 15 Aug 2024 08:12:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72636 in the body.
You can then email your comments to 72636 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72636; Package emacs. (Thu, 15 Aug 2024 08:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gautier Ponsinet <gautier <at> gautierponsinet.xyz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 15 Aug 2024 08:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gautier Ponsinet <gautier <at> gautierponsinet.xyz>
To: bug-gnu-emacs <at> gnu.org
Cc: Protesilaos Stavrou <public <at> protesilaos.com>, zappo <at> gnu.org
Subject: [PATCH] Modify the pulsation effect of pulse.el
Date: Thu, 15 Aug 2024 09:30:35 +0200
[Message part 1 (text/plain, inline)]
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''

[0001-Modify-the-pulsation-effect-of-pulse.el.patch (text/patch, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 24 Aug 2024 08:42:02 GMT) Full text and rfc822 format available.

Notification sent to Gautier Ponsinet <gautier <at> gautierponsinet.xyz>:
bug acknowledged by developer. (Sat, 24 Aug 2024 08:42:02 GMT) Full text and rfc822 format available.

Message #10 received at 72636-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gautier Ponsinet <gautier <at> gautierponsinet.xyz>
Cc: 72636-done <at> debbugs.gnu.org, zappo <at> gnu.org, public <at> protesilaos.com
Subject: Re: bug#72636: [PATCH] Modify the pulsation effect of pulse.el
Date: Sat, 24 Aug 2024 11:40:09 +0300
> Cc: Protesilaos Stavrou <public <at> protesilaos.com>, zappo <at> gnu.org
> From: Gautier Ponsinet <gautier <at> gautierponsinet.xyz>
> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 21 Sep 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.