]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-backend.el
There's no reason not to compile version.el
[gnu-emacs] / lisp / erc / erc-backend.el
index 7bc56584eafe42541cc47edad30cc98d5f5587ec..cce24e67cf4df7f851809997653cdacc8f08d7ab 100644 (file)
@@ -311,7 +311,7 @@ If a key is pressed while ERC is waiting, it will stop waiting."
   :type 'number)
 
 (defcustom erc-split-line-length 440
   :type 'number)
 
 (defcustom erc-split-line-length 440
-  "*The maximum length of a single message.
+  "The maximum length of a single message.
 If a message exceeds this size, it is broken into multiple ones.
 
 IRC allows for lines up to 512 bytes. Two of them are CR LF.
 If a message exceeds this size, it is broken into multiple ones.
 
 IRC allows for lines up to 512 bytes. Two of them are CR LF.
@@ -379,27 +379,34 @@ It should take same arguments as `open-network-stream' does."
   :type 'function)
 
 (defcustom erc-server-prevent-duplicates '("301")
   :type 'function)
 
 (defcustom erc-server-prevent-duplicates '("301")
-  "*Either nil or a list of strings.
+  "Either nil or a list of strings.
 Each string is a IRC message type, like PRIVMSG or NOTICE.
 All Message types in that list of subjected to duplicate prevention."
   :type '(choice (const nil) (list string))
   :group 'erc-server)
 
 (defcustom erc-server-duplicate-timeout 60
 Each string is a IRC message type, like PRIVMSG or NOTICE.
 All Message types in that list of subjected to duplicate prevention."
   :type '(choice (const nil) (list string))
   :group 'erc-server)
 
 (defcustom erc-server-duplicate-timeout 60
-  "*The time allowed in seconds between duplicate messages.
+  "The time allowed in seconds between duplicate messages.
 
 If two identical messages arrive within this value of one another, the second
 isn't displayed."
   :type 'integer
   :group 'erc-server)
 
 
 If two identical messages arrive within this value of one another, the second
 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'."
+  :version "24.2"
+  :type 'string
+  :group 'erc-server)
+
 ;;; Flood-related
 
 ;; Most of this is courtesy of Jorgen Schaefer and Circe
 ;; (http://www.nongnu.org/circe)
 
 (defcustom erc-server-flood-margin 10
 ;;; Flood-related
 
 ;; Most of this is courtesy of Jorgen Schaefer and Circe
 ;; (http://www.nongnu.org/circe)
 
 (defcustom erc-server-flood-margin 10
-  "*A margin on how much excess data we send.
+  "A margin on how much excess data we send.
 The flood protection algorithm of ERC works like the one
 detailed in RFC 2813, section 5.8 \"Flood control of clients\".
 
 The flood protection algorithm of ERC works like the one
 detailed in RFC 2813, section 5.8 \"Flood control of clients\".
 
@@ -423,14 +430,14 @@ protection algorithm."
 ;; Ping handling
 
 (defcustom erc-server-send-ping-interval 30
 ;; Ping handling
 
 (defcustom erc-server-send-ping-interval 30
-  "*Interval of sending pings to the server, in seconds.
+  "Interval of sending pings to the server, in seconds.
 If this is set to nil, pinging the server is disabled."
   :group 'erc-server
   :type '(choice (const :tag "Disabled" nil)
                  (integer :tag "Seconds")))
 
 (defcustom erc-server-send-ping-timeout 120
 If this is set to nil, pinging the server is disabled."
   :group 'erc-server
   :type '(choice (const :tag "Disabled" nil)
                  (integer :tag "Seconds")))
 
 (defcustom erc-server-send-ping-timeout 120
-  "*If the time between ping and response is greater than this, reconnect.
+  "If the time between ping and response is greater than this, reconnect.
 The time is in seconds.
 
 This must be greater than or equal to the value for
 The time is in seconds.
 
 This must be greater than or equal to the value for
@@ -1454,7 +1461,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)))
   "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)
     (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 +1655,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
   (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)))
                                      (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 +1732,8 @@ See `erc-display-server-message'." nil
                (third (erc-response.command-args parsed)))))
     (erc-display-message
      parsed 'notice (erc-get-buffer channel proc)
                (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
 
 (define-erc-response-handler (330)
   "Nick is authed as (on Quakenet network)." nil
@@ -1761,7 +1770,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)))
   "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)
                                    (erc-string-to-emacs-time time)))
     (erc-update-channel-topic channel
                               (format "\C-o (%s, %s)" nick time)