From cea77db0127d038b0d0728621ebea768ff832e09 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 8 Oct 2021 17:21:54 -0500 Subject: Add `circe-current-topic' and make topsy.el use it --- lisp/acdw-circe.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lisp') diff --git a/lisp/acdw-circe.el b/lisp/acdw-circe.el index d6f5b90..ec15f8e 100644 --- a/lisp/acdw-circe.el +++ b/lisp/acdw-circe.el @@ -8,6 +8,22 @@ (require 'circe) +;;; Functions + +(defun circe-current-topic (&optional message) + "Return the topic of the current channel. +When called with MESSAGE set to non-nil (or interactively), also +message the current topic." + (interactive "p") + (let ((topic + (save-excursion + (re-search-backward (rx "*** Topic for #" (+ (or word "-")) ": ")) + (buffer-substring-no-properties + (match-end 0) (line-end-position))))) + (when message + (message "%s" topic)) + topic)) + ;;; Chat commands (defun circe-command-SHORTEN (url) -- cgit 1.4.1-21-gabe81