+(defun riece-channel-button-popup-menu (event)
+ "Popup the menu for channel buttons."
+ (interactive "@e")
+ (riece-popup-menu-popup riece-channel-button-popup-menu event))
+
+(defun riece-channel-button-switch-to-channel ()
+ (interactive)
+ (riece-command-switch-to-channel
+ (get-text-property (point) 'riece-identity)))
+
+(defun riece-channel-button-part ()
+ (interactive)
+ (riece-command-part
+ (get-text-property (point) 'riece-identity)))
+
+(defun riece-channel-button-list ()
+ (interactive)
+ (riece-command-list
+ (riece-identity-prefix (get-text-property (point) 'riece-identity))))
+
+(defvar riece-channel-button-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map riece-channel-list-mode-map)
+ (define-key map [down-mouse-3] 'riece-channel-button-popup-menu)
+ map))
+
+(defun riece-button-add-channel-buttons (start end)