Subject: bug#67597: [PATCH] Specific rcirc log file time stamp format

From: Matto Fransen <[email-masked]>
Date: Tue, 19 Dec 2023 12:41:39 +0000

On 16 December 2023 10:39 Philip Kaludercic, wrote:
Hi Philip,

Thanks for reviewing my patch.
Based on your remarks, I created a new patch, see attached.

Is it enough to send you this patch, or should I also send it
somehow to the mailinglist? (I have no experience what so ever
with sending patches)

Best regards,

Matto
>From 31535c00e75a169b886789e39564617750448c29 Mon Sep 17 00:00:00 2001
From: Matto Fransen <[email-masked]>
Date: Tue, 19 Dec 2023 13:14:33 +0100
Subject: [PATCH] Specific rcirc log file time stamp fomrmat

The time stamp format in the chat buffer may now
differ from the format in the log files.
* doc/misc/rcirc.texi: Document new variable
* lisp/net/rcirc.el (rcirc-log-time-format):
Custom variable for the format.

Copyright-paperwork-exempt: yes
---
 doc/misc/rcirc.texi | 4 ++++
 etc/NEWS            | 3 +++
 lisp/net/rcirc.el   | 8 +++++++-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi
index 6b10d1ab2a4..d6cf9066918 100644
--- a/doc/misc/rcirc.texi
+++ b/doc/misc/rcirc.texi
@@ -929,6 +929,7 @@ Changing the time stamp format
 @cindex date time
 @cindex format time stamp
 @vindex rcirc-time-format
+@vindex rcirc-log-time-format
 
 @code{rcirc-time-format} is the format used for the time stamp.  Here's
 how to include the date in the time stamp:
@@ -937,6 +938,9 @@ Changing the time stamp format
 (setopt rcirc-time-format "%Y-%m-%d %H:%M ")
 @end example
 
+For log files, a different time format can be specified using the
+`rcirc-log-time-format' user option.
+
 @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 display a complete timestamp for
diff --git a/etc/NEWS b/etc/NEWS
index 90ff23b7937..910db376458 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1152,6 +1152,9 @@ URIs are now prefixed with "https://" instead.
 *** 'bug-reference-mode' now supports 'thing-at-point'.
 Now, calling '(thing-at-point 'url)' when point is on a bug reference
 will return the URL for that bug.
+*** Specific timestamp format for rcirc log files
+Now, the timestamp format in rcirc chat buffers can differ from the
+timestamp format in the log files.
 
 ** Customize
 
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index ecfeb9f8f84..6390d4dd284 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -229,6 +229,12 @@ rcirc-time-format
 Used as the first arg to `format-time-string'."
   :type 'string)
 
+(defcustom rcirc-log-time-format "%d-%b %H:%M "
+  "Describes how timestamps are printed in the log files.
+Used as the first arg to `format-time-string'."
+  :version "30.1"
+  :type 'string )
+
 (defcustom rcirc-input-ring-size 1024
   "Size of input history ring."
   :type 'integer)
@@ -2209,7 +2215,7 @@ rcirc-log
                 (parse-iso8601-time-string time t))))
     (unless (null filename)
       (let ((cell (assoc-string filename rcirc-log-alist))
-            (line (concat (format-time-string rcirc-time-format time)
+            (line (concat (format-time-string rcirc-log-time-format time)
                           (substring-no-properties
                            (rcirc-format-response-string process sender
                                                          response target text))
-- 
2.42.0

> Matto Fransen <[email-masked]> writes:
>
>> Tags: patch
>>
>> Allows the time stamp in crirc log files to differ from
>                            ^
>                            "rcirc"; you appear to make this typo a few
>                            more times below.
>
8< --snip--