From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.bugs Subject: bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable Date: Fri, 10 Feb 2012 16:10:27 +0200 Message-ID: <87pqdmzsmk.fsf@mithlond.arda> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1328883123 25076 80.91.229.3 (10 Feb 2012 14:12:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2012 14:12:03 +0000 (UTC) To: 10779@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 10 15:12:01 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RvrCi-0005MO-9w for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Feb 2012 15:12:00 +0100 Original-Received: from localhost ([::1]:57740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvrCh-0007Em-Ai for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Feb 2012 09:11:59 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvrCd-0007Bv-K3 for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:11:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvrCX-00035r-4O for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:11:55 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvrCX-00035l-2q for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:11:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RvrDi-0002ov-3d for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Teemu Likonen Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Feb 2012 14:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10779 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.132888312410764 (code B ref -1); Fri, 10 Feb 2012 14:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Feb 2012 14:12:04 +0000 Original-Received: from localhost ([127.0.0.1]:34787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvrCl-0002nZ-Jt for submit@debbugs.gnu.org; Fri, 10 Feb 2012 09:12:04 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57940) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RvrCh-0002n4-Oi for submit@debbugs.gnu.org; Fri, 10 Feb 2012 09:12:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvrBP-0002hr-UF for submit@debbugs.gnu.org; Fri, 10 Feb 2012 09:10:41 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:44640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvrBP-0002hj-QR for submit@debbugs.gnu.org; Fri, 10 Feb 2012 09:10:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvrBL-0006uf-E5 for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:10:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvrBF-0002ec-6f for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:10:35 -0500 Original-Received: from mta-out.inet.fi ([195.156.147.13]:40863 helo=jenni1.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvrBE-0002eH-PZ for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 09:10:29 -0500 Original-Received: from mithlond.arda (84.251.132.215) by jenni1.inet.fi (8.5.140.02) id 4EB291C404EC0868 for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 16:10:27 +0200 Original-Received: from dtw by mithlond.arda with local (Exim 4.72) (envelope-from ) id 1RvrBD-0003qr-4V for bug-gnu-emacs@gnu.org; Fri, 10 Feb 2012 16:10:27 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:56762 Archived-At: --=-=-= Content-Type: text/plain [This is a "wishlist" bug report for Emacs IRC client package ERC. This message includes a patch that fully implements my wish.] ERC displays various server response messages with timestamps. The timestamp formats that are hard-coded to ERC code have some unnecessary variation. Also, it's sometimes even unclear what is the day component and what is the month component (due to YY/MM or MM/YY differences). I suggest making those server response timestamp formats customizable and having the default value in international "%Y-%m-%d %T" format (as parsed by `format-time-string' function). This message includes a patch that fully implements this (I believe). --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ERC-Make-server-response-timestamp-format-configurab.patch >From 0ef914cc32c36e97ed7fd8b2f1fa668308c34675 Mon Sep 17 00:00:00 2001 From: Teemu Likonen Date: Fri, 10 Feb 2012 15:24:01 +0200 Subject: [PATCH] ERC: Make server response timestamp format configurable Introduce new user variable erc-server-timestamp-format with international "%Y-%m-%d %T" format as its default value. --- lisp/erc/erc-backend.el | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 7bc5658..fb3a90f 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -393,6 +393,12 @@ isn't displayed." :type 'integer :group 'erc-server) +(defcustom erc-server-timestamp-format "%Y-%m-%d %T" + "*Timestamp format used with server response messages. +This string is processed using `format-time-string'." + :type 'string + :group 'erc-server) + ;;; Flood-related ;; Most of this is courtesy of Jorgen Schaefer and Circe @@ -1454,7 +1460,8 @@ add things to `%s' instead." "The channel topic has changed." nil (let* ((ch (first (erc-response.command-args parsed))) (topic (erc-trim-string (erc-response.contents parsed))) - (time (format-time-string "%T %m/%d/%y" (current-time)))) + (time (format-time-string erc-server-timestamp-format + (current-time)))) (multiple-value-bind (nick login host) (values-list (erc-parse-user (erc-response.sender parsed))) (erc-update-channel-member ch nick nick nil nil nil host login) @@ -1647,7 +1654,7 @@ See `erc-display-server-message'." nil (multiple-value-bind (nick seconds-idle on-since time) (values-list (cdr (erc-response.command-args parsed))) (setq time (when on-since - (format-time-string "%T %Y/%m/%d" + (format-time-string erc-server-timestamp-format (erc-string-to-emacs-time on-since)))) (erc-update-user-nick nick nick nil nil nil (and time (format "on since %s" time))) @@ -1724,7 +1731,8 @@ See `erc-display-server-message'." nil (third (erc-response.command-args parsed))))) (erc-display-message parsed 'notice (erc-get-buffer channel proc) - 's329 ?c channel ?t (format-time-string "%A %Y/%m/%d %X" time)))) + 's329 ?c channel ?t (format-time-string erc-server-timestamp-format + time)))) (define-erc-response-handler (330) "Nick is authed as (on Quakenet network)." nil @@ -1761,7 +1769,7 @@ See `erc-display-server-message'." nil "Who set the topic, and when." nil (multiple-value-bind (channel nick time) (values-list (cdr (erc-response.command-args parsed))) - (setq time (format-time-string "%T %Y/%m/%d" + (setq time (format-time-string erc-server-timestamp-format (erc-string-to-emacs-time time))) (erc-update-channel-topic channel (format "\C-o (%s, %s)" nick time) -- 1.7.2.5 --=-=-=--