From 0d46683202e2bf4d7ae88efa0fc65ddd26a5e5fd Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 6 Jan 2022 14:55:59 +0100 Subject: [PATCH] Add rcirc-when command * doc/misc/rcirc.texi: Document rcirc-when. * etc/NEWS: Document rcirc-when. * lisp/net/rcirc.el (rcirc-when): Add command. --- doc/misc/rcirc.texi | 5 +++++ etc/NEWS | 7 ++++++- lisp/net/rcirc.el | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index f13ecc7d28d..6217781e2bd 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi @@ -933,6 +933,11 @@ how to include the date in the time stamp: (setq rcirc-time-format "%Y-%m-%d %H:%M ") @end example +@findex rcirc-when +If you don't wish to use verbose time formatting all the time, you can +use the @code{rcirc-when} command to printing a complete timestamp for +the message at point. + @node Defining a new command @section Defining a new command @cindex defining commands diff --git a/etc/NEWS b/etc/NEWS index 9c892b285d1..463c39315d4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -210,7 +210,7 @@ inserted. +++ *** New command 'emoji-describe' (bound to 'C-x 8 e d'). -This command will tell you the name of the Emoji at point. (This +nThis command will tell you the name of the Emoji at point. (This command also works for non-Emoji characters.) ** Help @@ -259,6 +259,11 @@ For example, a 'display-buffer-alist' entry of will make the body of the chosen window 40 columns wide. For the height use 'window-height' in combination with 'body-lines'. +** Rcirc + ++++ +*** New command 'rcirc-when'. + ** Tab Bars and Tab Lines --- diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 62e6281e035..dda72a2a7f2 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2047,6 +2047,13 @@ connection." (run-hook-with-args 'rcirc-print-functions process sender response target text))))) +(defun rcirc-when () + "Print a message when the message at point was received." + (interactive) + (if-let (time (get-text-property (point) 'rcirc-time)) + (message (format-time-string "%c" time)) + (message "No time information at point."))) + (defun rcirc-generate-log-filename (process target) "Return filename for log file based on PROCESS and TARGET." (if target -- 2.39.2