*** empty log message ***
[gnus] / lisp / gnus-xmas.el
index 41d4fc1..b535403 100644 (file)
@@ -25,7 +25,6 @@
 
 ;;; Code:
 
-(require 'gnus-load)
 (require 'text-props)
 (defvar menu-bar-mode (featurep 'menubar))
 (require 'messagexmas)
@@ -138,12 +137,19 @@ It is provided only to ease porting of broken FSF Emacs programs."
     (set-extent-face gnus-newsgroup-selected-overlay
                     gnus-summary-selected-face)))
 
+(defvar gnus-xmas-force-redisplay t
+  "If non-nil, force a redisplay before recentering the summary buffer.
+This is ugly, but it works around a bug in `window-displayed-height'.")
+
 (defun gnus-xmas-summary-recenter ()
   "\"Center\" point in the summary window.
 If `gnus-auto-center-summary' is nil, or the article buffer isn't
 displayed, no centering will be performed."
   ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
   ;; Recenter only when requested.  Suggested by popovich@park.cs.columbia.edu.
+  ;; Force redisplay to get properly computed window height.
+  (when gnus-xmas-force-redisplay
+    (sit-for 0))
   (when gnus-auto-center-summary
     (let* ((height (if (fboundp 'window-displayed-height)
                       (window-displayed-height)
@@ -261,7 +267,6 @@ call it with the value of the `gnus-data' text property."
 (defmacro gnus-xmas-menu-add (type &rest menus)
   `(gnus-xmas-menu-add-1 ',type ',menus))
 (put 'gnus-xmas-menu-add 'lisp-indent-function 1)
-(put 'gnus-xmas-menu-add 'lisp-indent-hook 1)
 
 (defun gnus-xmas-menu-add-1 (type menus)
   (when (and menu-bar-mode
@@ -271,45 +276,49 @@ call it with the value of the `gnus-data' text property."
 
 (defun gnus-xmas-group-menu-add ()
   (gnus-xmas-menu-add group
-                     gnus-group-reading-menu gnus-group-group-menu gnus-group-misc-menu))
+    gnus-group-reading-menu gnus-group-group-menu gnus-group-misc-menu))
 
 (defun gnus-xmas-summary-menu-add ()
   (gnus-xmas-menu-add summary
-                     gnus-summary-misc-menu gnus-summary-kill-menu
-                     gnus-summary-article-menu gnus-summary-thread-menu
-                     gnus-summary-post-menu ))
+    gnus-summary-misc-menu gnus-summary-kill-menu
+    gnus-summary-article-menu gnus-summary-thread-menu
+    gnus-summary-post-menu ))
 
 (defun gnus-xmas-article-menu-add ()
   (gnus-xmas-menu-add article
-                     gnus-article-article-menu gnus-article-treatment-menu))
+    gnus-article-article-menu gnus-article-treatment-menu))
 
 (defun gnus-xmas-score-menu-add ()
   (gnus-xmas-menu-add score
-                     gnus-score-menu))
+    gnus-score-menu))
 
 (defun gnus-xmas-pick-menu-add ()
   (gnus-xmas-menu-add pick
-                     gnus-pick-menu))
+    gnus-pick-menu))
+
+(defun gnus-xmas-topic-menu-add ()
+  (gnus-xmas-menu-add topic
+    gnus-topic-menu))
 
 (defun gnus-xmas-binary-menu-add ()
   (gnus-xmas-menu-add binary
-                     gnus-binary-menu))
+    gnus-binary-menu))
 
 (defun gnus-xmas-tree-menu-add ()
   (gnus-xmas-menu-add tree
-                     gnus-tree-menu))
+    gnus-tree-menu))
 
 (defun gnus-xmas-server-menu-add ()
   (gnus-xmas-menu-add menu
-                     gnus-server-server-menu gnus-server-connections-menu))
+    gnus-server-server-menu gnus-server-connections-menu))
 
 (defun gnus-xmas-browse-menu-add ()
   (gnus-xmas-menu-add browse
-                     gnus-browse-menu))
+    gnus-browse-menu))
 
 (defun gnus-xmas-grouplens-menu-add ()
   (gnus-xmas-menu-add grouplens
-                     gnus-grouplens-menu))
+    gnus-grouplens-menu))
 
 (defun gnus-xmas-read-event-char ()
   "Get the next event."
@@ -404,57 +413,13 @@ call it with the value of the `gnus-data' text property."
       (if (compiled-function-p fval)
          (list 'funcall fval)
        (cons 'progn (cdr (cdr fval))))))
-      
-  ;; Fix by "jeff (j.d.) sparkes" <jsparkes@bnr.ca>.
-  (defvar gnus-display-type (device-class)
-    "A symbol indicating the display Emacs is running under.
-The symbol should be one of `color', `grayscale' or `mono'.  If Emacs
-guesses this display attribute wrongly, either set this variable in
-your `~/.emacs' or set the resource `Emacs.displayType' in your
-`~/.Xdefaults'.  See also `gnus-background-mode'.
-
-This is a meta-variable that will affect what default values other
-variables get.  You would normally not change this variable, but
-pounce directly on the real variables themselves.")
-
 
   (fset 'gnus-x-color-values 
        (if (fboundp 'x-color-values)
            'x-color-values
          (lambda (color)
            (color-instance-rgb-components
-            (make-color-instance color)))))
-    
-  (defvar gnus-background-mode 
-    (let* ((bg-resource 
-           (condition-case ()
-               (x-get-resource ".backgroundMode" "BackgroundMode" 'string)
-             (error nil)))
-          (params (frame-parameters))
-          (color (condition-case ()
-                     (or (assq 'background-color params)
-                         (color-instance-name
-                          (specifier-instance
-                           (face-background 'default))))
-                   (error nil))))
-      (cond (bg-resource (intern (downcase bg-resource)))
-           ((and color
-                 (< (apply '+ (gnus-x-color-values color))
-                    (/ (apply '+ (gnus-x-color-values "white")) 3)))
-            'dark)
-           (t 'light)))
-    "A symbol indicating the Emacs background brightness.
-The symbol should be one of `light' or `dark'.
-If Emacs guesses this frame attribute wrongly, either set this variable in
-your `~/.emacs' or set the resource `Emacs.backgroundMode' in your
-`~/.Xdefaults'.
-See also `gnus-display-type'.
-
-This is a meta-variable that will affect what default values other
-variables get.  You would normally not change this variable, but
-pounce directly on the real variables themselves.")
-  )
-
+            (make-color-instance color))))))
 
 
 (defun gnus-xmas-redefine ()
@@ -485,6 +450,7 @@ pounce directly on the real variables themselves.")
   (add-hook 'gnus-score-mode-hook 'gnus-xmas-score-menu-add)
 
   (add-hook 'gnus-pick-mode-hook 'gnus-xmas-pick-menu-add)
+  (add-hook 'gnus-topic-mode-hook 'gnus-xmas-topic-menu-add)
   (add-hook 'gnus-tree-mode-hook 'gnus-xmas-tree-menu-add)
   (add-hook 'gnus-binary-mode-hook 'gnus-xmas-binary-menu-add)
   (add-hook 'gnus-grouplens-mode-hook 'gnus-xmas-grouplens-menu-add)
@@ -579,8 +545,7 @@ pounce directly on the real variables themselves.")
        (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n))))
     ;; Fontify some.
     (goto-char (point-min))
-    (when (search-forward "Praxis" nil t)
-      (put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
+    (put-text-property (point-min) (point-max) 'face 'gnus-splash-face)
     (goto-char (point-min))
     (setq modeline-buffer-identification 
          (list (concat gnus-version ": *Group*")))