branch: externals/pulsar
commit 78fc06863e0005da3874bfed510d8072de2878c9
Merge: 121b24dc19 c3d2205dc5
Author: shipmints <30732365+shipmi...@users.noreply.github.com>
Commit: GitHub <nore...@github.com>

    Merge branch 'protesilaos:main' into pulse-region-commands
---
 README.org |  2 +-
 pulsar.el  | 16 ++++++++++------
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index 74d8e63328..d619ef7b28 100644
--- a/README.org
+++ b/README.org
@@ -349,7 +349,7 @@ Pulsar is meant to be a collective effort.  Every bit of 
help matters.
 
 + Contributions to the code or manual :: Aymeric Agon-Rambosson,
   Bahman Movaqar, Daniel Mendler, Ivan Popovych, JD Smith, Maxim
-  Dunaevsky, Ryan Kaskel, shipmints.
+  Dunaevsky, Ryan Kaskel, shipmints, ukiran03.
 
 + Ideas and user feedback :: Duy Nguyen, Mark Barton, Petter Storvik,
   Rudolf Adamkovič, Toon Claes, and users djl, kb.
diff --git a/pulsar.el b/pulsar.el
index 99d1641690..f0de194aaf 100644
--- a/pulsar.el
+++ b/pulsar.el
@@ -388,9 +388,9 @@ pulse effect."
 (defun pulsar-pulse-region ()
   "Temporarily highlight the active region if any."
   (interactive)
-  (when (region-active-p)
-    (let ((beg (region-beginning))
-          (end (region-end)))
+  (if (region-active-p)
+      (let ((beg (region-beginning))
+            (end (region-end)))
       ;; FIXME 2024-08-29: Finding the lines and columns therein
       ;; does not work because consecutive pulses cancel each
       ;; other out, leaving only the last one active.
@@ -408,7 +408,11 @@ pulse effect."
       ;;     (setq beg (progn (move-to-column begcol) (point))
       ;;           end (progn (move-to-column endcol) (point))))
       ;;   (pulsar--pulse nil nil beg end)))
-      (pulsar--pulse nil nil beg end))))
+        (pulsar--pulse nil nil beg end))
+    (when (mark)
+      (let ((beg (mark))
+            (end (point)))
+        (pulsar--pulse nil nil beg end)))))
 
 ;;;###autoload
 (defun pulsar-highlight-line ()
@@ -584,8 +588,8 @@ Functions are registered in `pulsar-pulse-functions' and
 `pulsar-pulse-region-functions'. This is called automatically
 when `pulsar-resolve-pulse-function-aliases' is non-nil.
 
-You may also call this manually in your configuration after
-setting `pulsar-pulse-functions'. In that case, you would prefer
+You may also call this manually in your configuration after setting
+`pulsar-pulse-functions'.  In that case, you would prefer
 `pulsar-resolve-pulse-function-aliases' to be nil."
   (setq pulsar-pulse-functions
         (seq-union pulsar-pulse-functions

Reply via email to