annotate lisp/gnus/gnus-xmas.el @ 147:e186c2b7192d xemacs-20-2

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