emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pulsar c337882fda 3/3: Implement convenience commands f


From: ELPA Syncer
Subject: [elpa] externals/pulsar c337882fda 3/3: Implement convenience commands for colored pulsing
Date: Sat, 6 Aug 2022 01:58:03 -0400 (EDT)

branch: externals/pulsar
commit c337882fda01221737192bafa707595c0290d4f5
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Implement convenience commands for colored pulsing
---
 README.org | 34 ++++++++++++++++++++++++++++++++++
 pulsar.el  | 21 +++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/README.org b/README.org
index 3594802f3e..417b7ba844 100644
--- a/README.org
+++ b/README.org
@@ -120,6 +120,40 @@ Why the name "pulsar"?  It sounds like "pulse" and is a 
recognisable
 word.  Though if you need a backronym, consider "Pulsar Unquestionably
 Luminates, Strictly Absent the Radiation".
 
+** Convenience functions
+:PROPERTIES:
+:CUSTOM_ID: h:6ca69953-1a89-4968-a46c-2fa5e57aca9b
+:END:
+
+[ Part of {{{development-version}}} ]
+
+Depending on the user's workflow, there may be a need for differently
+colored pulses.  These are meant to provide an ad-hoc deviation from the
+standard style of the command ~pulsar-pulse-line~ (which is governed by
+the user option ~pulsar-face~).  Pulsar thus provides the following for
+the user's convenience:
+
+#+findex: pulsar-pulse-line-red
+- ~pulsar-pulse-line-red~
+
+#+findex: pulsar-pulse-line-green
+- ~pulsar-pulse-line-green~
+
+#+findex: pulsar-pulse-line-yellow
+- ~pulsar-pulse-line-yellow~
+
+#+findex: pulsar-pulse-line-blue
+- ~pulsar-pulse-line-blue~
+
+#+findex: pulsar-pulse-line-magenta
+- ~pulsar-pulse-line-magenta~
+
+#+findex: pulsar-pulse-line-cyan
+- ~pulsar-pulse-line-cyan~
+
+These can be called with =M-x=, assigned to a hook and/or key binding,
+or be incorporated in custom functions.
+
 * Installation
 :PROPERTIES:
 :CUSTOM_ID: h:812f7616-7e0f-489f-a908-1cb759ca64ce
diff --git a/pulsar.el b/pulsar.el
index 646708f66a..69186936da 100644
--- a/pulsar.el
+++ b/pulsar.el
@@ -323,6 +323,27 @@ default)."
   (interactive)
   (pulsar--pulse :no-pulse pulsar-highlight-face))
 
+;;;;; Convenience functions
+
+;;;###autoload
+(defmacro pulsar-pulse-with-face (name face)
+  "Produce NAME function to `pulsar--pulse' with FACE."
+  (declare (indent function))
+  `(defun ,name ()
+     ,(format "Like `pulsar-pulse-line' but uses the `%s' face.
+The idea with this is to run it in special hooks or contexts
+where you need a different color than what Pulsar normally
+uses (per `pulsar-face')" face)
+     (interactive)
+     (pulsar--pulse nil ',face)))
+
+(pulsar-pulse-with-face pulsar-pulse-line-red pulsar-red)
+(pulsar-pulse-with-face pulsar-pulse-line-green pulsar-green)
+(pulsar-pulse-with-face pulsar-pulse-line-yellow pulsar-yellow)
+(pulsar-pulse-with-face pulsar-pulse-line-blue pulsar-blue)
+(pulsar-pulse-with-face pulsar-pulse-line-magenta pulsar-magenta)
+(pulsar-pulse-with-face pulsar-pulse-line-cyan pulsar-cyan)
+
 ;;;;; Highlight region
 
 (defvar-local pulsar--rectangle-face-cookie nil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]