branch: externals/pulsar commit 0891269ff813917c6959e5d0e2f7f7ec4400481d Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Add pulsar-highlight-face user option Thanks to Mark Barton for the feedback in issue 3: <https://gitlab.com/protesilaos/pulsar/-/issues/3>. --- README.org | 7 +++++++ pulsar.el | 27 ++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 3fdf377329..c42a16b309 100644 --- a/README.org +++ b/README.org @@ -99,6 +99,12 @@ will pulse before fading away. Whereas the ~pulsar-highlight-line~ command never pulses the line: the highlight stays in place as if ~pulsar-pulse~ is nil. +#+vindex: pulsar-highlight-face +To help users differentiate between the momentary pulse and transient +highlight effects, the user option ~pulsar-highlight-face~ controls the +presentation of the ~pulsar-highlight-line~ command. By default, this +that variable is the same as ~pulsar-face~. + Pulsar depends on the built-in ~pulse.el~ library. Why the name "pulsar"? It sounds like "pulse" and is a recognisable @@ -193,6 +199,7 @@ Remember to read the doc string of each of these variables. (setq pulsar-delay 0.055) (setq pulsar-iterations 10) (setq pulsar-face 'pulsar-magenta) +(setq pulsar-highlight-face 'pulsar-yellow) ;; pulsar does not define any key bindings. This is just a sample that ;; respects the key binding conventions. Evaluate: diff --git a/pulsar.el b/pulsar.el index a08bb701bc..3c2e0c6137 100644 --- a/pulsar.el +++ b/pulsar.el @@ -39,6 +39,11 @@ ;; To pulse highlight the current line on demand, use ;; `pulsar-pulse-line'. To highlight the current line without pulsing ;; it, use `pulsar-highlight-line' instead. +;; +;; To help users differentiate between the momentary pulse and transient +;; highlight effects, the user option `pulsar-highlight-face' controls +;; the presentation of the `pulsar-highlight-line' command. By default, +;; this that variable is the same as `pulsar-face'. ;; ;; Pulsar depends on the built-in `pulse.el' library. ;; @@ -107,7 +112,7 @@ such as `customize-set-variable' do that automatically." :group 'pulsar) (defcustom pulsar-face 'pulsar-generic - "Face to use for the pulse line. + "Face of the regular pulse line effect (`pulsar-pulse-line'). The default is `pulsar-generic' which reuses the standard face from the underlying pulse library. Users can select one among `pulsar-red', `pulsar-green', `pulsar-yellow', `pulsar-blue', @@ -123,6 +128,19 @@ background attribute." (face :tag "Other face (must have a background)")) :group 'pulsar) +(defcustom pulsar-highlight-face 'pulsar-face + "Face used in `pulsar-highlight-line'." + :type '(choice (variable pulsar-face) + (radio (face :tag "Generic pulse.el face" pulsar-generic) + (face :tag "Red style" pulsar-red) + (face :tag "Green style" pulsar-green) + (face :tag "Yellow style" pulsar-yellow) + (face :tag "Blue style" pulsar-blue) + (face :tag "Magenta style" pulsar-magenta) + (face :tag "Cyan style" pulsar-cyan) + (face :tag "Other face (must have a background)"))) + :group 'pulsar) + (defcustom pulsar-pulse t "When non-nil enable pulsing. Otherwise the highlight stays on the current line until another @@ -269,9 +287,12 @@ pulse effect." (defun pulsar-highlight-line () "Temporarily highlight the current line. Unlike `pulsar-pulse-line', never pulse the current line. Keep -the highlight in place until another command is invoked." +the highlight in place until another command is invoked. + +Use `pulsar-highlight-face' (it is the same as `pulsar-face' by +default)." (interactive) - (pulsar--pulse :no-pulse)) + (pulsar--pulse :no-pulse pulsar-highlight-face)) ;;;; Advice setup