From 8c712dc9f0adbfb02da35a2379a739e114939e89 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 3 Jan 2022 17:05:03 -0600 Subject: Format circe messages better --- lisp/+circe.el | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/+circe.el b/lisp/+circe.el index 9078907..501bd21 100644 --- a/lisp/+circe.el +++ b/lisp/+circe.el @@ -66,9 +66,21 @@ message the current topic." ;;; Formatting messages -(defun +circe-format-meta (string) - "Return a format string for `lui-format' for metadata messages." - (format "{nick:%1$d.%1$ds} *** %s" (- +circe-left-margin 3) string)) +(defun +circe-format-meta (string &optional no-nick) + "Return a format string for `lui-format' for metadata messages. +Include nick unless NO-NICK is non-nil. If NO-NICK is a string, +replace {nick} in the string with {NO-NICK}." + (cond + ((stringp no-nick) + (format "{%1$s:%2$d.%2$ds} *** %3$s" + no-nick (- +circe-left-margin 3) string)) + (no-nick + (format (format "%%%ds *** %s" (- +circe-left-margin 3) string) " ")) + (t + (format "{nick:%1$d.%1$ds} *** %s" (- +circe-left-margin 3) string)))) + +(defun +circe-format-meta* (string) + "Return a format string for `lui-format' for metadata messages, /without/ ") (defmacro +lui-make-formatting-list-rx (char) "Make a formatting regex for CHAR delimiters. -- cgit 1.4.1-21-gabe81