unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
@ 2012-02-10 14:10 Teemu Likonen
  2012-04-12 20:20 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Teemu Likonen @ 2012-02-10 14:10 UTC (permalink / raw)
  To: 10779

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

[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).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ERC-Make-server-response-timestamp-format-configurab.patch --]
[-- Type: text/x-diff, Size: 3072 bytes --]

From 0ef914cc32c36e97ed7fd8b2f1fa668308c34675 Mon Sep 17 00:00:00 2001
From: Teemu Likonen <tlikonen@iki.fi>
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


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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-02-10 14:10 bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable Teemu Likonen
@ 2012-04-12 20:20 ` Lars Magne Ingebrigtsen
  2012-04-13  2:59   ` Teemu Likonen
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-04-12 20:20 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: 10779

Teemu Likonen <tlikonen@iki.fi> writes:

> 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).

Looks good to me.  Do you have FSF copyright assignment papers on file,
or if not, would you be willing to sign such papers?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-04-12 20:20 ` Lars Magne Ingebrigtsen
@ 2012-04-13  2:59   ` Teemu Likonen
  2012-04-29 18:49     ` Teemu Likonen
  0 siblings, 1 reply; 9+ messages in thread
From: Teemu Likonen @ 2012-04-13  2:59 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10779

* Lars Magne Ingebrigtsen [2012-04-12 22:20:15 +0200] wrote:

> Teemu Likonen <tlikonen@iki.fi> writes:
>
>> 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).
>
> Looks good to me. Do you have FSF copyright assignment papers on file,
> or if not, would you be willing to sign such papers?

No, I don't have but would like to. How do I proceed?





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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-04-13  2:59   ` Teemu Likonen
@ 2012-04-29 18:49     ` Teemu Likonen
  2012-04-29 21:38       ` Deniz Dogan
  2012-05-13 18:51       ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Teemu Likonen @ 2012-04-29 18:49 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10779

* Teemu Likonen [2012-04-13 05:59:13 +0300] wrote:

> * Lars Magne Ingebrigtsen [2012-04-12 22:20:15 +0200] wrote:
>> Looks good to me. Do you have FSF copyright assignment papers on
>> file, or if not, would you be willing to sign such papers?
>
> No, I don't have but would like to. How do I proceed?

The papers have been signed now, so I guess you are free to apply my
patch.





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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-04-29 18:49     ` Teemu Likonen
@ 2012-04-29 21:38       ` Deniz Dogan
  2012-04-30  4:00         ` Teemu Likonen
  2012-05-13 18:51       ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 9+ messages in thread
From: Deniz Dogan @ 2012-04-29 21:38 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: 10779, Lars Magne Ingebrigtsen

On 2012-04-29 20:49, Teemu Likonen wrote:
> * Teemu Likonen [2012-04-13 05:59:13 +0300] wrote:
>
>> * Lars Magne Ingebrigtsen [2012-04-12 22:20:15 +0200] wrote:
>>> Looks good to me. Do you have FSF copyright assignment papers on
>>> file, or if not, would you be willing to sign such papers?
>>
>> No, I don't have but would like to. How do I proceed?
>
> The papers have been signed now, so I guess you are free to apply my
> patch.
>

Have you received a confirmation from FSF?






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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-04-29 21:38       ` Deniz Dogan
@ 2012-04-30  4:00         ` Teemu Likonen
  0 siblings, 0 replies; 9+ messages in thread
From: Teemu Likonen @ 2012-04-30  4:00 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: 10779, Lars Magne Ingebrigtsen

* Deniz Dogan [2012-04-29 23:38:45 +0200] wrote:

> Have you received a confirmation from FSF?

Yes.





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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-04-29 18:49     ` Teemu Likonen
  2012-04-29 21:38       ` Deniz Dogan
@ 2012-05-13 18:51       ` Lars Magne Ingebrigtsen
  2012-05-13 19:03         ` Teemu Likonen
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-05-13 18:51 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: 10779

Teemu Likonen <tlikonen@iki.fi> writes:

> The papers have been signed now, so I guess you are free to apply my
> patch.

I've now applied your patch.

Could you send a patch to the erc manual, too, describing the variable?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-05-13 18:51       ` Lars Magne Ingebrigtsen
@ 2012-05-13 19:03         ` Teemu Likonen
  2012-05-13 19:05           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Teemu Likonen @ 2012-05-13 19:03 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 10779

* Lars Magne Ingebrigtsen [2012-05-13 20:51:55 +0200] wrote:

> Teemu Likonen <tlikonen@iki.fi> writes:
>> The papers have been signed now, so I guess you are free to apply my
>> patch.
>
> I've now applied your patch.

Thanks.

> Could you send a patch to the erc manual, too, describing the
> variable?

The Erc manual does not describe much, and it would look strange to have
just my variable there alone.

    7.3 Options
    ===========

    This section has not yet been written. For now, the easiest way to
    check out the available options for ERC is to do `M-x
    customize-group erc RET'.

(erc) Options





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

* bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable
  2012-05-13 19:03         ` Teemu Likonen
@ 2012-05-13 19:05           ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-05-13 19:05 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: 10779

Teemu Likonen <tlikonen@iki.fi> writes:

> The Erc manual does not describe much, and it would look strange to have
> just my variable there alone.
>
>     7.3 Options
>     ===========
>
>     This section has not yet been written. For now, the easiest way to
>     check out the available options for ERC is to do `M-x
>     customize-group erc RET'.

Ah; ok.  I'm closing this bug report, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





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

end of thread, other threads:[~2012-05-13 19:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-10 14:10 bug#10779: 24.0.93; ERC: Patch to make server response timestamp format customizable Teemu Likonen
2012-04-12 20:20 ` Lars Magne Ingebrigtsen
2012-04-13  2:59   ` Teemu Likonen
2012-04-29 18:49     ` Teemu Likonen
2012-04-29 21:38       ` Deniz Dogan
2012-04-30  4:00         ` Teemu Likonen
2012-05-13 18:51       ` Lars Magne Ingebrigtsen
2012-05-13 19:03         ` Teemu Likonen
2012-05-13 19:05           ` Lars Magne Ingebrigtsen

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).