* riece.el (riece-dialogue-mode-map): Bind end-of-buffer to End.
[riece] / lisp / riece-misc.el
index 0a68bb1..72c9452 100644 (file)
@@ -31,6 +31,7 @@
 (require 'riece-channel)
 (require 'riece-server)
 (require 'riece-user)
+(require 'riece-mode)
 
 (defun riece-get-buffer-create (name &optional init-major-mode)
   (let ((buffer (get-buffer name)))
        (while (string-match "^\\([^ ]+\\) +" string)
          (setq parameters (nconc parameters (list (match-string 1 string)))
                string (substring string (match-end 0)))
-         (and (not (equal "" string)) (eq ?: (aref string 0))
-              (setq string (substring string 1))
-              (throw 'done nil))))
+         (when (and (not (equal "" string)) (eq ?: (aref string 0)))
+           (setq string (substring string 1)
+                 parameters (nconc parameters (list string)))
+           (throw 'done nil))))
       (or (equal "" string)
          (setq parameters (nconc parameters (list string))))
       parameters)))
   (riece-with-server-buffer (riece-identity-server target)
     (let ((modes (riece-channel-get-modes (riece-identity-prefix target))))
       (if modes
-         (concat string " [" (apply #'string modes) "]")
+         (concat string " ["
+                 (mapconcat
+                  (lambda (mode)
+                    (if (riece-mode-parameter mode)
+                        (format "%c(%s)"
+                                (riece-mode-flag mode)
+                                (riece-mode-parameter mode))
+                      (char-to-string (riece-mode-flag mode))))
+                  modes "")
+                 "]")
        string))))
 
 (defun riece-concat-message (string message)