unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thuna <thuna.cing@gmail.com>
To: 66276@debbugs.gnu.org
Subject: bug#66276: Use a seperate time format in rcirc logfiles
Date: Sat, 30 Sep 2023 10:44:43 +0200	[thread overview]
Message-ID: <87o7hk124k.fsf@gmail.com> (raw)

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

I believe that it is best to have two different time formats for
logfiles and normal rcirc buffers.  Logfiles need additional precision,
specifically the date and maybe the time zone, while normal buffers do
not.

The patch adds a single variable, rcirc-log-time-format, to control the
time format in logfiles, which is done by replacing the usage of
rcirc-time-format in rcirc-log with it.

I figured "%F %T %z " was a sensible default, although feel free to
change it as you wish.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: The patch --]
[-- Type: text/x-patch, Size: 1529 bytes --]

From f9985b17ce6db949d436e798a086e5e270e1bdfc Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Sat, 30 Sep 2023 10:30:13 +0200
Subject: [PATCH] Use a seperate time format in rcirc logfiles than in rcirc
 buffers

* rcirc.el (rcirc-log-time-format): Define a seperate variable to
control the time format in logfiles.
(rcirc-log): Use rcirc-log-time-format instead of rcirc-time-format.
---
 lisp/net/rcirc.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 7afb625407e..af776296cea 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -229,6 +229,11 @@ rcirc-time-format
 Used as the first arg to `format-time-string'."
   :type 'string)
 
+(defcustom rcirc-log-time-format "%F %T %z "
+  "Describes how timestamps are printed in logfiles.
+Used as the first arg to `format-time-string'."
+  :type 'string)
+
 (defcustom rcirc-input-ring-size 1024
   "Size of input history ring."
   :type 'integer)
@@ -2213,7 +2218,7 @@ rcirc-log
                 (parse-iso8601-time-string time))))
     (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.39.3


             reply	other threads:[~2023-09-30  8:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-30  8:44 Thuna [this message]
2024-01-10 18:11 ` bug#66276: Use a seperate time format in rcirc logfiles Stefan Kangas
2024-01-10 19:06   ` Philip Kaludercic
2024-01-10 21:05     ` Stefan Kangas
2024-01-11  7:57       ` Philip Kaludercic
2024-01-11 20:23         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7hk124k.fsf@gmail.com \
    --to=thuna.cing@gmail.com \
    --cc=66276@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).