summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
authorTeemu Likonen <tlikonen@iki.fi>2012-05-13 20:51:14 +0200
committerLars Magne Ingebrigtsen <larsi@gnus.org>2012-05-13 20:51:14 +0200
commit56551c43270df088cd06cec6bc59620f0cc6a2cc (patch)
tree2bbb7c62b30da8e67021ad627839e8d0a597c56c /lisp/erc
parent06bc5e6ea6d36a1166c95b81c29bc3e748d8f652 (diff)
downloademacs-56551c43270df088cd06cec6bc59620f0cc6a2cc.tar.gz
Allow specifying the erc timestamp format
* erc-backend.el (erc-server-timestamp-format): New variable to allow specifying the timestamp format. Fixes: debbugs:10779
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog5
-rw-r--r--lisp/erc/erc-backend.el16
2 files changed, 17 insertions, 4 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 06c6d42ed39..134938af78e 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-13 Teemu Likonen <tlikonen@iki.fi>
+
+ * erc-backend.el (erc-server-timestamp-format): New variable to
+ allow specifying the timestamp format (bug#10779).
+
2012-04-11 Vivek Dasmohapatra <vivek@etla.org>
* erc-services.el (erc-nickserv-passwords): Don't display the
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 62f524ed001..84f3ce9bc00 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)