all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67597: [PATCH] Specific crirc log file time stamp forma
@ 2023-12-02 20:19 Matto Fransen
  2023-12-16 10:39 ` bug#67597: [PATCH] Specific rcirc log file time stamp format Philip Kaludercic
  0 siblings, 1 reply; 5+ messages in thread
From: Matto Fransen @ 2023-12-02 20:19 UTC (permalink / raw)
  To: 67597

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

Tags: patch

Allows the time stamp in crirc log files to differ from
the format in the chat buffers.
For example, the chat buffers can have the format "%H:%M ",
while the log files can have a format including the date.


In GNU Emacs 30.0.50 (build 1, x86_64-unknown-freebsd14.0) of 2023-12-02
 built on testnuc.tradesystem.nl
 Repository revision: fb4b0b30a24e8192e71c1425dc8a295cf39f64ff
 Repository branch: rcirc-log-timestamp-format
 System Description: 14.0-RELEASE-p1

Configured using:
 'configure --with-x-toolkit=no --without-x'
 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Specific-crirc-log-file-time-stamp-format.patch --]
[-- Type: text/patch, Size: 3266 bytes --]

From fa0927f06e88322e274f8ce668a71de41b02b80a Mon Sep 17 00:00:00 2001
From: Matto Fransen <mattofransen@gmail.com>
Date: Sat, 2 Dec 2023 20:55:37 +0100
Subject: [PATCH] Specific crirc 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 | 8 ++++++++
 etc/NEWS            | 7 ++++++-
 lisp/net/rcirc.el   | 8 +++++++-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi
index 6b10d1ab2a4..aa424d8e164 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,13 @@ Changing the time stamp format
 (setopt rcirc-time-format "%Y-%m-%d %H:%M ")
 @end example
 
+@code{rcirc-log-time-format} is the format used for the time stamp
+in the log files.  Here's how to use month and day in the time stamp:
+
+@example
+(setopt rcirc-log-time-format "%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 display a complete timestamp for
diff --git a/etc/NEWS b/etc/NEWS
index da00ea9dbda..44cbf21a3d3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1077,11 +1077,16 @@ For links in 'webjump-sites' without an explicit URI scheme, it was
 previously assumed that they should be prefixed with "http://".  Such
 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 crirc log files
+Now, the timestamp format in crirc 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-20 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02 20:19 bug#67597: [PATCH] Specific crirc log file time stamp forma Matto Fransen
2023-12-16 10:39 ` bug#67597: [PATCH] Specific rcirc log file time stamp format Philip Kaludercic
2023-12-19 12:41   ` Matto Fransen
2023-12-19 22:22     ` Philip Kaludercic
2023-12-20 20:30     ` Philip Kaludercic

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.