~protesilaos/pulsar

pulsar: Implement a simple `pulsear-pulse-region` function. v1 PROPOSED

This is the first pass to get a review before I make too many cosmetic
changes 🙏

NB:  currently it only works on the first (topmost) region if there are
multiple ones active.

Bahman Movaqar (1):
  pulse the active region.  if there are no regions, do nothing.

 pulsar.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.38.5
Hello Bahman,

I could not tend to this earlier.  Now I am back online full-time and
will be responsive going forward.



          
          
          
        
      
      
        
          






Thank you!  I just installed your patch and pushed the changes.



          
          
          
          
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~protesilaos/pulsar/patches/44064/mbox | git am -3
Learn more about email & git

[PATCH pulsar 1/1] pulse the active region. if there are no regions, do nothing. Export this patch

From: Bahman Movaqar <bahman@bahmanm.com>

in case there are multiple active regions, it `pulsar-pulse-region`
only works w/ the first (topmost) region.
---
 pulsar.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/pulsar.el b/pulsar.el
index 54b7f0f..06affcb 100644
--- a/pulsar.el
+++ b/pulsar.el
@@ -311,6 +311,21 @@ pulse effect."
  (interactive)
  (pulsar--pulse))

;;;###autoload
(defun pulsar-pulse-region ()
  "Temporarily highlight the active region if any.  Do nothing otherwise.
When `pulsar-pulse' is non-nil (the default) make the highlight
pulse before fading away.  The pulse effect is controlled by
`pulsar-delay' and `pulsar-iterations'.

NB:  If multiple regions are active, only the first one is impacted."
  (interactive)
  (when (region-active-p)
    (let* ((bounds (region-bounds))
           (region-start (caar bounds))
           (region-end (cdar bounds)))
      (pulsar--pulse nil nil region-start region-end))))

;;;###autoload
(defun pulsar-highlight-line ()
  "Temporarily highlight the current line.
-- 
2.38.5
Hello Bahman,

I could not tend to this earlier.  Now I am back online full-time and
will be responsive going forward.
Thank you!  I just installed your patch and pushed the changes.