Move doom-ansi-apply away from macros + add docstring
This commit is contained in:
parent
5e5d075431
commit
11373e0128
1 changed files with 11 additions and 10 deletions
|
@ -35,6 +35,17 @@
|
|||
(strike . 9))
|
||||
"List of styles.")
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-ansi-apply (code message &rest args)
|
||||
"Apply the ansi CODE to formatted MESSAGE with ARGS."
|
||||
(let ((rule (or (assq code doom-message-fg)
|
||||
(assq code doom-message-bg)
|
||||
(assq code doom-message-fx))))
|
||||
(format "\e[%dm%s\e[%dm"
|
||||
(cdr rule)
|
||||
(apply #'format message args)
|
||||
0)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro format! (message &rest args)
|
||||
"An alternative to `format' that strips out ANSI codes if used in an
|
||||
|
@ -69,16 +80,6 @@ interactive session."
|
|||
(pop-to-buffer buf)
|
||||
(goto-char (point-max)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-ansi-apply (code format &rest args)
|
||||
(let ((rule (or (assq code doom-message-fg)
|
||||
(assq code doom-message-bg)
|
||||
(assq code doom-message-fx))))
|
||||
(format "\e[%dm%s\e[%dm"
|
||||
(cdr rule)
|
||||
(apply #'format format args)
|
||||
0)))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro warn! (message &rest args)
|
||||
"Output a colored warning for the current module in the *Messages* buffer."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue