From cf0ae4b20cb8375046266214ba918fb3cc8a2cc0 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 19 Dec 2021 22:11:39 -0600 Subject: Changes and shit --- lisp/+circe.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lisp/+circe.el') diff --git a/lisp/+circe.el b/lisp/+circe.el index d9ea9cf..9078907 100644 --- a/lisp/+circe.el +++ b/lisp/+circe.el @@ -48,7 +48,21 @@ (defun +circe-current-topic (&optional message) "Return the topic of the current channel. When called with optional MESSAGE non-nil, or interactively, also -message the current topic.") +message the current topic." + (interactive "p") + (let ((topic + (save-excursion + (goto-char (point-max)) + (or (re-search-backward + (rx (group "*** " + (or "Topic" "topic" "TOPIC") + (* (not ":")) ": ") + (group (+ nonl))))) + (buffer-substring-no-properties + (match-beginning 2) (match-end 2))))) + (when message + (message "%s" topic)) + topic)) ;;; Formatting messages -- cgit 1.4.1-21-gabe81