* riece.el (riece-command-mode): Don't display
authorueno <ueno>
Sun, 28 Mar 2004 07:30:13 +0000 (07:30 +0000)
committerueno <ueno>
Sun, 28 Mar 2004 07:30:13 +0000 (07:30 +0000)
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
lisp/riece-commands.el
lisp/riece-display.el
lisp/riece-globals.el
lisp/riece.el

index e08df94..1ce8214 100644 (file)
@@ -1,3 +1,29 @@
+2004-03-28  Daiki Ueno  <ueno@unixuser.org>
+
+       * 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  <ueno@unixuser.org>
 
        * riece-unread.el (riece-unread-after-display-message-function):
index 214ac1c..13d4c08 100644 (file)
@@ -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"))
index 253ae75..fb01aa0 100644 (file)
@@ -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
index 852426a..a1410a5 100644 (file)
@@ -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
index 4e42c95..5ffc199 100644 (file)
@@ -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 "-"