[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pulsar fca0e53815 15/28: Exert control over the pulse e
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pulsar fca0e53815 15/28: Exert control over the pulse effect |
Date: |
Tue, 22 Mar 2022 06:58:03 -0400 (EDT) |
branch: externals/pulsar
commit fca0e538155226bc34703a9d24adc15515bb9b80
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Exert control over the pulse effect
Without a non-nil value for 'pulse-flag' the pulsing does not work when
Emacs is used in a server/client model. Instead, the current line
remains highlighted until another command is invoked. By let-binding
that variable, we ensure that we have control over the pulse effect.
Thanks to kb, Petter Storvik, and Mark Barton for their feedback in
issue 1: <https://gitlab.com/protesilaos/pulsar/-/issues/1>.
---
README.org | 27 ++++++++++++++++++++++++---
pulsar.el | 16 +++++++++++++++-
2 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/README.org b/README.org
index 07a1faab76..872d2e1a33 100644
--- a/README.org
+++ b/README.org
@@ -80,9 +80,16 @@ strongly encouraged to use ~customize-set-variable~ for the
user option
user option has a special custom setter function).
#+vindex: pulsar-delay
+#+vindex: pulsar-iterations
#+vindex: pulsar-face
-The duration of the highlight is determined by ~pulsar-delay~. While
-the applicable face is specified in ~pulsar-face~.
+The duration of the highlight is determined by ~pulsar-delay~. How
+smooth the effect is depends on ~pulsar-iterations~. While the
+applicable face is specified in ~pulsar-face~.
+
+#+vindex: pulsar-pulse
+To disable the pulse but keep the highlight, set ~pulsar-pulse~ to nil.
+The current line will remain highlighted until another command is
+invoked.
#+findex: pulsar-pulse-line
To highlight the current line on demand, use the ~pulsar-pulse-line~
@@ -178,8 +185,10 @@ Remember to read the doc string of each of these variables.
outline-previous-visible-heading
outline-up-heading))
-(setq pulsar-face 'pulsar-magenta)
+(setq pulsar-pulse t)
(setq pulsar-delay 0.055)
+(setq pulsar-iterations 10)
+(setq pulsar-face 'pulsar-magenta)
#+end_src
* Integration with other packages
@@ -213,6 +222,18 @@ Example use-cases:
(add-hook 'imenu-after-jump-hook #'pulsar-reveal-entry)
#+end_src
+* Acknowledgements
+:PROPERTIES:
+:CUSTOM_ID: h:56577df6-49df-4204-bd85-d0c569b8edc0
+:END:
+#+cindex: Contributors
+
+Pulsar is meant to be a collective effort. Every bit of help matters.
+
++ Author/maintainer :: Protesilaos Stavrou.
+
++ Ideas and user feedback :: Mark Barton, Petter Storvik, and user kb.
+
* GNU Free Documentation License
:PROPERTIES:
:APPENDIX: t
diff --git a/pulsar.el b/pulsar.el
index 4da1388f29..d84a2ff2c8 100644
--- a/pulsar.el
+++ b/pulsar.el
@@ -117,11 +117,23 @@ that has a background attribute."
(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
+command is invoked."
+ :type 'boolean
+ :group 'pulsar)
+
(defcustom pulsar-delay 0.05
"Duration in seconds of the active pulse highlight."
:type 'number
:group 'pulsar)
+(defcustom pulsar-iterations pulse-iterations
+ "Number of iterations in a pulse highlight."
+ :type 'number
+ :group 'pulsar)
+
;;;; Faces
(defgroup pulsar-faces ()
@@ -220,7 +232,9 @@ that has a background attribute."
(defun pulsar-pulse-line ()
"Temporarily highlight the current line with optional FACE."
(interactive)
- (let ((pulse-delay pulsar-delay))
+ (let ((pulse-flag pulsar-pulse)
+ (pulse-delay pulsar-delay)
+ (pulse-iterations pulsar-iterations))
(pulse-momentary-highlight-region (pulsar--start) (pulsar--end)
pulsar-face)))
;;;; Advice setup
- [elpa] externals/pulsar a335e52505 03/28: Add commands to pulse+recenter, (continued)
- [elpa] externals/pulsar a335e52505 03/28: Add commands to pulse+recenter, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 0cc2f4af56 02/28: Make outline structure more detailed, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar de1fa21ae3 05/28: Refine pulsar-reveal-entry, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 4748f55eee 08/28: Expand the pulsar-pulse-functions, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar a84b2d86f1 10/28: Document integration with other packages, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar a7b7ac4f7e 11/28: Document pulse-setup, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 23a8ef7fbf 13/28: Release version 0.1.0, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 54702c9e1f 12/28: Add package keywords, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar bc084499c4 04/28: Add function to reveal Org or Outline entry, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 98d970dcdf 09/28: Add minor rewording, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar fca0e53815 15/28: Exert control over the pulse effect,
ELPA Syncer <=
- [elpa] externals/pulsar 486645f81b 16/28: Always ':extend t' the generic pulse face, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar dcc94662a9 07/28: Stop pulsing during pulsar-reveal-entry, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 82946880b5 14/28: Add missing function to sample package setup, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 42f8a03b8a 18/28: Fix typo, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar d654e552f0 19/28: Clarify doc strings of user options, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 4cfc18a009 22/28: Update to version 0.2.0, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar d2174307b0 23/28: Simple fix for highlight behavior on last line, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 2d666c7061 25/28: Update "Acknowledgements" in the manual, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 1535551ac0 27/28: Use post-command-hook instead of an advice, ELPA Syncer, 2022/03/22
- [elpa] externals/pulsar 1b73a123f1 21/28: Reword Commentary and package description, ELPA Syncer, 2022/03/22