+;;; @ channel balloon
+;;;
+;;; To use:
+;;; (and (featurep 'xpm)
+;;; (memq (console-type) '(x mswindows))
+;;; (add-hook 'liece-privmsg-cleartext-hook
+;;; 'liece-xemacs-channel-balloon)
+;;; (add-hook 'liece-redisplay-buffer-functions
+;;; 'liece-xemacs-channel-balloon-kill))
+;;;
+(defun liece-xemacs-channel-balloon (prefix rest)
+ (with-current-buffer liece-channel-list-buffer
+ (let* ((buffer-read-only nil)
+ (file (liece-xemacs-icon-path
+ liece-xemacs-channel-balloon-icon))
+ (glyph (make-glyph (vector 'xpm ':file file)))
+ chnl ext)
+ (multiple-value-bind (chnl) (liece-split-line rest)
+ (setq chnl (liece-channel-virtual chnl))
+ (goto-char (point-min))
+ (and (liece-channel-p (liece-channel-real chnl))
+ (not (string= liece-current-channel chnl))
+ (re-search-forward (concat "^ ?[0-9]+: " chnl "$") nil t)
+ (progn
+ (goto-char (match-end 0))
+ (insert " ")
+ (setq ext (make-extent (match-end 0) (1+ (match-end 0))))
+ (set-extent-end-glyph ext glyph))))
+ nil)))
+
+(defun liece-xemacs-channel-balloon-kill (chnl)
+ (with-current-buffer liece-channel-list-buffer
+ (let ((buffer-read-only nil))
+ (goto-char (point-min))
+ (and (liece-channel-p (liece-channel-real chnl))
+ (re-search-forward (concat "^ ?[0-9]+: " chnl " $") nil t)
+ (progn
+ (goto-char (1- (match-end 0)))
+ (delete-char 1))))))
+