aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-12-12 11:19:20 -0800
committerGravatar Tom Willemse2023-12-12 11:19:20 -0800
commit91f0b224e15e0e5004b4292d2cf5cd373136e3f2 (patch)
tree4c801ac5135339d6160a62fa7ea0109f08dc9883
parent7a2a4523aaf730e75b3875ec51ec198978e80294 (diff)
downloadcirce-serenity-91f0b224e15e0e5004b4292d2cf5cd373136e3f2.tar.gz
circe-serenity-91f0b224e15e0e5004b4292d2cf5cd373136e3f2.zip
Add a formatter for noticesHEADmaster
-rw-r--r--circe-serenity.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/circe-serenity.el b/circe-serenity.el
index 6f0ecbe..501b1c8 100644
--- a/circe-serenity.el
+++ b/circe-serenity.el
@@ -202,6 +202,16 @@ passed on to `lui-format'."
(circe-serenity--define-formatter 'circe-serenity-server-nick-regain-formatter
'circe-format-server-nick-regain)
+(defun circe-serenity-notice-formatter (&rest keywords)
+ "Format a notice.
+KEYWORDS should be a plist with at least a :nick and :body key."
+ (propertize
+ (lui-format
+ (format "{intro:%ds} -{nick}- {body}" circe-serenity-longest-nick)
+ (plist-put keywords :intro "***"))
+ 'wrap-prefix (circe-serenity--fill-string)))
+(circe-serenity--define-formatter 'circe-serenity-notice-formatter 'circe-format-notice)
+
;;;###autoload
(defun enable-circe-serenity ()
"Enable Serenity for Circe."