From: ueno Date: Sun, 7 Mar 2004 21:38:50 +0000 (+0000) Subject: * riece-display.el: Rename some signals. X-Git-Tag: signal-slot-mergepoint~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=204172dff2fe66bd26366e44523b0c966b0df465;p=elisp%2Friece.git * riece-display.el: Rename some signals. * riece-commands.el (riece-command-set-operators): Reverse user-list. (riece-command-set-speakers): Ditto. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e37f53e..fa5b7dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2004-03-07 Daiki Ueno + * riece-display.el: Rename some signals. + + * riece-commands.el (riece-command-set-operators): Reverse user-list. + (riece-command-set-speakers): Ditto. + +2004-03-07 Daiki Ueno + * riece-unread.el (riece-unread-format-identity-for-channel-list-indicator): Escape % -> %%; use riece-propertize-modeline-string. diff --git a/lisp/riece-300.el b/lisp/riece-300.el index 9eb0965..034e9c0 100644 --- a/lisp/riece-300.el +++ b/lisp/riece-300.el @@ -52,11 +52,11 @@ (if operator (setq status (cons "operator" status))) (riece-user-toggle-away user away) - (riece-emit-signal 'riece-user-toggle-away + (riece-emit-signal 'user-away-changed (riece-make-identity user riece-server-name) away) (riece-user-toggle-operator user operator) - (riece-emit-signal 'riece-user-toggle-operator + (riece-emit-signal 'user-operator-changed (riece-make-identity user riece-server-name) operator) (riece-insert-info @@ -93,7 +93,7 @@ (let ((user (match-string 1 string)) (message (substring string (match-end 0)))) (riece-user-toggle-away user t) - (riece-emit-signal 'riece-user-toggle-away + (riece-emit-signal 'user-away-changed (riece-make-identity user riece-server-name) t) (riece-insert-info @@ -109,14 +109,14 @@ (defun riece-handle-305-message (prefix number name string) (riece-user-toggle-away riece-real-nickname nil) - (riece-emit-signal 'riece-user-toggle-away + (riece-emit-signal 'user-away-changed (riece-make-identity riece-real-nickname riece-server-name) nil)) (defun riece-handle-306-message (prefix number name string) (riece-user-toggle-away riece-real-nickname t) - (riece-emit-signal 'riece-user-toggle-away + (riece-emit-signal 'user-away-changed (riece-make-identity riece-real-nickname riece-server-name) t)) @@ -296,7 +296,7 @@ (while modes (riece-channel-toggle-mode channel (car modes) (eq toggle ?+)) (setq modes (cdr modes))) - (riece-emit-signal 'riece-channel-toggle-modes + (riece-emit-signal 'channel-modes-changed (riece-make-identity channel riece-server-name) modes (eq toggle ?+)) (let* ((channel-identity (riece-make-identity channel @@ -336,7 +336,7 @@ (riece-format-identity channel-identity t) message)) "\n"))) - (riece-emit-signal 'riece-channel-set-topic + (riece-emit-signal 'channel-topic-changed channel-identity (unless remove message))))) @@ -403,11 +403,11 @@ (setq status (nreverse status))) (riece-naming-assert-join nick channel) (riece-user-toggle-away user away) - (riece-emit-signal 'riece-user-toggle-away + (riece-emit-signal 'user-away-changed (riece-make-identity user riece-server-name) away) (riece-user-toggle-operator user operator) - (riece-emit-signal 'riece-user-toggle-operator + (riece-emit-signal 'user-operator-changed (riece-make-identity user riece-server-name) operator) (riece-insert-info buffer (concat (riece-concat-user-status diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 6ff9561..214ac1c 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -302,7 +302,7 @@ the layout to the selected layout-name." ?- ?+) (make-string (length group) ?o) - (mapconcat #'identity group " "))) + (mapconcat #'identity (nreverse group) " "))) (setq group nil))))) (defun riece-command-set-speakers (users &optional arg) @@ -335,7 +335,7 @@ the layout to the selected layout-name." ?- ?+) (make-string (length group) ?v) - (mapconcat #'identity group " "))) + (mapconcat #'identity (nreverse group) " "))) (setq group nil))))) (defun riece-command-send-message (message notice) @@ -559,7 +559,7 @@ If prefix argument ARG is non-nil, toggle frozen status." (setq riece-freeze (if arg (< 0 (prefix-numeric-value arg)) (not riece-freeze))) - (riece-emit-signal 'riece-buffer-toggle-freeze + (riece-emit-signal 'buffer-freeze-changed (current-buffer) riece-freeze))) (defun riece-command-toggle-own-freeze (&optional arg) @@ -576,7 +576,7 @@ If prefix argument ARG is non-nil, toggle frozen status." (not (eq riece-freeze 'own))) (setq riece-freeze 'own) (setq riece-freeze nil))) - (riece-emit-signal 'riece-buffer-toggle-freeze + (riece-emit-signal 'buffer-freeze-changed (current-buffer) riece-freeze)) (eval-when-compile diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 19e6c8a..3ecbab0 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -48,31 +48,33 @@ Local to the buffer in `riece-buffer-list'.") (defun riece-display-connect-signals () (riece-connect-signal - 'riece-update-buffer + 'channel-list-changed (lambda (signal handback) (save-excursion - (set-buffer (car (riece-signal-args signal))) + (set-buffer riece-channel-list-buffer) + (run-hooks 'riece-update-buffer-functions)) + (riece-update-channel-list-indicator))) + (riece-connect-signal + 'user-list-changed + (lambda (signal handback) + (save-excursion + (set-buffer riece-user-list-buffer) (run-hooks 'riece-update-buffer-functions)))) (riece-connect-signal - 'riece-switch-to-channel + 'channel-switched (lambda (signal handback) (riece-update-status-indicators) (riece-update-channel-indicator) (riece-update-long-channel-indicator) - (riece-update-channel-list-indicator) (force-mode-line-update t) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer) - (riece-emit-signal 'riece-update-buffer riece-channel-list-buffer) + (riece-emit-signal 'channel-list-changed) + (riece-emit-signal 'user-list-changed) (save-excursion (riece-redraw-layout)))) (riece-connect-signal - 'riece-naming-assert-channel-users - (lambda (signal handback) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer))) - (riece-connect-signal - 'riece-naming-assert-join + 'user-joined-channel (lambda (signal handback) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer)) + (riece-emit-signal 'user-list-changed)) (lambda (signal) (and riece-current-channel (riece-identity-equal (nth 1 (riece-signal-args signal)) @@ -80,7 +82,7 @@ Local to the buffer in `riece-buffer-list'.") (not (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))))) (riece-connect-signal - 'riece-naming-assert-join + 'user-joined-channel (lambda (signal handback) (riece-join-channel (nth 1 (riece-signal-args signal))) (riece-switch-to-channel (nth 1 (riece-signal-args signal))) @@ -89,9 +91,9 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))) (riece-connect-signal - 'riece-naming-assert-part + 'user-left-channel (lambda (signal handback) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer)) + (riece-emit-signal 'user-list-changed)) (lambda (signal) (and riece-current-channel (riece-identity-equal (nth 1 (riece-signal-args signal)) @@ -99,16 +101,16 @@ Local to the buffer in `riece-buffer-list'.") (not (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))))) (riece-connect-signal - 'riece-naming-assert-part + 'user-left-channel (lambda (signal handback) (riece-part-channel (nth 1 (riece-signal-args signal)))) (lambda (signal) (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))) (riece-connect-signal - 'riece-naming-assert-rename + 'user-renamed (lambda (signal handback) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer)) + (riece-emit-signal 'user-list-changed)) (lambda (signal) (and riece-current-channel (equal (riece-identity-server (nth 1 (riece-signal-args signal))) @@ -121,7 +123,7 @@ Local to the buffer in `riece-buffer-list'.") riece-current-channel)) t))))) (riece-connect-signal - 'riece-naming-assert-rename + 'user-renamed (lambda (signal handback) (riece-update-status-indicators) (riece-update-channel-indicator) @@ -130,7 +132,7 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (nth 1 (riece-signal-args signal)) (riece-current-nickname)))) (riece-connect-signal - 'riece-naming-assert-rename + 'user-renamed (lambda (signal handback) (riece-switch-to-channel (nth 1 (riece-signal-args signal)))) (lambda (signal) @@ -138,7 +140,7 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (car (riece-signal-args signal)) riece-current-channel)))) (riece-connect-signal - 'riece-naming-assert-rename + 'user-renamed (lambda (signal handback) (let* ((old-identity (car (riece-signal-args signal))) (new-identity (nth 1 (riece-signal-args signal))) @@ -155,7 +157,7 @@ Local to the buffer in `riece-buffer-list'.") riece-channel-buffer-alist) riece-channel-buffer-alist)))))))) (riece-connect-signal - 'riece-user-toggle-away + 'user-away-changed (lambda (signal handback) (riece-update-status-indicators) (force-mode-line-update t)) @@ -163,7 +165,7 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))) (riece-connect-signal - 'riece-user-toggle-operator + 'user-operator-changed (lambda (signal handback) (riece-update-status-indicators) (force-mode-line-update t)) @@ -171,7 +173,7 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))) (riece-connect-signal - 'riece-channel-set-topic + 'channel-topic-changed (lambda (signal handback) (riece-update-long-channel-indicator) (force-mode-line-update t)) @@ -180,7 +182,7 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (car (riece-signal-args signal)) riece-current-channel)))) (riece-connect-signal - 'riece-channel-set-modes + 'channel-modes-changed (lambda (signal handback) (riece-update-status-indicators) (force-mode-line-update t)) @@ -189,23 +191,23 @@ Local to the buffer in `riece-buffer-list'.") (riece-identity-equal (car (riece-signal-args signal)) riece-current-channel)))) (riece-connect-signal - 'riece-channel-toggle-operator + 'channel-operators-changed (lambda (signal handback) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer)) + (riece-emit-signal 'user-list-changed)) (lambda (signal) (and riece-current-channel (riece-identity-equal (car (riece-signal-args signal)) riece-current-channel)))) (riece-connect-signal - 'riece-channel-toggle-speaker + 'channel-speakers-changed (lambda (signal handback) - (riece-emit-signal 'riece-update-buffer riece-user-list-buffer)) + (riece-emit-signal 'user-list-changed)) (lambda (signal) (and riece-current-channel (riece-identity-equal (car (riece-signal-args signal)) riece-current-channel)))) (riece-connect-signal - 'riece-buffer-toggle-freeze + 'buffer-freeze-changed (lambda (signal handback) (riece-update-status-indicators) (force-mode-line-update t)))) @@ -390,7 +392,7 @@ Local to the buffer in `riece-buffer-list'.") (setq riece-current-channel identity riece-channel-buffer (riece-channel-buffer riece-current-channel)) (run-hook-with-args 'riece-after-switch-to-channel-functions last) - (riece-emit-signal 'riece-switch-to-channel))) + (riece-emit-signal 'channel-switched))) (defun riece-join-channel (identity) (unless (riece-identity-member identity riece-current-channels) @@ -421,7 +423,7 @@ Local to the buffer in `riece-buffer-list'.") (let ((last riece-current-channel)) (run-hook-with-args 'riece-after-switch-to-channel-functions last) (setq riece-current-channel nil) - (riece-emit-signal 'riece-switch-to-channel))))) + (riece-emit-signal 'channel-switched))))) (defun riece-part-channel (identity) (let ((pointer (riece-identity-member identity riece-current-channels))) diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el index 47f5f2a..e83fbe5 100644 --- a/lisp/riece-handle.el +++ b/lisp/riece-handle.el @@ -323,7 +323,7 @@ (user-identity (riece-make-identity user riece-server-name)) (channel-identity (riece-make-identity channel riece-server-name))) (riece-channel-set-topic (riece-get-channel channel) topic) - (riece-emit-signal 'riece-channel-set-topic + (riece-emit-signal 'channel-topic-changed channel-identity topic) (let ((buffer (riece-channel-buffer channel-identity))) (riece-insert-change @@ -371,7 +371,7 @@ (riece-channel-toggle-operator channel (nth 2 (car modes)) (nth 1 (car modes))) - (riece-emit-signal 'riece-channel-toggle-operator + (riece-emit-signal 'channel-operators-changed (riece-make-identity channel riece-server-name) (riece-make-identity (nth 2 (car modes)) @@ -381,7 +381,7 @@ (riece-channel-toggle-speaker channel (nth 2 (car modes)) (nth 1 (car modes))) - (riece-emit-signal 'riece-channel-toggle-speaker + (riece-emit-signal 'channel-speakers-changed (riece-make-identity channel riece-server-name) (riece-make-identity (nth 2 (car modes)) @@ -402,7 +402,7 @@ (t (apply #'riece-channel-toggle-mode channel (car modes)))) (setq modes (cdr modes))) - (riece-emit-signal 'riece-channel-set-modes + (riece-emit-signal 'channel-modes-changed (riece-make-identity channel riece-server-name))) diff --git a/lisp/riece-message.el b/lisp/riece-message.el index 768d781..8db0334 100644 --- a/lisp/riece-message.el +++ b/lisp/riece-message.el @@ -159,7 +159,7 @@ Normally they are *Dialogue* and/or *Others*." (riece-own-frozen buffer)) (with-current-buffer buffer (setq riece-freeze nil)) - (riece-emit-signal 'riece-buffer-toggle-freeze buffer nil)) + (riece-emit-signal 'buffer-freeze-changed buffer nil)) (setq parent-buffers (riece-message-parent-buffers message buffer)) (riece-insert buffer (concat open-bracket name close-bracket diff --git a/lisp/riece-naming.el b/lisp/riece-naming.el index ab5a357..e82fc91 100644 --- a/lisp/riece-naming.el +++ b/lisp/riece-naming.el @@ -32,7 +32,7 @@ (defun riece-naming-assert-join (user-name channel-name) (riece-user-toggle-channel user-name channel-name t) (riece-channel-toggle-user channel-name user-name t) - (riece-emit-signal 'riece-naming-assert-join + (riece-emit-signal 'user-joined-channel (riece-make-identity user-name riece-server-name) (riece-make-identity channel-name @@ -43,7 +43,7 @@ (riece-channel-toggle-user channel-name user-name nil) (riece-channel-toggle-operator channel-name user-name nil) (riece-channel-toggle-speaker channel-name user-name nil) - (riece-emit-signal 'riece-naming-assert-part + (riece-emit-signal 'user-left-channel (riece-make-identity user-name riece-server-name) (riece-make-identity channel-name @@ -63,7 +63,7 @@ (setcar user new-name)) (setq channels (cdr channels))) (riece-rename-user old-name new-name)) - (riece-emit-signal 'riece-naming-assert-rename + (riece-emit-signal 'user-renamed (riece-make-identity old-name riece-server-name) (riece-make-identity new-name riece-server-name))) @@ -86,8 +86,7 @@ (cdr (car users))) user-identity-list) users (cdr users))) - (riece-emit-signal 'riece-naming-assert-channel-users - (nreverse user-identity-list) channel-identity))) + (riece-emit-signal 'user-list-changed))) (provide 'riece-naming) diff --git a/lisp/riece-unread.el b/lisp/riece-unread.el index 4f874f5..b2b2a28 100644 --- a/lisp/riece-unread.el +++ b/lisp/riece-unread.el @@ -69,7 +69,7 @@ riece-unread-channels)) (setq riece-unread-channels (cons (riece-message-target message) riece-unread-channels)) - (riece-emit-signal 'riece-update-buffer riece-channel-list-buffer))) + (riece-emit-signal 'channel-list-changed))) (defun riece-unread-after-switch-to-channel-function (last) (setq riece-unread-channels