annotate lisp/gnus/gnus-xmas.el @ 28:1917ad0d78d7 r19-15b97

Import from CVS: tag r19-15b97
author cvs
date Mon, 13 Aug 2007 08:51:55 +0200
parents 441bb1e64a06
children ec9a17fef872
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; gnus-xmas.el --- Gnus functions for XEmacs
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
2 ;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; Boston, MA 02111-1307, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (require 'text-props)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (defvar menu-bar-mode (featurep 'menubar))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (require 'messagexmas)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (defvar gnus-xmas-glyph-directory nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 "*Directory where Gnus logos and icons are located.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 If this variable is nil, Gnus will try to locate the directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 automatically.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defvar gnus-xmas-logo-color-alist
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
38 '((flame "#cc3300" "#ff2200")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
39 (pine "#c0cc93" "#f8ffb8")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (moss "#a1cc93" "#d2ffb8")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (irish "#04cc90" "#05ff97")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (sky "#049acc" "#05deff")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (tin "#6886cc" "#82b6ff")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (velvet "#7c68cc" "#8c82ff")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (grape "#b264cc" "#cf7df")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (labia "#cc64c2" "#fd7dff")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (berry "#cc6485" "#ff7db5")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (neutral "#b4b4b4" "#878787")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (september "#bf9900" "#ffcc00"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 "Color alist used for the Gnus logo.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
52 (defvar gnus-xmas-logo-color-style 'flame
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "Color styles used for the Gnus logo.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defvar gnus-xmas-logo-colors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (cdr (assq gnus-xmas-logo-color-style gnus-xmas-logo-color-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "Colors used for the Gnus logo.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (defvar gnus-article-x-face-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (if (featurep 'xface)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 'gnus-xmas-article-display-xface
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 "{ echo '/* Width=48, Height=48 */'; uncompface; } | icontopbm | xv -quit -")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 "String or function to be executed to display an X-Face header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 If it is a string, the command will be executed in a sub-shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 asynchronously. The compressed face will be piped to this command.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;; Internal variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; Don't warn about these undefined variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (defvar gnus-group-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (defvar gnus-summary-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defvar gnus-article-mode-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;defined in gnus.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (defvar gnus-active-hashtb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (defvar gnus-article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defvar gnus-auto-center-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defvar gnus-buffer-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (defvar gnus-current-headers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (defvar gnus-level-killed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defvar gnus-level-zombie)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defvar gnus-newsgroup-bookmarks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (defvar gnus-newsgroup-dependencies)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (defvar gnus-newsgroup-selected-overlay)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (defvar gnus-newsrc-hashtb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (defvar gnus-read-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (defvar gnus-refer-article-method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (defvar gnus-reffed-article-number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (defvar gnus-unread-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defvar gnus-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (defvar gnus-view-pseudos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (defvar gnus-view-pseudos-separately)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (defvar gnus-visual)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (defvar gnus-zombie-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;;defined in gnus-msg.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (defvar gnus-article-copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (defvar gnus-check-before-posting)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ;;defined in gnus-vis.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (defvar gnus-article-button-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defvar gnus-article-mouse-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (defvar gnus-summary-selected-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (defvar gnus-group-reading-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (defvar gnus-group-group-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defvar gnus-group-misc-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (defvar gnus-summary-article-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defvar gnus-summary-thread-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (defvar gnus-summary-misc-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (defvar gnus-summary-post-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (defvar gnus-summary-kill-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defvar gnus-article-article-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (defvar gnus-article-treatment-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (defvar gnus-mouse-2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (defvar standard-display-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (defvar gnus-tree-minimize-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (defun gnus-xmas-set-text-properties (start end props &optional buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 "You should NEVER use this function. It is ideologically blasphemous.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 It is provided only to ease porting of broken FSF Emacs programs."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
120 (if (stringp buffer)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (map-extents (lambda (extent ignored)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (remove-text-properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 start end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (list (extent-property extent 'text-prop) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 buffer start end nil nil 'text-prop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (gnus-add-text-properties start end props buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defun gnus-xmas-highlight-selected-summary ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; Highlight selected article in summary buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (when gnus-summary-selected-face
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
133 (when gnus-newsgroup-selected-overlay
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
134 (delete-extent gnus-newsgroup-selected-overlay))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (setq gnus-newsgroup-selected-overlay
18
d95e72db5c07 Import from CVS: tag r19-15b92
cvs
parents: 16
diff changeset
136 (make-extent (gnus-point-at-bol) (gnus-point-at-eol)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (set-extent-face gnus-newsgroup-selected-overlay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 gnus-summary-selected-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
140 (defvar gnus-xmas-force-redisplay nil
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
141 "If non-nil, force a redisplay before recentering the summary buffer.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
142 This is ugly, but it works around a bug in `window-displayed-height'.")
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
143
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
144 (defun gnus-xmas-switch-horizontal-scrollbar-off ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
145 (set-specifier scrollbar-height (cons (current-buffer) 0)))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
146
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (defun gnus-xmas-summary-recenter ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "\"Center\" point in the summary window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 If `gnus-auto-center-summary' is nil, or the article buffer isn't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 displayed, no centering will be performed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
153 ;; Force redisplay to get properly computed window height.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
154 (when gnus-xmas-force-redisplay
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
155 (sit-for 0))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (when gnus-auto-center-summary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (let* ((height (if (fboundp 'window-displayed-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (window-displayed-height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (- (window-height) 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (top (cond ((< height 4) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ((< height 7) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (t 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (bottom (save-excursion (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (forward-line (- height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (window (get-buffer-window (current-buffer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (when (get-buffer-window gnus-article-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ;; Only do recentering when the article buffer is displayed,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ;; Set the window start to either `bottom', which is the biggest
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ;; possible valid number, or the second line from the top,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ;; whichever is the least.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (set-window-start
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
173 window (min bottom (save-excursion (forward-line (- top)) (point)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ;; Do horizontal recentering while we're at it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (when (and (get-buffer-window (current-buffer) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (not (eq gnus-auto-center-summary 'vertical)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (let ((selected (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (select-window (get-buffer-window (current-buffer) t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (gnus-summary-position-point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (gnus-horizontal-recenter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (select-window selected))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (defun gnus-xmas-add-hook (hook function &optional append local)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (add-hook hook function))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (defun gnus-xmas-add-text-properties (start end props &optional object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (add-text-properties start end props object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (put-text-property start end 'start-closed nil object))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (defun gnus-xmas-put-text-property (start end prop value &optional object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (put-text-property start end prop value object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (put-text-property start end 'start-closed nil object))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (defun gnus-xmas-extent-start-open (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (map-extents (lambda (extent arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (set-extent-property extent 'start-open t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 nil point (min (1+ (point)) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defun gnus-xmas-article-push-button (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 "Check text under the mouse pointer for a callback function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 If the text under the mouse pointer has a `gnus-callback' property,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 call it with the value of the `gnus-data' text property."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (set-buffer (window-buffer (event-window event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (let* ((pos (event-closest-point event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (data (get-text-property pos 'gnus-data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (fun (get-text-property pos 'gnus-callback)))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
208 (when fun
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
209 (funcall fun data))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (defun gnus-xmas-move-overlay (extent start end &optional buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (set-extent-endpoints extent start end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ;; Fixed by Christopher Davis <ckd@loiosh.kei.com>.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (defun gnus-xmas-article-add-button (from to fun &optional data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 "Create a button between FROM and TO with callback FUN and data DATA."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
217 (when gnus-article-button-face
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
218 (gnus-overlay-put (gnus-make-overlay from to)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
219 'face gnus-article-button-face))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (gnus-add-text-properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 from to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (nconc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (and gnus-article-mouse-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (list 'mouse-face gnus-article-mouse-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (list 'gnus-callback fun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (and data (list 'gnus-data data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (list 'highlight t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (defun gnus-xmas-window-top-edge (&optional window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (nth 1 (window-pixel-edges window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (defun gnus-xmas-tree-minimize ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (when (and gnus-tree-minimize-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (not (one-window-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (let* ((window-min-height 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (height (1+ (count-lines (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (min (max (1- window-min-height) height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (tot (if (numberp gnus-tree-minimize-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (min gnus-tree-minimize-window min)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (win (get-buffer-window (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (wh (and win (1- (window-height win)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (when (and win
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (not (eq tot wh)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (let ((selected (selected-window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (select-window win)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (enlarge-window (- tot wh))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (select-window selected))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ;; Select the lowest window on the frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (defun gnus-xmas-appt-select-lowest-window ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (let* ((lowest-window (selected-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (bottom-edge (car (cdr (cdr (cdr (window-pixel-edges))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (last-window (previous-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (window-search t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (while window-search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (let* ((this-window (next-window))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (next-bottom-edge (car (cdr (cdr (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (window-pixel-edges
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 this-window)))))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
261 (when (< bottom-edge next-bottom-edge)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
262 (setq bottom-edge next-bottom-edge)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
263 (setq lowest-window this-window))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (select-window this-window)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
266 (when (eq last-window this-window)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
267 (select-window lowest-window)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
268 (setq window-search nil))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (defmacro gnus-xmas-menu-add (type &rest menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 `(gnus-xmas-menu-add-1 ',type ',menus))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (put 'gnus-xmas-menu-add 'lisp-indent-function 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (defun gnus-xmas-menu-add-1 (type menus)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (when (and menu-bar-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (gnus-visual-p (intern (format "%s-menu" type)) 'menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (while menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (easy-menu-add (symbol-value (pop menus))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (defun gnus-xmas-group-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (gnus-xmas-menu-add group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 gnus-group-reading-menu gnus-group-group-menu gnus-group-misc-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (defun gnus-xmas-summary-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (gnus-xmas-menu-add summary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 gnus-summary-misc-menu gnus-summary-kill-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 gnus-summary-article-menu gnus-summary-thread-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 gnus-summary-post-menu ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (defun gnus-xmas-article-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (gnus-xmas-menu-add article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 gnus-article-article-menu gnus-article-treatment-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (defun gnus-xmas-score-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (gnus-xmas-menu-add score
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 gnus-score-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (defun gnus-xmas-pick-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (gnus-xmas-menu-add pick
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 gnus-pick-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
302 (defun gnus-xmas-topic-menu-add ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
303 (gnus-xmas-menu-add topic
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
304 gnus-topic-menu))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
305
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (defun gnus-xmas-binary-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (gnus-xmas-menu-add binary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 gnus-binary-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (defun gnus-xmas-tree-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (gnus-xmas-menu-add tree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 gnus-tree-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (defun gnus-xmas-server-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (gnus-xmas-menu-add menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 gnus-server-server-menu gnus-server-connections-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (defun gnus-xmas-browse-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (gnus-xmas-menu-add browse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 gnus-browse-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (defun gnus-xmas-grouplens-menu-add ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (gnus-xmas-menu-add grouplens
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 gnus-grouplens-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (defun gnus-xmas-read-event-char ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 "Get the next event."
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
328 (let ((event (next-command-event)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
329 (sit-for 0)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 ;; We junk all non-key events. Is this naughty?
28
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
331 (while (not (or (key-press-event-p event)
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
332 (button-press-event-p event)))
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
333 (dispatch-event event)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
334 (setq event (next-command-event)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (cons (and (key-press-event-p event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (event-to-character event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (defun gnus-xmas-group-remove-excess-properties ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (let ((end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (beg (progn (forward-line -1) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (remove-text-properties (1+ beg) end '(gnus-group nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (remove-text-properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 beg end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 '(gnus-topic nil gnus-topic-level nil gnus-topic-visible nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (map-extents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (lambda (e ma)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (set-extent-property e 'start-closed t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (current-buffer) beg end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (defun gnus-xmas-topic-remove-excess-properties ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (let ((end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (beg (progn (forward-line -1) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (remove-text-properties beg end '(gnus-group nil gnus-unread nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (remove-text-properties (1+ beg) end '(gnus-topic nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (goto-char end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (defun gnus-xmas-seconds-since-epoch (date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 "Return a floating point number that says how many seconds have lapsed between Jan 1 12:00:00 1970 and DATE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (let* ((tdate (mapcar (lambda (ti) (and ti (string-to-int ti)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (timezone-parse-date date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (ttime (mapcar (lambda (ti) (and ti (string-to-int ti)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (timezone-parse-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (aref (timezone-parse-date date) 3))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (edate (mapcar (lambda (ti) (and ti (string-to-int ti)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (timezone-parse-date "Jan 1 12:00:00 1970")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (tday (- (timezone-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (nth 1 tdate) (nth 2 tdate) (nth 0 tdate))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (timezone-absolute-from-gregorian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (nth 1 edate) (nth 2 edate) (nth 0 edate)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (+ (nth 2 ttime)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (* (nth 1 ttime) 60)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (* (float (nth 0 ttime)) 60 60)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (* (float tday) 60 60 24))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (defun gnus-xmas-define ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (setq gnus-mouse-2 [button2])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
380 (unless (memq 'underline (face-list))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
381 (and (fboundp 'make-face)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
382 (funcall (intern "make-face") 'underline)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 ;; Must avoid calling set-face-underline-p directly, because it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 ;; is a defsubst in emacs19, and will make the .elc files non
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 ;; portable!
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
386 (unless (face-differs-from-default-p 'underline)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
387 (funcall (intern "set-face-underline-p") 'underline t))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
388
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
389 (cond
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
390 ((fboundp 'char-or-char-int-p)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
391 ;; Handle both types of marks for XEmacs-20.x.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
392 (fset 'gnus-characterp 'char-or-char-int-p))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
393 ;; V19 of XEmacs, probably.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
394 (t
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
395 (fset 'gnus-characterp 'characterp)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (fset 'gnus-make-overlay 'make-extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (fset 'gnus-overlay-put 'set-extent-property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (fset 'gnus-move-overlay 'gnus-xmas-move-overlay)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (fset 'gnus-overlay-end 'extent-end-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (fset 'gnus-extent-detached-p 'extent-detached-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (fset 'gnus-add-text-properties 'gnus-xmas-add-text-properties)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (fset 'gnus-put-text-property 'gnus-xmas-put-text-property)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (require 'text-props)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
406 (if (and (<= emacs-major-version 19)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
407 (< emacs-minor-version 14))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (fset 'gnus-set-text-properties 'gnus-xmas-set-text-properties))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
410 (when (fboundp 'turn-off-scroll-in-place)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
411 (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
412
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
413 (unless (boundp 'standard-display-table)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
414 (setq standard-display-table nil))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (defvar gnus-mouse-face-prop 'highlight)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (unless (fboundp 'encode-time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (defun encode-time (sec minute hour day month year &optional zone)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (let ((seconds
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (gnus-xmas-seconds-since-epoch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (timezone-make-arpa-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 year month day (timezone-make-time-string hour minute sec)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 zone))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (list (floor (/ seconds (expt 2 16)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (round (mod seconds (expt 2 16)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (defun gnus-byte-code (func)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 "Return a form that can be `eval'ed based on FUNC."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (let ((fval (symbol-function func)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (if (compiled-function-p fval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (list 'funcall fval)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (cons 'progn (cdr (cdr fval))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (fset 'gnus-x-color-values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (if (fboundp 'x-color-values)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 'x-color-values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (lambda (color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (color-instance-rgb-components
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
440 (make-color-instance color))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (defun gnus-xmas-redefine ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 "Redefine lots of Gnus functions for XEmacs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (fset 'gnus-summary-make-display-table 'ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (fset 'gnus-visual-turn-off-edit-menu 'identity)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (fset 'gnus-summary-recenter 'gnus-xmas-summary-recenter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (fset 'gnus-extent-start-open 'gnus-xmas-extent-start-open)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (fset 'gnus-article-push-button 'gnus-xmas-article-push-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (fset 'gnus-article-add-button 'gnus-xmas-article-add-button)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (fset 'gnus-window-top-edge 'gnus-xmas-window-top-edge)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (fset 'gnus-read-event-char 'gnus-xmas-read-event-char)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (fset 'gnus-group-startup-message 'gnus-xmas-group-startup-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (fset 'gnus-tree-minimize 'gnus-xmas-tree-minimize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (fset 'gnus-appt-select-lowest-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 'gnus-xmas-appt-select-lowest-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (fset 'gnus-mail-strip-quoted-names 'gnus-xmas-mail-strip-quoted-names)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (fset 'gnus-add-hook 'gnus-xmas-add-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (fset 'gnus-character-to-event 'character-to-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (fset 'gnus-mode-line-buffer-identification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 'gnus-xmas-mode-line-buffer-identification)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
461 (fset 'gnus-key-press-event-p 'key-press-event-p)
28
1917ad0d78d7 Import from CVS: tag r19-15b97
cvs
parents: 26
diff changeset
462 (fset 'gnus-region-active-p 'region-active-p)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 18
diff changeset
463
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (add-hook 'gnus-group-mode-hook 'gnus-xmas-group-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (add-hook 'gnus-article-mode-hook 'gnus-xmas-article-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (add-hook 'gnus-score-mode-hook 'gnus-xmas-score-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (add-hook 'gnus-pick-mode-hook 'gnus-xmas-pick-menu-add)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
470 (add-hook 'gnus-topic-mode-hook 'gnus-xmas-topic-menu-add)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (add-hook 'gnus-tree-mode-hook 'gnus-xmas-tree-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (add-hook 'gnus-binary-mode-hook 'gnus-xmas-binary-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (add-hook 'gnus-grouplens-mode-hook 'gnus-xmas-grouplens-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (add-hook 'gnus-server-mode-hook 'gnus-xmas-server-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (add-hook 'gnus-browse-mode-hook 'gnus-xmas-browse-menu-add)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (add-hook 'gnus-group-mode-hook 'gnus-xmas-setup-group-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-setup-summary-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
480 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-switch-horizontal-scrollbar-off)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
481
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (when (and (<= emacs-major-version 19)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (<= emacs-minor-version 13))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
484 (setq gnus-article-x-face-too-ugly (when (eq (device-type) 'tty)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
485 "."))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (fset 'gnus-highlight-selected-summary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 'gnus-xmas-highlight-selected-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (fset 'gnus-group-remove-excess-properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 'gnus-xmas-group-remove-excess-properties)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (fset 'gnus-topic-remove-excess-properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 'gnus-xmas-topic-remove-excess-properties)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (fset 'gnus-mode-line-buffer-identification 'identity)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (unless (boundp 'shell-command-switch)
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
494 (setq shell-command-switch "-c"))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 ;;; XEmacs logo and toolbar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (defun gnus-xmas-group-startup-message (&optional x y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 "Insert startup message in current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 ;; Insert the message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (setq gnus-xmas-glyph-directory (message-xmas-find-glyph-directory "gnus"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (let ((logo (and gnus-xmas-glyph-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (file-name-as-directory gnus-xmas-glyph-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 "gnus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (if (featurep 'xpm) "xpm" "xbm"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (xpm-color-symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (and (featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (append `(("thing" ,(car gnus-xmas-logo-colors))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 ("shadow" ,(cadr gnus-xmas-logo-colors)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 xpm-color-symbols))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (if (and (featurep 'xpm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (not (equal (device-type) 'tty))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 logo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (file-exists-p logo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (setq logo (make-glyph logo))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (insert " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (set-extent-begin-glyph (make-extent (point) (point)) logo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (while (not (eobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (insert (make-string (/ (max (- (window-width) (or x 35)) 0) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ? ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (let* ((pheight (+ 20 (count-lines (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (wheight (window-height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (rest (- wheight pheight)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (format " %s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 _ ___ _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 _ ___ __ ___ __ _ ___
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 __ _ ___ __ ___
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 _ ___ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 _ _ __ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 ___ __ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 __ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 _ _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 _ _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 _ _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 __ ___
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 _ _ _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 _ _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 _
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 __
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 ;; And then hack it.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
556 (gnus-indent-rigidly (point-min) (point-max)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (/ (max (- (window-width) (or x 46)) 0) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (let* ((pheight (count-lines (point-min) (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (wheight (window-height))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (rest (- wheight pheight)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 ;; Fontify some.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
566 (put-text-property (point-min) (point-max) 'face 'gnus-splash-face)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (goto-char (point-min))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
568 (setq modeline-buffer-identification
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
569 (list (concat gnus-version ": *Group*")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
570 (set-buffer-modified-p t)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 ;;; The toolbar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (defvar gnus-use-toolbar (if (featurep 'toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 'default-toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 "*If nil, do not use a toolbar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 If it is non-nil, it must be a toolbar. The five legal values are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 `default-toolbar', `top-toolbar', `bottom-toolbar',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 `right-toolbar', and `left-toolbar'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (defvar gnus-group-toolbar
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
584 '([gnus-group-get-new-news gnus-group-get-new-news t "Get new news"]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 [gnus-group-get-new-news-this-group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 gnus-group-get-new-news-this-group t "Get new news in this group"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 [gnus-group-catchup-current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 gnus-group-catchup-current t "Catchup group"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 [gnus-group-describe-group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 gnus-group-describe-group t "Describe group"]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
591 [gnus-group-unsubscribe gnus-group-unsubscribe t "Unsubscribe group"]
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
592 [gnus-group-subscribe gnus-group-subscribe t "Subscribe group"]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 [gnus-group-kill-group gnus-group-kill-group t "Kill group"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 [gnus-group-exit gnus-group-exit t "Exit Gnus"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 "The group buffer toolbar.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (defvar gnus-summary-toolbar
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
599 '([gnus-summary-prev-unread
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 gnus-summary-prev-unread-article t "Prev unread article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 [gnus-summary-next-unread
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 gnus-summary-next-unread-article t "Next unread article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 [gnus-summary-post-news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 gnus-summary-post-news t "Post an article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 [gnus-summary-followup-with-original
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 gnus-summary-followup-with-original t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 "Post a followup and yank the original"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 [gnus-summary-followup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 gnus-summary-followup t "Post a followup"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 [gnus-summary-reply-with-original
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 gnus-summary-reply-with-original t "Mail a reply and yank the original"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 [gnus-summary-reply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 gnus-summary-reply t "Mail a reply"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 [gnus-summary-caesar-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 gnus-summary-caesar-message t "Rot 13"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 [gnus-uu-decode-uu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 gnus-uu-decode-uu t "Decode uuencoded articles"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 [gnus-summary-save-article-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 gnus-summary-save-article-file t "Save article in file"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 [gnus-summary-save-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 gnus-summary-save-article t "Save article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 [gnus-uu-post-news
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 gnus-uu-post-news t "Post an uuencoded article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 [gnus-summary-cancel-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 gnus-summary-cancel-article t "Cancel article"]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
626 [gnus-summary-catchup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
627 gnus-summary-catchup t "Catchup"]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 [gnus-summary-catchup-and-exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 gnus-summary-catchup-and-exit t "Catchup and exit"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 [gnus-summary-exit gnus-summary-exit t "Exit this summary"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 "The summary buffer toolbar.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (defvar gnus-summary-mail-toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 [gnus-summary-prev-unread
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 gnus-summary-prev-unread-article t "Prev unread article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 [gnus-summary-next-unread
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 gnus-summary-next-unread-article t "Next unread article"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 [gnus-summary-mail-reply gnus-summary-reply t "Reply"]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
641 ; [gnus-summary-mail-get gnus-mail-get t "Message get"]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 [gnus-summary-mail-originate gnus-summary-post-news t "Originate"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 [gnus-summary-mail-save gnus-summary-save-article t "Save"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 [gnus-summary-mail-copy gnus-summary-copy-article t "Copy message"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 ; [gnus-summary-mail-delete gnus-summary-delete-article t "Delete message"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 [gnus-summary-mail-forward gnus-summary-mail-forward t "Forward message"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 ; [gnus-summary-mail-spell gnus-mail-spell t "Spell"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 ; [gnus-summary-mail-help gnus-mail-help t "Message help"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 [gnus-summary-caesar-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 gnus-summary-caesar-message t "Rot 13"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 [gnus-uu-decode-uu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 gnus-uu-decode-uu t "Decode uuencoded articles"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 [gnus-summary-save-article-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 gnus-summary-save-article-file t "Save article in file"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 [gnus-summary-save-article
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 gnus-summary-save-article t "Save article"]
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
657 [gnus-summary-catchup
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
658 gnus-summary-catchup t "Catchup"]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 [gnus-summary-catchup-and-exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 gnus-summary-catchup-and-exit t "Catchup and exit"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 [gnus-summary-exit gnus-summary-exit t "Exit this summary"]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 "The summary buffer mail toolbar.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (defun gnus-xmas-setup-group-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (and gnus-use-toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (message-xmas-setup-toolbar gnus-group-toolbar nil "gnus")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 (set-specifier (symbol-value gnus-use-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (cons (current-buffer) gnus-group-toolbar))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (defun gnus-xmas-setup-summary-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (let ((bar (if (gnus-news-group-p gnus-newsgroup-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 gnus-summary-toolbar gnus-summary-mail-toolbar)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 (and gnus-use-toolbar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (message-xmas-setup-toolbar bar nil "gnus")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (set-specifier (symbol-value gnus-use-toolbar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (cons (current-buffer) bar)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (defun gnus-xmas-mail-strip-quoted-names (address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 "Protect mail-strip-quoted-names from NIL input.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 XEmacs compatibility workaround."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (if (null address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (mail-strip-quoted-names address)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (defun gnus-xmas-call-region (command &rest args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (apply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 'call-process-region (point-min) (point-max) command t '(t nil) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (unless (find-face 'gnus-x-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (copy-face 'default 'gnus-x-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (set-face-foreground 'gnus-x-face "black")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (set-face-background 'gnus-x-face "white"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (defun gnus-xmas-article-display-xface (beg end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 "Display any XFace headers in the current article."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (let (xface-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (if (featurep 'xface)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (setq xface-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 (make-glyph (vector 'xface :data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (concat "X-Face: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (buffer-substring beg end)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 (let ((cur (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 (gnus-set-work-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 (insert (format "%s" (buffer-substring beg end cur)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (gnus-xmas-call-region "uncompface")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (insert "/* Width=48, Height=48 */\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (gnus-xmas-call-region "icontopbm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (gnus-xmas-call-region "ppmtoxpm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (setq xface-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (make-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (vector 'xpm :data (buffer-string )))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (set-glyph-face xface-glyph 'gnus-x-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (re-search-forward "^From:" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (set-extent-begin-glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (make-extent (point) (1+ (point))) xface-glyph))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
723 (defvar gnus-xmas-pointer-glyph
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
724 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
725 (setq gnus-xmas-glyph-directory (message-xmas-find-glyph-directory "gnus"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
726 (make-pointer-glyph (concat gnus-xmas-glyph-directory "gnus-pointer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
727 (if (featurep 'xpm) "xpm" "xbm")))))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
728
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
729 (defvar gnus-xmas-modeline-left-extent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
730 (let ((ext (copy-extent modeline-buffer-id-left-extent)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
731 ;(set-extent-property ext 'pointer gnus-xmas-pointer-glyph)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
732 ext))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
733
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
734 (defvar gnus-xmas-modeline-right-extent
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
735 (let ((ext (copy-extent modeline-buffer-id-right-extent)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
736 ;(set-extent-property ext 'pointer gnus-xmas-pointer-glyph)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
737 ext))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
738
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
739 (defvar gnus-xmas-modeline-glyph
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
740 (progn
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
741 (setq gnus-xmas-glyph-directory (message-xmas-find-glyph-directory "gnus"))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
742 (let* ((file (concat gnus-xmas-glyph-directory "gnus-pointer."
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
743 (if (featurep 'xpm) "xpm" "xbm")))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
744 (glyph (make-glyph file)))
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
745 (when (and (featurep 'x)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
746 (file-exists-p file))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
747 (set-glyph-face glyph 'modeline-buffer-id)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
748 (set-glyph-property glyph 'image (cons 'tty "Gnus:"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
749 glyph))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (defun gnus-xmas-mode-line-buffer-identification (line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (let ((line (car line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 chop)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
754 (cond
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
755 ;; This is some weird type of id.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
756 ((not (stringp line))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
757 (list line))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
758 ;; This is non-standard, so we just pass it through.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
759 ((not (string-match "^Gnus:" line))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
760 (list line))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
761 ;; We have a standard line, so we colorize and glyphize it a bit.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
762 (t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
763 (setq chop (match-end 0))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
764 (list
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
765 (if gnus-xmas-modeline-glyph
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
766 (cons gnus-xmas-modeline-left-extent gnus-xmas-modeline-glyph)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
767 (cons gnus-xmas-modeline-left-extent (substring line 0 chop)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
768 (cons gnus-xmas-modeline-right-extent (substring line chop)))))))
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
769
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
770 (defun gnus-xmas-splash ()
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
771 (when (eq (device-type) 'x)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
772 (gnus-splash)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (provide 'gnus-xmas)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 ;;; gnus-xmas.el ends here