summary refs log tree commit diff stats
path: root/lisp/+circe.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/+circe.el')
-rw-r--r--lisp/+circe.el16
1 files changed, 15 insertions, 1 deletions
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 @@
48(defun +circe-current-topic (&optional message) 48(defun +circe-current-topic (&optional message)
49 "Return the topic of the current channel. 49 "Return the topic of the current channel.
50When called with optional MESSAGE non-nil, or interactively, also 50When called with optional MESSAGE non-nil, or interactively, also
51message the current topic.") 51message the current topic."
52 (interactive "p")
53 (let ((topic
54 (save-excursion
55 (goto-char (point-max))
56 (or (re-search-backward
57 (rx (group "*** "
58 (or "Topic" "topic" "TOPIC")
59 (* (not ":")) ": ")
60 (group (+ nonl)))))
61 (buffer-substring-no-properties
62 (match-beginning 2) (match-end 2)))))
63 (when message
64 (message "%s" topic))
65 topic))
52 66
53;;; Formatting messages 67;;; Formatting messages
54 68