diff lisp/gnus/gnus-xmas.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 8fc7fe29b841
children 441bb1e64a06
line wrap: on
line diff
--- a/lisp/gnus/gnus-xmas.el	Mon Aug 13 08:50:31 2007 +0200
+++ b/lisp/gnus/gnus-xmas.el	Mon Aug 13 08:51:03 2007 +0200
@@ -741,22 +741,28 @@
 	   (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)))
+	(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)
-    (if (not (stringp line))
-	(list line)
-      (when (string-match "^Gnus:" line)
-	(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)))))))
+    (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)