aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Likonen2012-05-13 20:51:14 +0200
committerLars Magne Ingebrigtsen2012-05-13 20:51:14 +0200
commit56551c43270df088cd06cec6bc59620f0cc6a2cc (patch)
tree2bbb7c62b30da8e67021ad627839e8d0a597c56c
parent06bc5e6ea6d36a1166c95b81c29bc3e748d8f652 (diff)
downloademacs-56551c43270df088cd06cec6bc59620f0cc6a2cc.tar.gz
emacs-56551c43270df088cd06cec6bc59620f0cc6a2cc.zip
Allow specifying the erc timestamp format
* erc-backend.el (erc-server-timestamp-format): New variable to allow specifying the timestamp format. Fixes: debbugs:10779
-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 @@
12012-05-13 Teemu Likonen <tlikonen@iki.fi>
2
3 * erc-backend.el (erc-server-timestamp-format): New variable to
4 allow specifying the timestamp format (bug#10779).
5
12012-04-11 Vivek Dasmohapatra <vivek@etla.org> 62012-04-11 Vivek Dasmohapatra <vivek@etla.org>
2 7
3 * erc-services.el (erc-nickserv-passwords): Don't display the 8 * 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."
393 :type 'integer 393 :type 'integer
394 :group 'erc-server) 394 :group 'erc-server)
395 395
396(defcustom erc-server-timestamp-format "%Y-%m-%d %T"
397 "*Timestamp format used with server response messages.
398This string is processed using `format-time-string'."
399 :type 'string
400 :group 'erc-server)
401
396;;; Flood-related 402;;; Flood-related
397 403
398;; Most of this is courtesy of Jorgen Schaefer and Circe 404;; Most of this is courtesy of Jorgen Schaefer and Circe
@@ -1454,7 +1460,8 @@ add things to `%s' instead."
1454 "The channel topic has changed." nil 1460 "The channel topic has changed." nil
1455 (let* ((ch (first (erc-response.command-args parsed))) 1461 (let* ((ch (first (erc-response.command-args parsed)))
1456 (topic (erc-trim-string (erc-response.contents parsed))) 1462 (topic (erc-trim-string (erc-response.contents parsed)))
1457 (time (format-time-string "%T %m/%d/%y" (current-time)))) 1463 (time (format-time-string erc-server-timestamp-format
1464 (current-time))))
1458 (multiple-value-bind (nick login host) 1465 (multiple-value-bind (nick login host)
1459 (values-list (erc-parse-user (erc-response.sender parsed))) 1466 (values-list (erc-parse-user (erc-response.sender parsed)))
1460 (erc-update-channel-member ch nick nick nil nil nil host login) 1467 (erc-update-channel-member ch nick nick nil nil nil host login)
@@ -1647,7 +1654,7 @@ See `erc-display-server-message'." nil
1647 (multiple-value-bind (nick seconds-idle on-since time) 1654 (multiple-value-bind (nick seconds-idle on-since time)
1648 (values-list (cdr (erc-response.command-args parsed))) 1655 (values-list (cdr (erc-response.command-args parsed)))
1649 (setq time (when on-since 1656 (setq time (when on-since
1650 (format-time-string "%T %Y/%m/%d" 1657 (format-time-string erc-server-timestamp-format
1651 (erc-string-to-emacs-time on-since)))) 1658 (erc-string-to-emacs-time on-since))))
1652 (erc-update-user-nick nick nick nil nil nil 1659 (erc-update-user-nick nick nick nil nil nil
1653 (and time (format "on since %s" time))) 1660 (and time (format "on since %s" time)))
@@ -1724,7 +1731,8 @@ See `erc-display-server-message'." nil
1724 (third (erc-response.command-args parsed))))) 1731 (third (erc-response.command-args parsed)))))
1725 (erc-display-message 1732 (erc-display-message
1726 parsed 'notice (erc-get-buffer channel proc) 1733 parsed 'notice (erc-get-buffer channel proc)
1727 's329 ?c channel ?t (format-time-string "%A %Y/%m/%d %X" time)))) 1734 's329 ?c channel ?t (format-time-string erc-server-timestamp-format
1735 time))))
1728 1736
1729(define-erc-response-handler (330) 1737(define-erc-response-handler (330)
1730 "Nick is authed as (on Quakenet network)." nil 1738 "Nick is authed as (on Quakenet network)." nil
@@ -1761,7 +1769,7 @@ See `erc-display-server-message'." nil
1761 "Who set the topic, and when." nil 1769 "Who set the topic, and when." nil
1762 (multiple-value-bind (channel nick time) 1770 (multiple-value-bind (channel nick time)
1763 (values-list (cdr (erc-response.command-args parsed))) 1771 (values-list (cdr (erc-response.command-args parsed)))
1764 (setq time (format-time-string "%T %Y/%m/%d" 1772 (setq time (format-time-string erc-server-timestamp-format
1765 (erc-string-to-emacs-time time))) 1773 (erc-string-to-emacs-time time)))
1766 (erc-update-channel-topic channel 1774 (erc-update-channel-topic channel
1767 (format "\C-o (%s, %s)" nick time) 1775 (format "\C-o (%s, %s)" nick time)