(riece-log-display-message-function): Use
authorbg66 <bg66>
Tue, 24 Apr 2007 01:21:03 +0000 (01:21 +0000)
committerbg66 <bg66>
Tue, 24 Apr 2007 01:21:03 +0000 (01:21 +0000)
riece-message-format-function-alist.

lisp/ChangeLog
lisp/riece-log.el

index 62b83ad..e7159c1 100644 (file)
@@ -1,3 +1,8 @@
+2007-04-24  OHASHI Akira  <bg66@koka-in.org>
+
+       * riece-log.el (riece-log-display-message-function): Use
+       riece-message-format-function-alist.
+
 2007-04-18  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-twitter.el: New add-on.
index 624115b..2f8b4f8 100644 (file)
@@ -106,10 +106,14 @@ It is created if there is at least one instance of Emacs running riece-log.")
             default-file-name-coding-system)
        (unless (file-directory-p (file-name-directory file))
          (make-directory (file-name-directory file) t))
-       (write-region (concat (format-time-string "%H:%M") " "
-                             (riece-format-message message))
-                     nil file t 0
-                     riece-log-lock-file))))
+       (let ((format-message-function
+              (or (cdr (assq (riece-message-type message)
+                             riece-message-format-function-alist))
+                  #'riece-format-message)))
+         (write-region (concat (format-time-string "%H:%M") " "
+                               (funcall format-message-function message))
+                       nil file t 0
+                       riece-log-lock-file)))))
 
 (defun riece-log-make-file-name (identity coding-system)
   (expand-file-name (if (featurep 'mule)