From 9ed0bcf0a4c7396967ef2d58133f45835fdd9ec6 Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 28 May 2007 05:52:40 +0000 Subject: [PATCH] * riece-log.el (riece-log-display-message-function): Just call riece-format-message. * riece-message.el (riece-format-message-1): Renamed from riece-format-message. (riece-format-message): Pick a function from riece-message-format-function-alist. --- lisp/ChangeLog | 10 ++++++++++ lisp/riece-log.el | 12 ++++-------- lisp/riece-message.el | 16 +++++++++------- lisp/riece-twitter.el | 4 +++- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e7159c1..a5a5ae9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2007-05-28 Daiki Ueno + + * riece-log.el (riece-log-display-message-function): Just call + riece-format-message. + + * riece-message.el (riece-format-message-1): Renamed from + riece-format-message. + (riece-format-message): Pick a function from + riece-message-format-function-alist. + 2007-04-24 OHASHI Akira * riece-log.el (riece-log-display-message-function): Use diff --git a/lisp/riece-log.el b/lisp/riece-log.el index 2f8b4f8..624115b 100644 --- a/lisp/riece-log.el +++ b/lisp/riece-log.el @@ -106,14 +106,10 @@ 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)) - (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))))) + (write-region (concat (format-time-string "%H:%M") " " + (riece-format-message message)) + nil file t 0 + riece-log-lock-file)))) (defun riece-log-make-file-name (identity coding-system) (expand-file-name (if (featurep 'mule) diff --git a/lisp/riece-message.el b/lisp/riece-message.el index df388f1..4dafd61 100644 --- a/lisp/riece-message.el +++ b/lisp/riece-message.el @@ -147,7 +147,7 @@ Normally they are *Dialogue* and/or *Others*." (list riece-dialogue-buffer riece-others-buffer) riece-dialogue-buffer))) -(defun riece-format-message (message &optional global) +(defun riece-format-message-1 (message &optional global) (let ((open-bracket (funcall riece-message-make-open-bracket-function message)) (close-bracket @@ -167,12 +167,14 @@ Normally they are *Dialogue* and/or *Others*." " " (riece-message-text message))) "\n")))) +(defun riece-format-message (message &optional global) + (apply (or (cdr (assq (riece-message-type message) + riece-message-format-function-alist)) + #'riece-format-message-1) + message global)) + (defun riece-display-message-1 (message) (let ((buffer (riece-message-buffer message)) - (format-message-function - (or (cdr (assq (riece-message-type message) - riece-message-format-function-alist)) - #'riece-format-message)) parent-buffers) (when (and buffer (riece-message-own-p message) @@ -181,8 +183,8 @@ Normally they are *Dialogue* and/or *Others*." (setq riece-freeze nil)) (riece-emit-signal 'buffer-freeze-changed buffer nil)) (setq parent-buffers (riece-message-parent-buffers message buffer)) - (riece-insert buffer (funcall format-message-function message)) - (riece-insert parent-buffers (funcall format-message-function message t)) + (riece-insert buffer (riece-format-message message)) + (riece-insert parent-buffers (riece-format-message message t)) (with-current-buffer buffer (run-hook-with-args 'riece-after-display-message-functions message)))) diff --git a/lisp/riece-twitter.el b/lisp/riece-twitter.el index 9e23607..f650887 100644 --- a/lisp/riece-twitter.el +++ b/lisp/riece-twitter.el @@ -12,7 +12,9 @@ "-H" "X-Twitter-Client-URL: http://riece.nongnu.org/twitter.xml" "-u" riece-twitter-credential "-d" (concat "status=" - (riece-twitter-escape-string (encode-coding-string (riece-message-text message) 'utf-8))) + (riece-twitter-escape-string + (encode-coding-string (riece-message-text message) + 'utf-8))) "-s" "http://twitter.com/statuses/update.json")) message) -- 1.7.10.4