* riece-unread.el (riece-unread-update-channel-list-buffer):
authorDaiki Ueno <ueno@unixuser.org>
Mon, 25 Aug 2003 23:40:22 +0000 (23:40 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Mon, 25 Aug 2003 23:40:22 +0000 (23:40 +0000)
Restore channel marks if exist.

* riece-naming.el (riece-naming-assert-join): Don't set
riece-redisplay-buffers.
(riece-naming-assert-part): Ditto.
(riece-naming-assert-rename): Ditto.

* riece-display.el (riece-redisplay-buffers): Abolish.
(riece-update-user-list-buffer): Don't check
riece-redisplay-buffers.
(riece-update-channel-list-buffer): Ditto; prefix "*" at the
beginning of the current channel.
(riece-switch-to-channel): Don't set riece-redisplay-buffers.
(riece-join-channel): Ditto.
(riece-part-channel): Ditto.

lisp/ChangeLog
lisp/riece-display.el
lisp/riece-naming.el
lisp/riece-unread.el

index ffe5b95..8e302aa 100644 (file)
@@ -1,3 +1,22 @@
+2003-08-25  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-unread.el (riece-unread-update-channel-list-buffer):
+       Restore channel marks if exist.
+
+       * riece-naming.el (riece-naming-assert-join): Don't set
+       riece-redisplay-buffers.
+       (riece-naming-assert-part): Ditto.
+       (riece-naming-assert-rename): Ditto.
+
+       * riece-display.el (riece-redisplay-buffers): Abolish.
+       (riece-update-user-list-buffer): Don't check
+       riece-redisplay-buffers.
+       (riece-update-channel-list-buffer): Ditto; prefix "*" at the
+       beginning of the current channel.
+       (riece-switch-to-channel): Don't set riece-redisplay-buffers.
+       (riece-join-channel): Ditto.
+       (riece-part-channel): Ditto.
+
 2003-08-25  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-display.el (riece-join-channel): Parse non-nil elements in
index 810bc1a..871015a 100644 (file)
     riece-update-short-channel-indicator
     riece-update-channel-list-indicator))
 
-(defvar riece-redisplay-buffer nil
-  "Non-nil means the buffer needs to be updated.
-Local to the buffers.")
-
 (defun riece-update-user-list-buffer ()
   (save-excursion
     (set-buffer riece-user-list-buffer)
-    (when (and riece-redisplay-buffer
-              riece-current-channel
+    (when (and riece-current-channel
               (riece-channel-p (riece-identity-prefix riece-current-channel)))
       (let (users operators speakers)
        (with-current-buffer (process-buffer (riece-server-process
@@ -69,28 +64,30 @@ Local to the buffers.")
              (if (member (car users) speakers)
                  (insert "+" (car users) "\n")
                (insert " " (car users) "\n")))
-           (setq users (cdr users)))))
-      (setq riece-redisplay-buffer nil))))
+           (setq users (cdr users))))))))
 
 (defun riece-update-channel-list-buffer ()
   (save-excursion
     (set-buffer riece-channel-list-buffer)
-    (when riece-redisplay-buffer
-      (let ((inhibit-read-only t)
-           buffer-read-only
-           (index 1)
-           (channels riece-current-channels))
-       (erase-buffer)
-       (while channels
-         (if (car channels)
-             (let ((point (point)))
-               (insert (format "%2d: %s\n" index
+    (let ((inhibit-read-only t)
+         buffer-read-only
+         (index 1)
+         (channels riece-current-channels))
+      (erase-buffer)
+      (while channels
+       (if (car channels)
+           (let ((point (point)))
+             (insert (format "%2d:%c%s\n" index
+                               (if (riece-identity-equal
+                                    (car channels)
+                                    riece-current-channel)
+                                   ?*
+                                 ?\ )
                                (riece-format-identity (car channels))))
-               (put-text-property point (point) 'riece-identity
-                                  (car channels))))
-         (setq index (1+ index)
-               channels (cdr channels))))
-      (setq riece-redisplay-buffer nil))))
+             (put-text-property point (point) 'riece-identity
+                                (car channels))))
+       (setq index (1+ index)
+             channels (cdr channels))))))
 
 (defun riece-update-channel-indicator ()
   (setq riece-channel-indicator
@@ -184,8 +181,6 @@ Local to the buffers.")
 (defun riece-switch-to-channel (identity)
   (setq riece-last-channel riece-current-channel
        riece-current-channel identity)
-  (with-current-buffer riece-user-list-buffer
-    (setq riece-redisplay-buffer t))
   (run-hooks 'riece-channel-switch-hook))
 
 (defun riece-join-channel (identity)
@@ -198,9 +193,7 @@ Local to the buffers.")
              (if channel
                  (riece-parse-identity channel)))
            riece-default-channel-binding)))
-    (riece-channel-buffer-create identity)
-    (with-current-buffer riece-channel-list-buffer
-      (setq riece-redisplay-buffer t))))
+    (riece-channel-buffer-create identity)))
 
 (defun riece-switch-to-nearest-channel (pointer)
   (let ((start riece-current-channels)
@@ -224,9 +217,7 @@ Local to the buffers.")
     (if pointer
        (setcar pointer nil))
     (if (riece-identity-equal identity riece-current-channel)
-       (riece-switch-to-nearest-channel pointer))
-    (with-current-buffer riece-channel-list-buffer
-      (setq riece-redisplay-buffer t))))
+       (riece-switch-to-nearest-channel pointer))))
 
 (defun riece-redisplay-buffers (&optional force)
   (riece-update-buffers)
index cde0032..6a59cd2 100644 (file)
       (let ((channel-identity (riece-make-identity channel-name
                                                   riece-server-name)))
        (riece-join-channel channel-identity)
-       (riece-switch-to-channel channel-identity))
-    (if (and riece-current-channel
-            (riece-identity-equal (riece-make-identity channel-name
-                                                       riece-server-name)
-                                  riece-current-channel))
-       (with-current-buffer riece-user-list-buffer
-         (setq riece-redisplay-buffer t)))))
+       (riece-switch-to-channel channel-identity))))
 
 (defun riece-naming-assert-part (user-name channel-name)
   (riece-user-toggle-channel user-name channel-name nil)
   (riece-channel-toggle-speaker channel-name user-name nil)
   (if (riece-identity-equal-no-server user-name riece-real-nickname)
       (riece-part-channel (riece-make-identity channel-name
-                                              riece-server-name))
-    (if (and riece-current-channel
-            (riece-identity-equal (riece-make-identity channel-name
-                                                       riece-server-name)
-                                  riece-current-channel))
-       (with-current-buffer riece-user-list-buffer
-         (setq riece-redisplay-buffer t)))))
+                                              riece-server-name))))
 
 (defun riece-naming-assert-rename (old-name new-name)
   (if (riece-identity-equal-no-server old-name riece-real-nickname)
            pointer (member old-name users))
       (if pointer
          (setcar pointer new-name))
-      (if (and riece-current-channel
-              (riece-identity-equal (riece-make-identity (car channels)
-                                                         riece-server-name)
-                                    riece-current-channel))
-         (with-current-buffer riece-user-list-buffer
-           (setq riece-redisplay-buffer t)))
       (setq channels (cdr channels)))
     (riece-rename-user old-name new-name)))
 
index 8f42ddc..cb27d97 100644 (file)
              buffer-read-only)
          (goto-char (point-min))
          (while (not (eobp))
-           (if (looking-at "\\( ?[0-9]+:\\)\\([ !]\\)\\(.+\\)")
+           (if (looking-at "\\( ?[0-9]+:\\)\\(.\\)\\(.+\\)")
                (let ((channel (save-match-data
                                 (riece-parse-identity (match-string 3)))))
                  (replace-match
                   (concat "\\1"
                           (if (member channel riece-unread-channels)
                               "!"
-                            " ")
+                            "\\2")
                           "\\3"))))
            (forward-line))))))