From 23d9e92ec3b55e0278f129f60d125fd29fceb4cf Mon Sep 17 00:00:00 2001 From: ueno Date: Mon, 13 Dec 2004 22:11:45 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 9 +++++++++ lisp/riece-display.el | 4 +++- lisp/riece-emacs.el | 13 +++++++++++++ lisp/riece-xemacs.el | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 983ca5e..375e85d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,14 @@ 2004-12-13 Daiki Ueno + * 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 + * test/Makefile.am (EXTRA_DIST): Add test-riece.el. * test/test-riece.el: New test cases. diff --git a/lisp/riece-display.el b/lisp/riece-display.el index 2129482..82af80f 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -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 () diff --git a/lisp/riece-emacs.el b/lisp/riece-emacs.el index bd21b5e..ed12853 100644 --- a/lisp/riece-emacs.el +++ b/lisp/riece-emacs.el @@ -95,6 +95,19 @@ (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 diff --git a/lisp/riece-xemacs.el b/lisp/riece-xemacs.el index 71613f9..280b34c 100644 --- a/lisp/riece-xemacs.el +++ b/lisp/riece-xemacs.el @@ -122,6 +122,8 @@ (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 -- 1.7.10.4