+ (let ((bar (if (gnus-news-group-p gnus-newsgroup-name)
+ gnus-summary-toolbar gnus-summary-mail-toolbar)))
+ (and gnus-use-toolbar
+ (message-xmas-setup-toolbar bar nil "gnus")
+ (set-specifier (symbol-value gnus-use-toolbar)
+ (cons (current-buffer) bar)))))
+
+(defun gnus-xmas-mail-strip-quoted-names (address)
+ "Protect mail-strip-quoted-names from NIL input.
+XEmacs compatibility workaround."
+ (if (null address)
+ nil
+ (mail-strip-quoted-names address)))
+
+(defun gnus-xmas-call-region (command &rest args)
+ (apply
+ 'call-process-region (point-min) (point-max) command t '(t nil) nil
+ args))
+
+(unless (find-face 'gnus-x-face)
+ (copy-face 'default 'gnus-x-face)
+ (set-face-foreground 'gnus-x-face "black")
+ (set-face-background 'gnus-x-face "white"))
+
+(defun gnus-xmas-article-display-xface (beg end)
+ "Display any XFace headers in the current article."
+ (save-excursion
+ (let (xface-glyph)
+ (if (featurep 'xface)
+ (setq xface-glyph
+ (make-glyph (vector 'xface :data
+ (concat "X-Face: "
+ (buffer-substring beg end)))))
+ (let ((cur (current-buffer)))
+ (save-excursion
+ (gnus-set-work-buffer)
+ (insert (format "%s" (buffer-substring beg end cur)))
+ (gnus-xmas-call-region "uncompface")
+ (goto-char (point-min))
+ (insert "/* Width=48, Height=48 */\n")
+ (gnus-xmas-call-region "icontopbm")
+ (gnus-xmas-call-region "ppmtoxpm")
+ (setq xface-glyph
+ (make-glyph
+ (vector 'xpm :data (buffer-string )))))))
+ (set-glyph-face xface-glyph 'gnus-x-face)
+ (goto-char (point-min))
+ (re-search-forward "^From:" nil t)
+ (set-extent-begin-glyph
+ (make-extent (point) (1+ (point))) xface-glyph))))
+
+(defvar gnus-xmas-pointer-glyph
+ (progn
+ (setq gnus-xmas-glyph-directory (message-xmas-find-glyph-directory "gnus"))
+ (make-pointer-glyph (concat gnus-xmas-glyph-directory "gnus-pointer."
+ (if (featurep 'xpm) "xpm" "xbm")))))
+
+(defvar gnus-xmas-modeline-left-extent
+ (let ((ext (copy-extent modeline-buffer-id-left-extent)))
+ ;(set-extent-property ext 'pointer gnus-xmas-pointer-glyph)
+ ext))
+
+(defvar gnus-xmas-modeline-right-extent
+ (let ((ext (copy-extent modeline-buffer-id-right-extent)))
+ ;(set-extent-property ext 'pointer gnus-xmas-pointer-glyph)
+ ext))
+
+(defvar gnus-xmas-modeline-glyph
+ (progn
+ (setq gnus-xmas-glyph-directory (message-xmas-find-glyph-directory "gnus"))
+ (let* ((file (concat gnus-xmas-glyph-directory "gnus-pointer."
+ (if (featurep 'xpm) "xpm" "xbm")))
+ (glyph (make-glyph file)))
+ (when (and (featurep 'x)
+ (file-exists-p file))
+ (set-glyph-face glyph 'modeline-buffer-id)
+ (set-glyph-property glyph 'image (cons 'tty "Gnus:"))
+ glyph))))
+
+(defun gnus-xmas-mode-line-buffer-identification (line)
+ (let ((line (car line))
+ chop)
+ (cond
+ ;; This is some weird type of id.
+ ((not (stringp line))
+ (list line))
+ ;; This is non-standard, so we just pass it through.
+ ((not (string-match "^Gnus:" line))
+ (list line))
+ ;; We have a standard line, so we colorize and glyphize it a bit.
+ (t
+ (setq chop (match-end 0))
+ (list
+ (if gnus-xmas-modeline-glyph
+ (cons gnus-xmas-modeline-left-extent gnus-xmas-modeline-glyph)
+ (cons gnus-xmas-modeline-left-extent (substring line 0 chop)))
+ (cons gnus-xmas-modeline-right-extent (substring line chop)))))))
+
+(defun gnus-xmas-splash ()
+ (when (eq (device-type) 'x)
+ (gnus-splash)))
+
+(provide 'gnus-xmas)