Emacs: pulsar version 1.2.0
This is a small package that temporarily highlights the current line or region after a given function is invoked. Several user options control the exact behaviour. Watch the original demo.
- Package name (GNU ELPA):
pulsar
- Official manual: https://protesilaos.com/emacs/pulsar
- Change log: https://protesilaos.com/emacs/pulsar-changelog
- Git repositories:
- Backronym: Pulsar Unquestionably Luminates, Strictly Absent the Radiation.
Below are the release notes.
This version refines an already stable base. Users do not need to make any changes to their setup, unless they wish to try the new features.
Automatically pulse the affected region
With the out-of-the-box settings, Pulsar temporarily highlights the
current line after any of the pulsar-pulse-functions
is invoked and
pulsar-mode
(or pulsar-global-mode
) is enabled.
The new user option pulsar-pulse-region-functions
makes Pulsar
temporarily highlight the affected region as well. For example, when
pasting some text into the buffer, it will highlight the portion of
text that was added.
The default value of pulsar-pulse-region-functions
is nil, meaning
that no region pulsing is in effect (what we had before). Otherwise,
it is a list of functions. A typical use-case is the following:
(setq pulsar-pulse-region-functions pulsar-pulse-region-common-functions)
This covers common commands, such as for copying and pasting a region
of text (restart pulsar-mode
or pulsar-global-mode
if needed).
Thanks to shipmints and Abdelhak Bougouffa for contributing the core of this functionality. It was done in pull request 25: https://github.com/protesilaos/pulsar/pull/25. Abdelhak’s contribution is within the ~15 line limit, meaning that no copyright assignment to the Free Software Foundation is necessary, while shipmints has already done the paperwork.
Relevant discussions took place in issues 10, 18, 21, and 22, as well as pull request 24:
- https://github.com/protesilaos/pulsar/issues/10
- https://github.com/protesilaos/pulsar/issues/18
- https://github.com/protesilaos/pulsar/issues/21
- https://github.com/protesilaos/pulsar/issues/22
- https://github.com/protesilaos/pulsar/pull/24
Thanks to Anwesh Gangula, Alex Kreisher, Diego Alvarez, and Ronny Randen for their participation.
The region pulsing is inspired by Daniel Mendler’s goggles
package,
which itself is a take on a common theme covered by many other such
packages.
Style region highlights differently
The following user options control the face of the pulsar-pulse-region-functions
.
pulsar-region-face
: Face to pulse a region that has not changed.pulsar-region-change-face
: Face to pulse a region that has changed (added or removed).
Pulsar defines several faces to get a nice style. Here is an example:
(setq pulsar-region-face 'pulsar-green) ; unchanged regions are green
(setq pulsar-region-change-face 'pulsar-red) ; changed regions are red
Pulse on window state change
An alternative to how Pulsar works out-of-the-box by reacting to the
pulsar-pulse-functions
is to check for changes to the window layout.
Users who wish to have this behaviour can set the new user option
pulsar-pulse-on-window-change
to a non-nil value.
As there may be overlap between the pulsar-pulse-functions
and the
pulsar-pulse-on-window-change
, users are advised to pick only one.
This is not a hard rule though: Pulsar will blithely highlight
everything if configured accordingly.
Thanks again to shipmints and Abdelhak Bougouffa for this contribution. It is part of the aforementioned pull request 25.