Function: pulsar-define-pulse-with-face

pulsar-define-pulse-with-face is a macro defined in pulsar.el.

Signature

(pulsar-define-pulse-with-face FACE)

Documentation

Produce function to pulse the current line with FACE.

If FACE starts with the pulsar- prefix, remove it and keep only the remaining text. The assumption is that something like pulsar-red will be convered to red, thus deriving a function named pulsar-pulse-line-red. Any other FACE is taken as-is.

Aliases

pulsar-pulse-with-face (obsolete since 1.0.0)

Source Code

;; Defined in /nix/store/3sr3j7hp5p1wsd8fv5763k239hzdxi1c-emacs-packages-deps/share/emacs/site-lisp/elpa/pulsar-1.4.1/pulsar.el
;;;###autoload
(defmacro pulsar-define-pulse-with-face (face)
  "Produce function to pulse the current line with FACE.
If FACE starts with the `pulsar-' prefix, remove it and keep only
the remaining text.  The assumption is that something like
`pulsar-red' will be convered to `red', thus deriving a function
named `pulsar-pulse-line-red'.  Any other FACE is taken as-is."
  (declare (indent function))
  (let* ((face-string (symbol-name face))
         (face-name (if (string-prefix-p "pulsar-" face-string)
                        (replace-regexp-in-string "pulsar-" "" face-string)
                      face-string)))
    `(defun ,(intern (format "pulsar-pulse-line-%s" face-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 the user option `pulsar-face')" face)
       (interactive)
       (pulsar--create-pulse (pulsar--get-line-boundaries) ',face))))