From 759cb6893f7364c8e7aa1bb499e59481dca61d5d Mon Sep 17 00:00:00 2001 From: ueno Date: Sun, 28 Mar 2004 07:30:13 +0000 Subject: [PATCH] * riece.el (riece-command-mode): Don't display riece-freeze-indicator on the modeline of the command buffer. (riece-dialogue-mode): Make riece-freeze-indicator local to the buffer whose major-mode is derived from riece-dialogue-mode. * riece-display.el: Add autoload setting for derived-mode-class. (riece-update-status-indicators): Check riece-freeze flag for each buffer visible in the selected frame. * riece-commands.el: Add autoload setting for derived-mode-class. (riece-command-toggle-freeze): Don't switch to the channel buffer if major-mode of the current buffer is derived from riece-dialogue-mode. Which allows to lock "*Others*" buffer. (riece-command-toggle-own-freeze): Ditto. * riece-globals.el (riece-freeze): Fix doc. (riece-freeze-indicator): Add doc. (riece-channel-indicator): Fix doc. (riece-long-channel-indicator): Fix doc. (riece-channel-list-indicator): Fix doc. (riece-user-indicator): Fix doc. (riece-away-indicator): Add doc. (riece-operator-indicator): Add doc. --- lisp/ChangeLog | 26 ++++++++++++++++++++++++++ lisp/riece-commands.el | 30 +++++++++++++++++++----------- lisp/riece-display.el | 23 +++++++++++++---------- lisp/riece-globals.el | 31 +++++++++++++++++++++---------- lisp/riece.el | 2 +- 5 files changed, 80 insertions(+), 32 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e08df94..1ce8214 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,29 @@ +2004-03-28 Daiki Ueno + + * riece.el (riece-command-mode): Don't display + riece-freeze-indicator on the modeline of the command buffer. + (riece-dialogue-mode): Make riece-freeze-indicator local to the + buffer whose major-mode is derived from riece-dialogue-mode. + + * riece-display.el: Add autoload setting for derived-mode-class. + (riece-update-status-indicators): Check riece-freeze flag for each + buffer visible in the selected frame. + + * riece-commands.el: Add autoload setting for derived-mode-class. + (riece-command-toggle-freeze): Don't switch to the channel buffer + if major-mode of the current buffer is derived from + riece-dialogue-mode. Which allows to lock "*Others*" buffer. + (riece-command-toggle-own-freeze): Ditto. + + * riece-globals.el (riece-freeze): Fix doc. + (riece-freeze-indicator): Add doc. + (riece-channel-indicator): Fix doc. + (riece-long-channel-indicator): Fix doc. + (riece-channel-list-indicator): Fix doc. + (riece-user-indicator): Fix doc. + (riece-away-indicator): Add doc. + (riece-operator-indicator): Add doc. + 2004-03-24 Daiki Ueno * riece-unread.el (riece-unread-after-display-message-function): diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 214ac1c..13d4c08 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -33,6 +33,8 @@ (require 'riece-identity) (require 'riece-message) +(autoload 'derived-mode-class "derived") + ;;; Channel movement: (defun riece-command-switch-to-channel (channel) (interactive (list (riece-completing-read-identity @@ -552,10 +554,13 @@ the layout to the selected layout-name." "Prevent automatic scrolling of the dialogue window. If prefix argument ARG is non-nil, toggle frozen status." (interactive "P") - (with-current-buffer (if (and riece-channel-buffer-mode - riece-channel-buffer) - riece-channel-buffer - riece-dialogue-buffer) + (with-current-buffer (if (eq (derived-mode-class major-mode) + 'riece-dialogue-mode) + (current-buffer) + (if (and riece-channel-buffer-mode + riece-channel-buffer) + riece-channel-buffer + riece-dialogue-buffer)) (setq riece-freeze (if arg (< 0 (prefix-numeric-value arg)) (not riece-freeze))) @@ -567,17 +572,20 @@ If prefix argument ARG is non-nil, toggle frozen status." The difference from `riece-command-freeze' is that your messages are hidden. If prefix argument ARG is non-nil, toggle frozen status." (interactive "P") - (with-current-buffer (if (and riece-channel-buffer-mode - riece-channel-buffer) - riece-channel-buffer - riece-dialogue-buffer) + (with-current-buffer (if (eq (derived-mode-class major-mode) + 'riece-dialogue-mode) + (current-buffer) + (if (and riece-channel-buffer-mode + riece-channel-buffer) + riece-channel-buffer + riece-dialogue-buffer)) (if (if arg (< 0 (prefix-numeric-value arg)) (not (eq riece-freeze 'own))) (setq riece-freeze 'own) - (setq riece-freeze nil))) - (riece-emit-signal 'buffer-freeze-changed - (current-buffer) riece-freeze)) + (setq riece-freeze nil)) + (riece-emit-signal 'buffer-freeze-changed + (current-buffer) riece-freeze))) (eval-when-compile (autoload 'riece-exit "riece")) diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 253ae75..fb01aa0 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -30,6 +30,8 @@ (require 'riece-layout) (require 'riece-signal) +(autoload 'derived-mode-class "derived") + (defvar riece-channel-buffer-format "*Channel:%s*" "Format of channel message buffer.") (defvar riece-channel-buffer-alist nil @@ -337,16 +339,17 @@ Local to the buffer in `riece-buffer-list'.") "O" "-") riece-user-indicator riece-real-nickname)))) - (setq riece-freeze-indicator - (with-current-buffer (if (and riece-channel-buffer-mode - riece-channel-buffer) - riece-channel-buffer - riece-dialogue-buffer) - (if (eq riece-freeze 'own) - "f" - (if riece-freeze - "F" - "-"))))) + (walk-windows + (lambda (window) + (with-current-buffer (window-buffer window) + (if (eq (derived-mode-class major-mode) + 'riece-dialogue-mode) + (setq riece-freeze-indicator + (if (eq riece-freeze 'own) + "f" + (if riece-freeze + "F" + "-")))))))) (defun riece-update-buffers (&optional buffers) (unless buffers diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index 852426a..a1410a5 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -108,22 +108,33 @@ Local to the server buffers.") ;;; Variables local to the channel buffers: (defvar riece-freeze nil - "If t, channel window is not scrolled. -If 'own, channel window is not scrolled until you speak. + "If t, channel window is locked and will not be scrolled. +If 'own, channel window is locked until the user begins to speak. +Local to the channel buffers.") + +(defvar riece-freeze-indicator nil + "String displayed on the modeline to allow the user to tell if the +channel buffer is locked. Local to the channel buffers.") ;;; Modeline indicators: (defvar riece-channel-indicator "None" - "A modeline indicator of the current channel.") + "String displayed on the modeline to indicate the current channel.") (defvar riece-long-channel-indicator "None" - "A modeline indicator of the current channel.") + "String displayed on the modeline to indicate the current channel. +Generally, this string will contain more information than +riece-channel-indicator.") (defvar riece-channel-list-indicator "No channel" - "A modeline indicator of the current joined channels.") -(defvar riece-user-indicator nil) - -(defvar riece-away-indicator "-") -(defvar riece-operator-indicator "-") -(defvar riece-freeze-indicator "-") + "String displayed on the modeline to show the joined channels.") +(defvar riece-user-indicator nil + "String displayed on the modeline to show the current nickname.") + +(defvar riece-away-indicator "-" + "String displayed on the modeline to allow the user to tell if the +user is away.") +(defvar riece-operator-indicator "-" + "String displayed on the modeline to allow the user to tell if the +user is a operator.") ;;; Buffers: (defvar riece-command-buffer nil diff --git a/lisp/riece.el b/lisp/riece.el index 4e42c95..5ffc199 100644 --- a/lisp/riece.el +++ b/lisp/riece.el @@ -352,7 +352,6 @@ For a list of the generic commands type \\[riece-command-generic] ? RET. '("Riece: " riece-away-indicator riece-operator-indicator - riece-freeze-indicator " " riece-user-indicator " " @@ -377,6 +376,7 @@ Instead, these commands are available: \\{riece-dialogue-mode-map}" (kill-all-local-variables) (make-local-variable 'riece-freeze) + (make-local-variable 'riece-freeze-indicator) (setq riece-freeze riece-default-freeze riece-away-indicator "-" riece-operator-indicator "-" -- 1.7.10.4