Mercurial > emacs
annotate lisp/gnus/gnus-spec.el @ 92996:6dcaa1e995c4
Small formatting change.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sun, 16 Mar 2008 01:28:43 +0000 |
parents | 107ccd98fa12 |
children | 606f2d163a64 1e3a407766b9 |
rev | line source |
---|---|
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
1 ;;; gnus-spec.el --- format spec functions for Gnus |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
79708 | 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
78224
24202b793a08
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
17493 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64085 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
17493 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
87188
1b363e0443be
(declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents:
85712
diff
changeset
|
30 ;; For Emacs < 22.2. |
1b363e0443be
(declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents:
85712
diff
changeset
|
31 (eval-and-compile |
1b363e0443be
(declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents:
85712
diff
changeset
|
32 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
33 (eval-when-compile (require 'cl)) |
65272
ebdfeb914a46
(gnus-newsrc-file-version): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64754
diff
changeset
|
34 (defvar gnus-newsrc-file-version) |
19521
6f6cf9184e93
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
35 |
17493 | 36 (require 'gnus) |
37 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
38 (defcustom gnus-use-correct-string-widths (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
39 "*If non-nil, use correct functions for dealing with wide characters." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59089
diff
changeset
|
40 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
41 :group 'gnus-format |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
42 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
43 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
44 (defcustom gnus-make-format-preserve-properties (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
45 "*If non-nil, use a replacement `format' function which preserves |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
46 text properties. This is only needed on XEmacs, as FSF Emacs does this anyway." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59089
diff
changeset
|
47 :version "22.1" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
48 :group 'gnus-format |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
49 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
50 |
17493 | 51 ;;; Internal variables. |
52 | |
53 (defvar gnus-summary-mark-positions nil) | |
54 (defvar gnus-group-mark-positions nil) | |
55 (defvar gnus-group-indentation "") | |
56 | |
57 ;; Format specs. The chunks below are the machine-generated forms | |
58 ;; that are to be evaled as the result of the default format strings. | |
59 ;; We write them in here to get them byte-compiled. That way the | |
60 ;; default actions will be quite fast, while still retaining the full | |
61 ;; flexibility of the user-defined format specs. | |
62 | |
63 ;; First we have lots of dummy defvars to let the compiler know these | |
64 ;; are really dynamic variables. | |
65 | |
66 (defvar gnus-tmp-unread) | |
67 (defvar gnus-tmp-replied) | |
68 (defvar gnus-tmp-score-char) | |
69 (defvar gnus-tmp-indentation) | |
70 (defvar gnus-tmp-opening-bracket) | |
71 (defvar gnus-tmp-lines) | |
72 (defvar gnus-tmp-name) | |
73 (defvar gnus-tmp-closing-bracket) | |
74 (defvar gnus-tmp-subject-or-nil) | |
75 (defvar gnus-tmp-subject) | |
76 (defvar gnus-tmp-marked) | |
77 (defvar gnus-tmp-marked-mark) | |
78 (defvar gnus-tmp-subscribed) | |
79 (defvar gnus-tmp-process-marked) | |
80 (defvar gnus-tmp-number-of-unread) | |
81 (defvar gnus-tmp-group-name) | |
82 (defvar gnus-tmp-group) | |
83 (defvar gnus-tmp-article-number) | |
84 (defvar gnus-tmp-unread-and-unselected) | |
85 (defvar gnus-tmp-news-method) | |
86 (defvar gnus-tmp-news-server) | |
87 (defvar gnus-tmp-article-number) | |
88 (defvar gnus-mouse-face) | |
89 (defvar gnus-mouse-face-prop) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
90 (defvar gnus-tmp-header) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
91 (defvar gnus-tmp-from) |
17493 | 92 |
87188
1b363e0443be
(declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents:
85712
diff
changeset
|
93 (declare-function gnus-summary-from-or-to-or-newsgroups "gnus-sum" |
1b363e0443be
(declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents:
85712
diff
changeset
|
94 (header gnus-tmp-from)) |
1b363e0443be
(declare-function): Add compatibility declaration.
Glenn Morris <rgm@gnu.org>
parents:
85712
diff
changeset
|
95 |
17493 | 96 (defun gnus-summary-line-format-spec () |
97 (insert gnus-tmp-unread gnus-tmp-replied | |
98 gnus-tmp-score-char gnus-tmp-indentation) | |
99 (gnus-put-text-property | |
100 (point) | |
101 (progn | |
102 (insert | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
103 (format "%c%4s: %-23s%c" gnus-tmp-opening-bracket gnus-tmp-lines |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
104 (let ((val |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
105 (inline |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
106 (gnus-summary-from-or-to-or-newsgroups |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
107 gnus-tmp-header gnus-tmp-from)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
108 (if (> (length val) 23) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
109 (substring val 0 23) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
110 val)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
111 gnus-tmp-closing-bracket)) |
17493 | 112 (point)) |
113 gnus-mouse-face-prop gnus-mouse-face) | |
114 (insert " " gnus-tmp-subject-or-nil "\n")) | |
115 | |
116 (defvar gnus-summary-line-format-spec | |
117 (gnus-byte-code 'gnus-summary-line-format-spec)) | |
118 | |
119 (defun gnus-summary-dummy-line-format-spec () | |
120 (insert "* ") | |
121 (gnus-put-text-property | |
122 (point) | |
123 (progn | |
124 (insert ": :") | |
125 (point)) | |
126 gnus-mouse-face-prop gnus-mouse-face) | |
127 (insert " " gnus-tmp-subject "\n")) | |
128 | |
129 (defvar gnus-summary-dummy-line-format-spec | |
130 (gnus-byte-code 'gnus-summary-dummy-line-format-spec)) | |
131 | |
132 (defun gnus-group-line-format-spec () | |
133 (insert gnus-tmp-marked-mark gnus-tmp-subscribed | |
134 gnus-tmp-process-marked | |
135 gnus-group-indentation | |
136 (format "%5s: " gnus-tmp-number-of-unread)) | |
137 (gnus-put-text-property | |
138 (point) | |
139 (progn | |
140 (insert gnus-tmp-group "\n") | |
141 (1- (point))) | |
142 gnus-mouse-face-prop gnus-mouse-face)) | |
143 (defvar gnus-group-line-format-spec | |
144 (gnus-byte-code 'gnus-group-line-format-spec)) | |
145 | |
146 (defvar gnus-format-specs | |
147 `((version . ,emacs-version) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
148 (gnus-version . ,(gnus-continuum-version)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
149 (group "%M\%S\%p\%P\%5y: %(%g%)\n" ,gnus-group-line-format-spec) |
17493 | 150 (summary-dummy "* %(: :%) %S\n" |
151 ,gnus-summary-dummy-line-format-spec) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
152 (summary "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n" |
17493 | 153 ,gnus-summary-line-format-spec)) |
154 "Alist of format specs.") | |
155 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
156 (defvar gnus-default-format-specs gnus-format-specs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
157 |
17493 | 158 (defvar gnus-article-mode-line-format-spec nil) |
159 (defvar gnus-summary-mode-line-format-spec nil) | |
160 (defvar gnus-group-mode-line-format-spec nil) | |
161 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
162 ;;; Phew. All that gruft is over with, fortunately. |
17493 | 163 |
164 ;;;###autoload | |
165 (defun gnus-update-format (var) | |
166 "Update the format specification near point." | |
167 (interactive | |
168 (list | |
169 (save-excursion | |
170 (eval-defun nil) | |
171 ;; Find the end of the current word. | |
172 (re-search-forward "[ \t\n]" nil t) | |
173 ;; Search backward. | |
174 (when (re-search-backward "\\(gnus-[-a-z]+-line-format\\)" nil t) | |
175 (match-string 1))))) | |
176 (let* ((type (intern (progn (string-match "gnus-\\([-a-z]+\\)-line" var) | |
177 (match-string 1 var)))) | |
178 (entry (assq type gnus-format-specs)) | |
179 value spec) | |
180 (when entry | |
181 (setq gnus-format-specs (delq entry gnus-format-specs))) | |
182 (set | |
183 (intern (format "%s-spec" var)) | |
184 (gnus-parse-format (setq value (symbol-value (intern var))) | |
185 (symbol-value (intern (format "%s-alist" var))) | |
186 (not (string-match "mode" var)))) | |
187 (setq spec (symbol-value (intern (format "%s-spec" var)))) | |
188 (push (list type value spec) gnus-format-specs) | |
189 | |
190 (pop-to-buffer "*Gnus Format*") | |
191 (erase-buffer) | |
192 (lisp-interaction-mode) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
193 (insert (gnus-pp-to-string spec)))) |
17493 | 194 |
195 (defun gnus-update-format-specifications (&optional force &rest types) | |
57784
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
196 "Update all (necessary) format specifications. |
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
197 Return a list of updated types." |
17493 | 198 ;; Make the indentation array. |
199 ;; See whether all the stored info needs to be flushed. | |
200 (when (or force | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
201 (not gnus-newsrc-file-version) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
202 (not (equal (gnus-continuum-version) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
203 (gnus-continuum-version gnus-newsrc-file-version))) |
17493 | 204 (not (equal emacs-version |
205 (cdr (assq 'version gnus-format-specs))))) | |
206 (setq gnus-format-specs nil)) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
207 ;; Flush the group format spec cache if there's the grouplens stuff |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
208 ;; or it doesn't support decoded group names. |
61424
ad05d91d3598
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-243
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
209 (when (memq 'group types) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
210 (let* ((spec (assq 'group gnus-format-specs)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
211 (sspec (gnus-prin1-to-string (nth 2 spec)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
212 (when (or (string-match " gnus-tmp-grouplens[ )]" sspec) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
213 (not (string-match " gnus-tmp-decoded-group[ )]" sspec))) |
61424
ad05d91d3598
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-243
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
214 (setq gnus-format-specs (delq spec gnus-format-specs))))) |
17493 | 215 |
216 ;; Go through all the formats and see whether they need updating. | |
57784
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
217 (let (new-format entry type val updated) |
17493 | 218 (while (setq type (pop types)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
219 ;; Jump to the proper buffer to find out the value of the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
220 ;; variable, if possible. (It may be buffer-local.) |
17493 | 221 (save-excursion |
57784
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
222 (let ((buffer (intern (format "gnus-%s-buffer" type)))) |
17493 | 223 (when (and (boundp buffer) |
224 (setq val (symbol-value buffer)) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
225 (gnus-buffer-exists-p val)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
226 (set-buffer val)) |
17493 | 227 (setq new-format (symbol-value |
228 (intern (format "gnus-%s-line-format" type))))) | |
229 (setq entry (cdr (assq type gnus-format-specs))) | |
230 (if (and (car entry) | |
231 (equal (car entry) new-format)) | |
232 ;; Use the old format. | |
233 (set (intern (format "gnus-%s-line-format-spec" type)) | |
234 (cadr entry)) | |
235 ;; This is a new format. | |
236 (setq val | |
237 (if (not (stringp new-format)) | |
238 ;; This is a function call or something. | |
239 new-format | |
240 ;; This is a "real" format. | |
241 (gnus-parse-format | |
242 new-format | |
243 (symbol-value | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
244 (intern (format "gnus-%s-line-format-alist" type))) |
17493 | 245 (not (string-match "mode$" (symbol-name type)))))) |
246 ;; Enter the new format spec into the list. | |
247 (if entry | |
248 (progn | |
249 (setcar (cdr entry) val) | |
250 (setcar entry new-format)) | |
251 (push (list type new-format val) gnus-format-specs)) | |
57784
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
252 (set (intern (format "gnus-%s-line-format-spec" type)) val) |
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
253 (push type updated)))) |
17493 | 254 |
57784
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
255 (unless (assq 'version gnus-format-specs) |
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
256 (push (cons 'version emacs-version) gnus-format-specs)) |
55829134ac17
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650
Miles Bader <miles@gnu.org>
parents:
56927
diff
changeset
|
257 updated)) |
17493 | 258 |
259 (defvar gnus-mouse-face-0 'highlight) | |
260 (defvar gnus-mouse-face-1 'highlight) | |
261 (defvar gnus-mouse-face-2 'highlight) | |
262 (defvar gnus-mouse-face-3 'highlight) | |
263 (defvar gnus-mouse-face-4 'highlight) | |
264 | |
265 (defun gnus-mouse-face-function (form type) | |
266 `(gnus-put-text-property | |
267 (point) (progn ,@form (point)) | |
268 gnus-mouse-face-prop | |
269 ,(if (equal type 0) | |
270 'gnus-mouse-face | |
271 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type))))))) | |
272 | |
273 (defvar gnus-face-0 'bold) | |
274 (defvar gnus-face-1 'italic) | |
275 (defvar gnus-face-2 'bold-italic) | |
276 (defvar gnus-face-3 'bold) | |
277 (defvar gnus-face-4 'bold) | |
278 | |
279 (defun gnus-face-face-function (form type) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
280 `(gnus-add-text-properties |
17493 | 281 (point) (progn ,@form (point)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
282 '(gnus-face t face ,(symbol-value (intern (format "gnus-face-%d" type)))))) |
17493 | 283 |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
284 (defun gnus-balloon-face-function (form type) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
285 `(gnus-put-text-property |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
286 (point) (progn ,@form (point)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
287 ,(if (fboundp 'balloon-help-mode) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
288 ''balloon-help |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
289 ''help-echo) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
290 ,(intern (format "gnus-balloon-face-%d" type)))) |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
291 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
292 (defun gnus-spec-tab (column) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
293 (if (> column 0) |
59089
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
294 `(insert-char ? (max (- ,column (current-column)) 0)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
295 (let ((column (abs column))) |
59089
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
296 `(if (> (current-column) ,column) |
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
297 (let ((end (point))) |
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
298 (if (= (move-to-column ,column) ,column) |
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
299 (delete-region (point) end) |
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
300 (delete-region (1- (point)) end) |
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
301 (insert " "))) |
22da0004ae3c
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-750
Miles Bader <miles@gnu.org>
parents:
57856
diff
changeset
|
302 (insert-char ? (max (- ,column (current-column)) 0)))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
303 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
304 (defun gnus-correct-length (string) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
305 "Return the correct width of STRING." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
306 (apply #'+ (mapcar #'char-width string))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
307 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
308 (defun gnus-correct-substring (string start &optional end) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
309 (let ((wstart 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
310 (wend 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
311 (wseek 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
312 (seek 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
313 (length (length string)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
314 (string (concat string "\0"))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
315 ;; Find the start position. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
316 (while (and (< seek length) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
317 (< wseek start)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
318 (incf wseek (char-width (aref string seek))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
319 (incf seek)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
320 (setq wstart seek) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
321 ;; Find the end position. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
322 (while (and (<= seek length) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
323 (or (not end) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
324 (<= wseek end))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
325 (incf wseek (char-width (aref string seek))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
326 (incf seek)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
327 (setq wend seek) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
328 (substring string wstart (1- wend)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
329 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
330 (defun gnus-string-width-function () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
331 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
332 (gnus-use-correct-string-widths |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
333 'gnus-correct-length) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
334 ((fboundp 'string-width) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
335 'string-width) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
336 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
337 'length))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
338 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
339 (defun gnus-substring-function () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
340 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
341 (gnus-use-correct-string-widths |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
342 'gnus-correct-substring) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
343 ((fboundp 'string-width) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
344 'gnus-correct-substring) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
345 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
346 'substring))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
347 |
17493 | 348 (defun gnus-tilde-max-form (el max-width) |
349 "Return a form that limits EL to MAX-WIDTH." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
350 (let ((max (abs max-width)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
351 (length-fun (gnus-string-width-function)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
352 (substring-fun (gnus-substring-function))) |
17493 | 353 (if (symbolp el) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
354 `(if (> (,length-fun ,el) ,max) |
17493 | 355 ,(if (< max-width 0) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
356 `(,substring-fun ,el (- (,length-fun ,el) ,max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
357 `(,substring-fun ,el 0 ,max)) |
17493 | 358 ,el) |
359 `(let ((val (eval ,el))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
360 (if (> (,length-fun val) ,max) |
17493 | 361 ,(if (< max-width 0) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
362 `(,substring-fun val (- (,length-fun val) ,max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
363 `(,substring-fun val 0 ,max)) |
17493 | 364 val))))) |
365 | |
366 (defun gnus-tilde-cut-form (el cut-width) | |
367 "Return a form that cuts CUT-WIDTH off of EL." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
368 (let ((cut (abs cut-width)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
369 (length-fun (gnus-string-width-function)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
370 (substring-fun (gnus-substring-function))) |
17493 | 371 (if (symbolp el) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
372 `(if (> (,length-fun ,el) ,cut) |
17493 | 373 ,(if (< cut-width 0) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
374 `(,substring-fun ,el 0 (- (,length-fun ,el) ,cut)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
375 `(,substring-fun ,el ,cut)) |
17493 | 376 ,el) |
377 `(let ((val (eval ,el))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
378 (if (> (,length-fun val) ,cut) |
17493 | 379 ,(if (< cut-width 0) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
380 `(,substring-fun val 0 (- (,length-fun val) ,cut)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
381 `(,substring-fun val ,cut)) |
17493 | 382 val))))) |
383 | |
384 (defun gnus-tilde-ignore-form (el ignore-value) | |
385 "Return a form that is blank when EL is IGNORE-VALUE." | |
386 (if (symbolp el) | |
387 `(if (equal ,el ,ignore-value) | |
388 "" ,el) | |
389 `(let ((val (eval ,el))) | |
390 (if (equal val ,ignore-value) | |
391 "" val)))) | |
392 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
393 (defun gnus-pad-form (el pad-width) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
394 "Return a form that pads EL to PAD-WIDTH accounting for multi-column |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
395 characters correctly. This is because `format' may pad to columns or to |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
396 characters when given a pad value." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
397 (let ((pad (abs pad-width)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
398 (side (< 0 pad-width)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
399 (length-fun (gnus-string-width-function))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
400 (if (symbolp el) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
401 `(let ((need (- ,pad (,length-fun ,el)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
402 (if (> need 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
403 (concat ,(when side '(make-string need ?\ )) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
404 ,el |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
405 ,(when (not side) '(make-string need ?\ ))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
406 ,el)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
407 `(let* ((val (eval ,el)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
408 (need (- ,pad (,length-fun val)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
409 (if (> need 0) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
410 (concat ,(when side '(make-string need ?\ )) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
411 val |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
412 ,(when (not side) '(make-string need ?\ ))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
413 val))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
414 |
17493 | 415 (defun gnus-parse-format (format spec-alist &optional insert) |
416 ;; This function parses the FORMAT string with the help of the | |
417 ;; SPEC-ALIST and returns a list that can be eval'ed to return the | |
418 ;; string. If the FORMAT string contains the specifiers %( and %) | |
419 ;; the text between them will have the mouse-face text property. | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
420 ;; If the FORMAT string contains the specifiers %[ and %], the text between |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
421 ;; them will have the balloon-help text property. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
422 (let ((case-fold-search nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
423 (if (string-match |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
424 "\\`\\(.*\\)%[0-9]?[{(«]\\(.*\\)%[0-9]?[»})]\\(.*\n?\\)\\'\\|%[-0-9]*=\\|%[-0-9]*\\*" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
425 format) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
426 (gnus-parse-complex-format format spec-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
427 ;; This is a simple format. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
428 (gnus-parse-simple-format format spec-alist insert)))) |
17493 | 429 |
430 (defun gnus-parse-complex-format (format spec-alist) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
431 (let ((cursor-spec nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
432 (save-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
433 (gnus-set-work-buffer) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
434 (insert format) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
435 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
436 (while (re-search-forward "\"" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
437 (replace-match "\\\"" nil t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
438 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
439 (insert "(\"") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
440 ;; Convert all font specs into font spec lists. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
441 (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
442 (let ((number (if (match-beginning 1) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
443 (match-string 1) "0")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
444 (delim (aref (match-string 2) 0))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
445 (if (or (= delim ?\() |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
446 (= delim ?\{) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
447 (= delim ?\«)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
448 (replace-match (concat "\"(" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
449 (cond ((= delim ?\() "mouse") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
450 ((= delim ?\{) "face") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
451 (t "balloon")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
452 " " number " \"") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
453 t t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
454 (replace-match "\")\"")))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
455 (goto-char (point-max)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
456 (insert "\")") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
457 ;; Convert point position commands. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
458 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
459 (let ((case-fold-search nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
460 (while (re-search-forward "%\\([-0-9]+\\)?\\*" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
461 (replace-match "\"(point)\"" t t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
462 (setq cursor-spec t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
463 ;; Convert TAB commands. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
464 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
465 (while (re-search-forward "%\\([-0-9]+\\)=" nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
466 (replace-match (format "\"(tab %s)\"" (match-string 1)) t t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
467 ;; Convert the buffer into the spec. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
468 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
469 (let ((form (read (current-buffer)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
470 (if cursor-spec |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
471 `(let (gnus-position) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
472 ,@(gnus-complex-form-to-spec form spec-alist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
473 (if gnus-position |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
474 (gnus-put-text-property gnus-position (1+ gnus-position) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
475 'gnus-position t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
476 `(progn |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
477 ,@(gnus-complex-form-to-spec form spec-alist))))))) |
17493 | 478 |
479 (defun gnus-complex-form-to-spec (form spec-alist) | |
480 (delq nil | |
481 (mapcar | |
482 (lambda (sform) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
483 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
484 ((stringp sform) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
485 (gnus-parse-simple-format sform spec-alist t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
486 ((eq (car sform) 'point) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
487 '(setq gnus-position (point))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
488 ((eq (car sform) 'tab) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
489 (gnus-spec-tab (cadr sform))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
490 (t |
17493 | 491 (funcall (intern (format "gnus-%s-face-function" (car sform))) |
492 (gnus-complex-form-to-spec (cddr sform) spec-alist) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
493 (nth 1 sform))))) |
17493 | 494 form))) |
495 | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
496 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
497 (defun gnus-xmas-format (fstring &rest args) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
498 "A version of `format' which preserves text properties. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
499 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
500 Required for XEmacs, where the built in `format' function strips all text |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
501 properties from both the format string and any inserted strings. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
502 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
503 Only supports the format sequence %s, and %% for inserting |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
504 literal % characters. A pad width and an optional - (to right pad) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
505 are supported for %s." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
506 (let ((re "%%\\|%\\(-\\)?\\([1-9][0-9]*\\)?s") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
507 (n (length args))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
508 (with-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
509 (insert fstring) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
510 (goto-char (point-min)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
511 (while (re-search-forward re nil t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
512 (goto-char (match-end 0)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
513 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
514 ((string= (match-string 0) "%%") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
515 (delete-char -1)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
516 (t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
517 (if (null args) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
518 (error 'wrong-number-of-arguments #'my-format n fstring)) |
62907
88db2adda4b7
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-339
Miles Bader <miles@gnu.org>
parents:
61424
diff
changeset
|
519 (let* ((minlen (string-to-number (or (match-string 2) ""))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
520 (arg (car args)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
521 (str (if (stringp arg) arg (format "%s" arg))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
522 (lpad (null (match-string 1))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
523 (padlen (max 0 (- minlen (length str))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
524 (replace-match "") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
525 (if lpad (insert-char ?\ padlen)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
526 (insert str) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
527 (unless lpad (insert-char ?\ padlen)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
528 (setq args (cdr args)))))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
529 (buffer-string)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
530 |
17493 | 531 (defun gnus-parse-simple-format (format spec-alist &optional insert) |
532 ;; This function parses the FORMAT string with the help of the | |
533 ;; SPEC-ALIST and returns a list that can be eval'ed to return a | |
534 ;; string. | |
535 (let ((max-width 0) | |
536 spec flist fstring elem result dontinsert user-defined | |
537 type value pad-width spec-beg cut-width ignore-value | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
538 tilde-form tilde elem-type extended-spec) |
17493 | 539 (save-excursion |
540 (gnus-set-work-buffer) | |
541 (insert format) | |
542 (goto-char (point-min)) | |
543 (while (re-search-forward "%" nil t) | |
544 (setq user-defined nil | |
545 spec-beg nil | |
546 pad-width nil | |
547 max-width nil | |
548 cut-width nil | |
549 ignore-value nil | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
550 tilde-form nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
551 extended-spec nil) |
17493 | 552 (setq spec-beg (1- (point))) |
553 | |
554 ;; Parse this spec fully. | |
555 (while | |
556 (cond | |
557 ((looking-at "\\([-.0-9]+\\)\\(,[-0-9]+\\)?") | |
558 (setq pad-width (string-to-number (match-string 1))) | |
559 (when (match-beginning 2) | |
560 (setq max-width (string-to-number (buffer-substring | |
561 (1+ (match-beginning 2)) | |
562 (match-end 2))))) | |
563 (goto-char (match-end 0))) | |
564 ((looking-at "~") | |
565 (forward-char 1) | |
566 (setq tilde (read (current-buffer)) | |
567 type (car tilde) | |
568 value (cadr tilde)) | |
569 (cond | |
570 ((memq type '(pad pad-left)) | |
571 (setq pad-width value)) | |
572 ((eq type 'pad-right) | |
573 (setq pad-width (- value))) | |
574 ((memq type '(max-right max)) | |
575 (setq max-width value)) | |
576 ((eq type 'max-left) | |
577 (setq max-width (- value))) | |
578 ((memq type '(cut cut-left)) | |
579 (setq cut-width value)) | |
580 ((eq type 'cut-right) | |
581 (setq cut-width (- value))) | |
582 ((eq type 'ignore) | |
583 (setq ignore-value | |
584 (if (stringp value) value (format "%s" value)))) | |
585 ((eq type 'form) | |
586 (setq tilde-form value)) | |
587 (t | |
588 (error "Unknown tilde type: %s" tilde))) | |
589 t) | |
590 (t | |
591 nil))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
592 (cond |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
593 ;; User-defined spec -- find the spec name. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
594 ((eq (setq spec (char-after)) ?u) |
17493 | 595 (forward-char 1) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
596 (when (and (eq (setq user-defined (char-after)) ?&) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
597 (looking-at "&\\([^;]+\\);")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
598 (setq user-defined (match-string 1)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
599 (goto-char (match-end 1)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
600 ;; extended spec |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
601 ((and (eq spec ?&) (looking-at "&\\([^;]+\\);")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
602 (setq extended-spec (intern (match-string 1))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
603 (goto-char (match-end 1)))) |
17493 | 604 (forward-char 1) |
605 (delete-region spec-beg (point)) | |
606 | |
607 ;; Now we have all the relevant data on this spec, so | |
608 ;; we start doing stuff. | |
609 (insert "%") | |
610 (if (eq spec ?%) | |
611 ;; "%%" just results in a "%". | |
612 (insert "%") | |
613 (cond | |
614 ;; Do tilde forms. | |
615 ((eq spec ?@) | |
616 (setq elem (list tilde-form ?s))) | |
617 ;; Treat user defined format specifiers specially. | |
618 (user-defined | |
619 (setq elem | |
620 (list | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
621 (list (intern (format |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
622 (if (stringp user-defined) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
623 "gnus-user-format-function-%s" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
624 "gnus-user-format-function-%c") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
625 user-defined)) |
17493 | 626 'gnus-tmp-header) |
627 ?s))) | |
628 ;; Find the specification from `spec-alist'. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
629 ((setq elem (cdr (assq (or extended-spec spec) spec-alist)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
630 ;; We used to use "%l" for displaying the grouplens score. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
631 ((eq spec ?l) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
632 (setq elem '("" ?s))) |
17493 | 633 (t |
634 (setq elem '("*" ?s)))) | |
635 (setq elem-type (cadr elem)) | |
636 ;; Insert the new format elements. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
637 (when (and pad-width |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
638 (not (and (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
639 gnus-use-correct-string-widths))) |
17493 | 640 (insert (number-to-string pad-width))) |
641 ;; Create the form to be evaled. | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
642 (if (or max-width cut-width ignore-value |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
643 (and (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
644 gnus-use-correct-string-widths)) |
17493 | 645 (progn |
646 (insert ?s) | |
647 (let ((el (car elem))) | |
648 (cond ((= (cadr elem) ?c) | |
649 (setq el (list 'char-to-string el))) | |
650 ((= (cadr elem) ?d) | |
651 (setq el (list 'int-to-string el)))) | |
652 (when ignore-value | |
653 (setq el (gnus-tilde-ignore-form el ignore-value))) | |
654 (when cut-width | |
655 (setq el (gnus-tilde-cut-form el cut-width))) | |
656 (when max-width | |
657 (setq el (gnus-tilde-max-form el max-width))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
658 (when pad-width |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
659 (setq el (gnus-pad-form el pad-width))) |
17493 | 660 (push el flist))) |
661 (insert elem-type) | |
662 (push (car elem) flist)))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
663 (setq fstring (buffer-substring-no-properties (point-min) (point-max)))) |
17493 | 664 |
665 ;; Do some postprocessing to increase efficiency. | |
666 (setq | |
667 result | |
668 (cond | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
669 ;; Emptiness. |
17493 | 670 ((string= fstring "") |
671 nil) | |
672 ;; Not a format string. | |
673 ((not (string-match "%" fstring)) | |
674 (list fstring)) | |
675 ;; A format string with just a single string spec. | |
676 ((string= fstring "%s") | |
677 (list (car flist))) | |
678 ;; A single character. | |
679 ((string= fstring "%c") | |
680 (list (car flist))) | |
681 ;; A single number. | |
682 ((string= fstring "%d") | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
683 (setq dontinsert t) |
17493 | 684 (if insert |
685 (list `(princ ,(car flist))) | |
686 (list `(int-to-string ,(car flist))))) | |
687 ;; Just lots of chars and strings. | |
688 ((string-match "\\`\\(%[cs]\\)+\\'" fstring) | |
689 (nreverse flist)) | |
690 ;; A single string spec at the beginning of the spec. | |
691 ((string-match "\\`%[sc][^%]+\\'" fstring) | |
692 (list (car flist) (substring fstring 2))) | |
693 ;; A single string spec in the middle of the spec. | |
694 ((string-match "\\`\\([^%]+\\)%[sc]\\([^%]+\\)\\'" fstring) | |
695 (list (match-string 1 fstring) (car flist) (match-string 2 fstring))) | |
696 ;; A single string spec in the end of the spec. | |
697 ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring) | |
698 (list (match-string 1 fstring) (car flist))) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
699 ;; Only string (and %) specs (XEmacs only!) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
700 ((and (featurep 'xemacs) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
701 gnus-make-format-preserve-properties |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
702 (string-match |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
703 "\\`\\([^%]*\\(%%\\|%-?\\([1-9][0-9]*\\)?s\\)\\)*[^%]*\\'" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
704 fstring)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
705 (list (cons 'gnus-xmas-format (cons fstring (nreverse flist))))) |
17493 | 706 ;; A more complex spec. |
707 (t | |
708 (list (cons 'format (cons fstring (nreverse flist))))))) | |
709 | |
710 (if insert | |
711 (when result | |
712 (if dontinsert | |
713 result | |
714 (cons 'insert result))) | |
715 (cond ((stringp result) | |
716 result) | |
717 ((consp result) | |
718 (cons 'concat result)) | |
719 (t ""))))) | |
720 | |
721 (defun gnus-eval-format (format &optional alist props) | |
722 "Eval the format variable FORMAT, using ALIST. | |
723 If PROPS, insert the result." | |
724 (let ((form (gnus-parse-format format alist props))) | |
725 (if props | |
726 (gnus-add-text-properties (point) (progn (eval form) (point)) props) | |
727 (eval form)))) | |
728 | |
729 (defun gnus-compile () | |
730 "Byte-compile the user-defined format specs." | |
731 (interactive) | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
732 (require 'bytecomp) |
17493 | 733 (let ((entries gnus-format-specs) |
734 (byte-compile-warnings '(unresolved callargs redefine)) | |
735 entry gnus-tmp-func) | |
736 (save-excursion | |
737 (gnus-message 7 "Compiling format specs...") | |
738 | |
739 (while entries | |
740 (setq entry (pop entries)) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
741 (if (memq (car entry) '(gnus-version version)) |
17493 | 742 (setq gnus-format-specs (delq entry gnus-format-specs)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
743 (let ((form (caddr entry))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
744 (when (and (listp form) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
745 ;; Under GNU Emacs, it's (byte-code ...) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
746 (not (eq 'byte-code (car form))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
747 ;; Under XEmacs, it's (funcall #<compiled-function ...>) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
748 (not (and (eq 'funcall (car form)) |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
749 (byte-code-function-p (cadr form))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
52401
diff
changeset
|
750 (defalias 'gnus-tmp-func `(lambda () ,form)) |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
751 (byte-compile 'gnus-tmp-func) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
752 (setcar (cddr entry) (gnus-byte-code 'gnus-tmp-func)))))) |
17493 | 753 |
754 (push (cons 'version emacs-version) gnus-format-specs) | |
755 ;; Mark the .newsrc.eld file as "dirty". | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
756 (gnus-dribble-touch) |
17493 | 757 (gnus-message 7 "Compiling user specs...done")))) |
758 | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
759 (defun gnus-set-format (type &optional insertable) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
760 (set (intern (format "gnus-%s-line-format-spec" type)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
761 (gnus-parse-format |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
762 (symbol-value (intern (format "gnus-%s-line-format" type))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
763 (symbol-value (intern (format "gnus-%s-line-format-alist" type))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
764 insertable))) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19521
diff
changeset
|
765 |
17493 | 766 (provide 'gnus-spec) |
767 | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
768 ;; Local Variables: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
769 ;; coding: iso-8859-1 |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
770 ;; End: |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
771 |
52401 | 772 ;;; arch-tag: a4328fa1-1f84-4b09-97ad-4b5767cfd50f |
17493 | 773 ;;; gnus-spec.el ends here |