From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thuna Newsgroups: gmane.emacs.bugs Subject: bug#66276: Use a seperate time format in rcirc logfiles Date: Sat, 30 Sep 2023 10:44:43 +0200 Message-ID: <87o7hk124k.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13971"; mail-complaints-to="usenet@ciao.gmane.io" To: 66276@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 30 10:46:07 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qmVby-0003Ka-G1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Sep 2023 10:46:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmVbh-0001FN-Tu; Sat, 30 Sep 2023 04:45:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qmVbg-0001F7-GP for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 04:45:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmVbg-0004uT-88 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 04:45:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmVbu-0005fw-3d for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 04:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thuna Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2023 08:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66276 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169606352121752 (code B ref -1); Sat, 30 Sep 2023 08:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Sep 2023 08:45:21 +0000 Original-Received: from localhost ([127.0.0.1]:57657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmVbF-0005el-13 for submit@debbugs.gnu.org; Sat, 30 Sep 2023 04:45:21 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:56642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmVbA-0005eN-Ak for submit@debbugs.gnu.org; Sat, 30 Sep 2023 04:45:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qmVai-0000za-D4 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 04:44:48 -0400 Original-Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmVag-0004HM-SE for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2023 04:44:48 -0400 Original-Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4066241289bso9079155e9.0 for ; Sat, 30 Sep 2023 01:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696063484; x=1696668284; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=5NF4wr908V/kckZ8iZiywCCmeJNlCJ9WRCUcOhhQ6Ec=; b=QKhQEbHWp2KoZTiwgIDsuVFqbhWFDcrg/jdJ0FX6P4VMGo9KBWhnrsU3NceM1Paucc o2QqLwQRqyome4oliDgqgLJ5Q0q6PvnGfVaCXXj3bH7TelNAz4OLNm2A3CtylM2vNyN7 SrFLNLZuYxgEtZtdDaj8LvdmaiQEn0uAoNWDSaobDWbl84ahqCyOE8byYMId5u6UOTRi /jj5WLbMLGQ4A/oreLq4QR21eOO14UInD0onmzP7S0B0FclFwR9GIvnrJGCvHrdFv3jH rxfORrW9jNjQDEP+bp6JOeXpsegg3IHItf8OVxScS5qSRhbwvKPGfBxsLMUF7VY4QE/G llZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696063484; x=1696668284; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5NF4wr908V/kckZ8iZiywCCmeJNlCJ9WRCUcOhhQ6Ec=; b=wB4S8uYDFsl9OcBlcOOxEKhkTvCsX7IhZCGUB3n1e/vPJeZG/YYbI47otZb1y4rNf9 Qd2LAlbDDV6Xeoq81qdUlSxIWCzNt2K7hLq6D24vizRAcg7RptfH21girFAgjZV2Ym2V g9uyBvf88nEiRSi9YZAbSg0u+0K/MajVuBGsZMfcm3VFwgWCgJnYcioLdjjfv+PsnX8M uo1sDPgPCanBaXwqUEEXXqOc+zj6qLhbT0voqEmCaV/noOih+BYIEB6seCkOZTpvWFgo dzKj5uV3a2lzVHmoJ17C4oiN9duEUQ8joG0WMUlrViGzLKq7fZpM4/8DmaPKJCp/NY9O SIHg== X-Gm-Message-State: AOJu0YxdkoIjWQjJk+6yjlgjZ+DHWz+8iFowTS+hh3Vm0hNH4dzpJe+u M8T5w6TT8k7ANHEIWakQCxLQ7+Mqx74= X-Google-Smtp-Source: AGHT+IFMxlYCROECNbOVAgjCSFwcuwtQYQNfOgGeUstJ+JON4vENU9RoCLZ+OG4EiJtdKNmVeOLR1A== X-Received: by 2002:a7b:c456:0:b0:401:eb0:a98d with SMTP id l22-20020a7bc456000000b004010eb0a98dmr6196666wmi.24.1696063484410; Sat, 30 Sep 2023 01:44:44 -0700 (PDT) Original-Received: from thuna ([90.147.71.75]) by smtp.gmail.com with ESMTPSA id n16-20020a7bcbd0000000b0040531f5c51asm2960018wmi.5.2023.09.30.01.44.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 01:44:43 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=thuna.cing@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271535 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-a-seperate-time-format-in-rcirc-logfiles-than-in.patch Content-Description: The patch >From f9985b17ce6db949d436e798a086e5e270e1bdfc Mon Sep 17 00:00:00 2001 From: Thuna 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 --=-=-=--