* riece-display.el (riece-update-channel-list-indicator):
authorueno <ueno>
Mon, 13 Dec 2004 22:11:45 +0000 (22:11 +0000)
committerueno <ueno>
Mon, 13 Dec 2004 22:11:45 +0000 (22:11 +0000)
Normalize modeline indicator.

* riece-xemacs.el (riece-normalize-modeline-indicator): New alias.
* riece-emacs.el (riece-normalize-modeline-string): New function.
(riece-normalize-modeline-string-1): New function.

lisp/ChangeLog
lisp/riece-display.el
lisp/riece-emacs.el
lisp/riece-xemacs.el

index 983ca5e..375e85d 100644 (file)
@@ -1,5 +1,14 @@
 2004-12-13  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-display.el (riece-update-channel-list-indicator):
+       Normalize modeline indicator.
+
+       * riece-xemacs.el (riece-normalize-modeline-indicator): New alias.
+       * riece-emacs.el (riece-normalize-modeline-string): New function.
+       (riece-normalize-modeline-string-1): New function.
+
+2004-12-13  Daiki Ueno  <ueno@unixuser.org>
+
        * test/Makefile.am (EXTRA_DIST): Add test-riece.el.
        * test/test-riece.el: New test cases.
 
index 2129482..82af80f 100644 (file)
@@ -325,7 +325,9 @@ Local to the buffer in `riece-buffer-list'.")
        (while pointer
          (if (cdr pointer)
              (setcdr pointer (cons "," (cdr pointer))))
-         (setq pointer (cdr (cdr pointer)))))
+         (setq pointer (cdr (cdr pointer))))
+       (setq riece-channel-list-indicator
+             (riece-normalize-modeline-string riece-channel-list-indicator)))
     (setq riece-channel-list-indicator "No channel")))
 
 (defun riece-update-status-indicators ()
index bd21b5e..ed12853 100644 (file)
   (add-text-properties 0 (length string) properties string)
   string)
 
+(defun riece-normalize-modeline-string-1 (string)
+  (if string
+      (if (listp (car string))
+         (cons (car (car string)) (riece-normalize-modeline-string-1
+                                   (append (cdr (car string)) (cdr string))))
+       (cons (car string) (riece-normalize-modeline-string-1
+                           (cdr string))))))
+
+(defun riece-normalize-modeline-string (string)
+  (if (listp string)
+      (apply #'concat (riece-normalize-modeline-string-1 string))
+    string))
+
 (defun riece-put-text-property-nonsticky (start end prop value
                                                     &optional object)
   (add-text-properties start end
index 71613f9..280b34c 100644 (file)
     (set-extent-properties extent properties)
     (cons extent string)))
 
+(defalias 'riece-normalize-modeline-indicator 'identity)
+
 (defalias 'riece-facep 'find-face)
 
 (defun riece-put-text-property-nonsticky (start end prop value