1 ;;; gnus-spec.el --- format spec functions for Gnus
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
9 ;; This file is part of GNU Emacs.
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
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
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.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
30 (unless (fboundp 'declare-function
) (defmacro declare-function
(&rest r
))))
31 (eval-when-compile (require 'cl
))
32 (defvar gnus-newsrc-file-version
)
36 (defcustom gnus-use-correct-string-widths
(featurep 'xemacs
)
37 "*If non-nil, use correct functions for dealing with wide characters."
42 (defcustom gnus-make-format-preserve-properties
(featurep 'xemacs
)
43 "*If non-nil, use a replacement `format' function which preserves
44 text properties. This is only needed on XEmacs, as FSF Emacs does this anyway."
49 ;;; Internal variables.
51 (defvar gnus-summary-mark-positions nil
)
52 (defvar gnus-group-mark-positions nil
)
53 (defvar gnus-group-indentation
"")
55 ;; Format specs. The chunks below are the machine-generated forms
56 ;; that are to be evaled as the result of the default format strings.
57 ;; We write them in here to get them byte-compiled. That way the
58 ;; default actions will be quite fast, while still retaining the full
59 ;; flexibility of the user-defined format specs.
61 ;; First we have lots of dummy defvars to let the compiler know these
62 ;; are really dynamic variables.
64 (defvar gnus-tmp-unread
)
65 (defvar gnus-tmp-replied
)
66 (defvar gnus-tmp-score-char
)
67 (defvar gnus-tmp-indentation
)
68 (defvar gnus-tmp-opening-bracket
)
69 (defvar gnus-tmp-lines
)
70 (defvar gnus-tmp-name
)
71 (defvar gnus-tmp-closing-bracket
)
72 (defvar gnus-tmp-subject-or-nil
)
73 (defvar gnus-tmp-subject
)
74 (defvar gnus-tmp-marked
)
75 (defvar gnus-tmp-marked-mark
)
76 (defvar gnus-tmp-subscribed
)
77 (defvar gnus-tmp-process-marked
)
78 (defvar gnus-tmp-number-of-unread
)
79 (defvar gnus-tmp-group-name
)
80 (defvar gnus-tmp-group
)
81 (defvar gnus-tmp-article-number
)
82 (defvar gnus-tmp-unread-and-unselected
)
83 (defvar gnus-tmp-news-method
)
84 (defvar gnus-tmp-news-server
)
85 (defvar gnus-tmp-article-number
)
86 (defvar gnus-mouse-face
)
87 (defvar gnus-mouse-face-prop
)
88 (defvar gnus-tmp-header
)
89 (defvar gnus-tmp-from
)
91 (declare-function gnus-summary-from-or-to-or-newsgroups
"gnus-sum"
92 (header gnus-tmp-from
))
94 (defun gnus-summary-line-format-spec ()
95 (insert gnus-tmp-unread gnus-tmp-replied
96 gnus-tmp-score-char gnus-tmp-indentation
)
97 (gnus-put-text-property
101 (format "%c%4s: %-23s%c" gnus-tmp-opening-bracket gnus-tmp-lines
104 (gnus-summary-from-or-to-or-newsgroups
105 gnus-tmp-header gnus-tmp-from
))))
106 (if (> (length val
) 23)
109 gnus-tmp-closing-bracket
))
111 gnus-mouse-face-prop gnus-mouse-face
)
112 (insert " " gnus-tmp-subject-or-nil
"\n"))
114 (defvar gnus-summary-line-format-spec
115 (gnus-byte-code 'gnus-summary-line-format-spec
))
117 (defun gnus-summary-dummy-line-format-spec ()
119 (gnus-put-text-property
124 gnus-mouse-face-prop gnus-mouse-face
)
125 (insert " " gnus-tmp-subject
"\n"))
127 (defvar gnus-summary-dummy-line-format-spec
128 (gnus-byte-code 'gnus-summary-dummy-line-format-spec
))
130 (defun gnus-group-line-format-spec ()
131 (insert gnus-tmp-marked-mark gnus-tmp-subscribed
132 gnus-tmp-process-marked
133 gnus-group-indentation
134 (format "%5s: " gnus-tmp-number-of-unread
))
135 (gnus-put-text-property
138 (insert gnus-tmp-group
"\n")
140 gnus-mouse-face-prop gnus-mouse-face
))
141 (defvar gnus-group-line-format-spec
142 (gnus-byte-code 'gnus-group-line-format-spec
))
144 (defvar gnus-format-specs
145 `((version .
,emacs-version
)
146 (gnus-version .
,(gnus-continuum-version))
147 (group "%M\%S\%p\%P\%5y: %(%g%)\n" ,gnus-group-line-format-spec
)
148 (summary-dummy "* %(: :%) %S\n"
149 ,gnus-summary-dummy-line-format-spec
)
150 (summary "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n"
151 ,gnus-summary-line-format-spec
))
152 "Alist of format specs.")
154 (defvar gnus-default-format-specs gnus-format-specs
)
156 (defvar gnus-article-mode-line-format-spec nil
)
157 (defvar gnus-summary-mode-line-format-spec nil
)
158 (defvar gnus-group-mode-line-format-spec nil
)
160 ;;; Phew. All that gruft is over with, fortunately.
163 (defun gnus-update-format (var)
164 "Update the format specification near point."
169 ;; Find the end of the current word.
170 (re-search-forward "[ \t\n]" nil t
)
172 (when (re-search-backward "\\(gnus-[-a-z]+-line-format\\)" nil t
)
174 (let* ((type (intern (progn (string-match "gnus-\\([-a-z]+\\)-line" var
)
175 (match-string 1 var
))))
176 (entry (assq type gnus-format-specs
))
179 (setq gnus-format-specs
(delq entry gnus-format-specs
)))
181 (intern (format "%s-spec" var
))
182 (gnus-parse-format (setq value
(symbol-value (intern var
)))
183 (symbol-value (intern (format "%s-alist" var
)))
184 (not (string-match "mode" var
))))
185 (setq spec
(symbol-value (intern (format "%s-spec" var
))))
186 (push (list type value spec
) gnus-format-specs
)
188 (pop-to-buffer "*Gnus Format*")
190 (lisp-interaction-mode)
191 (insert (gnus-pp-to-string spec
))))
193 (defun gnus-update-format-specifications (&optional force
&rest types
)
194 "Update all (necessary) format specifications.
195 Return a list of updated types."
196 ;; Make the indentation array.
197 ;; See whether all the stored info needs to be flushed.
199 (not gnus-newsrc-file-version
)
200 (not (equal (gnus-continuum-version)
201 (gnus-continuum-version gnus-newsrc-file-version
)))
202 (not (equal emacs-version
203 (cdr (assq 'version gnus-format-specs
)))))
204 (setq gnus-format-specs nil
))
205 ;; Flush the group format spec cache if there's the grouplens stuff
206 ;; or it doesn't support decoded group names.
207 (when (memq 'group types
)
208 (let* ((spec (assq 'group gnus-format-specs
))
209 (sspec (gnus-prin1-to-string (nth 2 spec
))))
210 (when (or (string-match " gnus-tmp-grouplens[ )]" sspec
)
211 (not (string-match " gnus-tmp-decoded-group[ )]" sspec
)))
212 (setq gnus-format-specs
(delq spec gnus-format-specs
)))))
214 ;; Go through all the formats and see whether they need updating.
215 (let (new-format entry type val updated
)
216 (while (setq type
(pop types
))
217 ;; Jump to the proper buffer to find out the value of the
218 ;; variable, if possible. (It may be buffer-local.)
220 (let ((buffer (intern (format "gnus-%s-buffer" type
))))
221 (when (and (boundp buffer
)
222 (setq val
(symbol-value buffer
))
223 (gnus-buffer-exists-p val
))
225 (setq new-format
(symbol-value
226 (intern (format "gnus-%s-line-format" type
)))))
227 (setq entry
(cdr (assq type gnus-format-specs
)))
229 (equal (car entry
) new-format
))
230 ;; Use the old format.
231 (set (intern (format "gnus-%s-line-format-spec" type
))
233 ;; This is a new format.
235 (if (not (stringp new-format
))
236 ;; This is a function call or something.
238 ;; This is a "real" format.
242 (intern (format "gnus-%s-line-format-alist" type
)))
243 (not (string-match "mode$" (symbol-name type
))))))
244 ;; Enter the new format spec into the list.
247 (setcar (cdr entry
) val
)
248 (setcar entry new-format
))
249 (push (list type new-format val
) gnus-format-specs
))
250 (set (intern (format "gnus-%s-line-format-spec" type
)) val
)
251 (push type updated
))))
253 (unless (assq 'version gnus-format-specs
)
254 (push (cons 'version emacs-version
) gnus-format-specs
))
257 (defvar gnus-mouse-face-0
'highlight
)
258 (defvar gnus-mouse-face-1
'highlight
)
259 (defvar gnus-mouse-face-2
'highlight
)
260 (defvar gnus-mouse-face-3
'highlight
)
261 (defvar gnus-mouse-face-4
'highlight
)
263 (defun gnus-mouse-face-function (form type
)
264 `(gnus-put-text-property
265 (point) (progn ,@form
(point))
269 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type
)))))))
271 (defvar gnus-face-0
'bold
)
272 (defvar gnus-face-1
'italic
)
273 (defvar gnus-face-2
'bold-italic
)
274 (defvar gnus-face-3
'bold
)
275 (defvar gnus-face-4
'bold
)
277 (defun gnus-face-face-function (form type
)
278 `(gnus-add-text-properties
279 (point) (progn ,@form
(point))
280 '(gnus-face t face
,(symbol-value (intern (format "gnus-face-%d" type
))))))
282 (defun gnus-balloon-face-function (form type
)
283 `(gnus-put-text-property
284 (point) (progn ,@form
(point))
285 ,(if (fboundp 'balloon-help-mode
)
288 ,(intern (format "gnus-balloon-face-%d" type
))))
290 (defun gnus-spec-tab (column)
292 `(insert-char ?
(max (- ,column
(current-column)) 0))
293 (let ((column (abs column
)))
294 `(if (> (current-column) ,column
)
296 (if (= (move-to-column ,column
) ,column
)
297 (delete-region (point) end
)
298 (delete-region (1- (point)) end
)
300 (insert-char ?
(max (- ,column
(current-column)) 0))))))
302 (defun gnus-correct-length (string)
303 "Return the correct width of STRING."
304 (apply #'+ (mapcar #'char-width string
)))
306 (defun gnus-correct-substring (string start
&optional end
)
311 (length (length string
))
312 (string (concat string
"\0")))
313 ;; Find the start position.
314 (while (and (< seek length
)
316 (incf wseek
(char-width (aref string seek
)))
319 ;; Find the end position.
320 (while (and (<= seek length
)
323 (incf wseek
(char-width (aref string seek
)))
326 (substring string wstart
(1- wend
))))
328 (defun gnus-string-width-function ()
330 (gnus-use-correct-string-widths
331 'gnus-correct-length
)
332 ((fboundp 'string-width
)
337 (defun gnus-substring-function ()
339 (gnus-use-correct-string-widths
340 'gnus-correct-substring
)
341 ((fboundp 'string-width
)
342 'gnus-correct-substring
)
346 (defun gnus-tilde-max-form (el max-width
)
347 "Return a form that limits EL to MAX-WIDTH."
348 (let ((max (abs max-width
))
349 (length-fun (gnus-string-width-function))
350 (substring-fun (gnus-substring-function)))
352 `(if (> (,length-fun
,el
) ,max
)
354 `(,substring-fun
,el
(- (,length-fun
,el
) ,max
))
355 `(,substring-fun
,el
0 ,max
))
357 `(let ((val (eval ,el
)))
358 (if (> (,length-fun val
) ,max
)
360 `(,substring-fun val
(- (,length-fun val
) ,max
))
361 `(,substring-fun val
0 ,max
))
364 (defun gnus-tilde-cut-form (el cut-width
)
365 "Return a form that cuts CUT-WIDTH off of EL."
366 (let ((cut (abs cut-width
))
367 (length-fun (gnus-string-width-function))
368 (substring-fun (gnus-substring-function)))
370 `(if (> (,length-fun
,el
) ,cut
)
372 `(,substring-fun
,el
0 (- (,length-fun
,el
) ,cut
))
373 `(,substring-fun
,el
,cut
))
375 `(let ((val (eval ,el
)))
376 (if (> (,length-fun val
) ,cut
)
378 `(,substring-fun val
0 (- (,length-fun val
) ,cut
))
379 `(,substring-fun val
,cut
))
382 (defun gnus-tilde-ignore-form (el ignore-value
)
383 "Return a form that is blank when EL is IGNORE-VALUE."
385 `(if (equal ,el
,ignore-value
)
387 `(let ((val (eval ,el
)))
388 (if (equal val
,ignore-value
)
391 (defun gnus-pad-form (el pad-width
)
392 "Return a form that pads EL to PAD-WIDTH accounting for multi-column
393 characters correctly. This is because `format' may pad to columns or to
394 characters when given a pad value."
395 (let ((pad (abs pad-width
))
396 (side (< 0 pad-width
))
397 (length-fun (gnus-string-width-function)))
399 `(let ((need (- ,pad
(,length-fun
,el
))))
401 (concat ,(when side
'(make-string need ?\
))
403 ,(when (not side
) '(make-string need ?\
)))
405 `(let* ((val (eval ,el
))
406 (need (- ,pad
(,length-fun val
))))
408 (concat ,(when side
'(make-string need ?\
))
410 ,(when (not side
) '(make-string need ?\
)))
413 (defun gnus-parse-format (format spec-alist
&optional insert
)
414 ;; This function parses the FORMAT string with the help of the
415 ;; SPEC-ALIST and returns a list that can be eval'ed to return the
416 ;; string. If the FORMAT string contains the specifiers %( and %)
417 ;; the text between them will have the mouse-face text property.
418 ;; If the FORMAT string contains the specifiers %[ and %], the text between
419 ;; them will have the balloon-help text property.
420 (let ((case-fold-search nil
))
422 "\\`\\(.*\\)%[0-9]?[{(«]\\(.*\\)%[0-9]?[»})]\\(.*\n?\\)\\'\\|%[-0-9]*=\\|%[-0-9]*\\*"
424 (gnus-parse-complex-format format spec-alist
)
425 ;; This is a simple format.
426 (gnus-parse-simple-format format spec-alist insert
))))
428 (defun gnus-parse-complex-format (format spec-alist
)
429 (let ((cursor-spec nil
))
431 (gnus-set-work-buffer)
433 (goto-char (point-min))
434 (while (re-search-forward "\"" nil t
)
435 (replace-match "\\\"" nil t
))
436 (goto-char (point-min))
438 ;; Convert all font specs into font spec lists.
439 (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t
)
440 (let ((number (if (match-beginning 1)
441 (match-string 1) "0"))
442 (delim (aref (match-string 2) 0)))
443 (if (or (= delim ?\
()
446 (replace-match (concat "\"("
447 (cond ((= delim ?\
() "mouse")
448 ((= delim ?\
{) "face")
452 (replace-match "\")\""))))
453 (goto-char (point-max))
455 ;; Convert point position commands.
456 (goto-char (point-min))
457 (let ((case-fold-search nil
))
458 (while (re-search-forward "%\\([-0-9]+\\)?\\*" nil t
)
459 (replace-match "\"(point)\"" t t
)
460 (setq cursor-spec t
)))
461 ;; Convert TAB commands.
462 (goto-char (point-min))
463 (while (re-search-forward "%\\([-0-9]+\\)=" nil t
)
464 (replace-match (format "\"(tab %s)\"" (match-string 1)) t t
))
465 ;; Convert the buffer into the spec.
466 (goto-char (point-min))
467 (let ((form (read (current-buffer))))
469 `(let (gnus-position)
470 ,@(gnus-complex-form-to-spec form spec-alist
)
472 (gnus-put-text-property gnus-position
(1+ gnus-position
)
475 ,@(gnus-complex-form-to-spec form spec-alist
)))))))
477 (defun gnus-complex-form-to-spec (form spec-alist
)
483 (gnus-parse-simple-format sform spec-alist t
))
484 ((eq (car sform
) 'point
)
485 '(setq gnus-position
(point)))
486 ((eq (car sform
) 'tab
)
487 (gnus-spec-tab (cadr sform
)))
489 (funcall (intern (format "gnus-%s-face-function" (car sform
)))
490 (gnus-complex-form-to-spec (cddr sform
) spec-alist
)
495 (defun gnus-xmas-format (fstring &rest args
)
496 "A version of `format' which preserves text properties.
498 Required for XEmacs, where the built in `format' function strips all text
499 properties from both the format string and any inserted strings.
501 Only supports the format sequence %s, and %% for inserting
502 literal % characters. A pad width and an optional - (to right pad)
503 are supported for %s."
504 (let ((re "%%\\|%\\(-\\)?\\([1-9][0-9]*\\)?s")
508 (goto-char (point-min))
509 (while (re-search-forward re nil t
)
510 (goto-char (match-end 0))
512 ((string= (match-string 0) "%%")
516 (error 'wrong-number-of-arguments
#'my-format n fstring
))
517 (let* ((minlen (string-to-number (or (match-string 2) "")))
519 (str (if (stringp arg
) arg
(format "%s" arg
)))
520 (lpad (null (match-string 1)))
521 (padlen (max 0 (- minlen
(length str
)))))
523 (if lpad
(insert-char ?\ padlen
))
525 (unless lpad
(insert-char ?\ padlen
))
526 (setq args
(cdr args
))))))
529 (defun gnus-parse-simple-format (format spec-alist
&optional insert
)
530 ;; This function parses the FORMAT string with the help of the
531 ;; SPEC-ALIST and returns a list that can be eval'ed to return a
534 spec flist fstring elem result dontinsert user-defined
535 type value pad-width spec-beg cut-width ignore-value
536 tilde-form tilde elem-type extended-spec
)
538 (gnus-set-work-buffer)
540 (goto-char (point-min))
541 (while (re-search-forward "%" nil t
)
542 (setq user-defined nil
550 (setq spec-beg
(1- (point)))
552 ;; Parse this spec fully.
555 ((looking-at "\\([-.0-9]+\\)\\(,[-0-9]+\\)?")
556 (setq pad-width
(string-to-number (match-string 1)))
557 (when (match-beginning 2)
558 (setq max-width
(string-to-number (buffer-substring
559 (1+ (match-beginning 2))
561 (goto-char (match-end 0)))
564 (setq tilde
(read (current-buffer))
568 ((memq type
'(pad pad-left
))
569 (setq pad-width value
))
570 ((eq type
'pad-right
)
571 (setq pad-width
(- value
)))
572 ((memq type
'(max-right max
))
573 (setq max-width value
))
575 (setq max-width
(- value
)))
576 ((memq type
'(cut cut-left
))
577 (setq cut-width value
))
578 ((eq type
'cut-right
)
579 (setq cut-width
(- value
)))
582 (if (stringp value
) value
(format "%s" value
))))
584 (setq tilde-form value
))
586 (error "Unknown tilde type: %s" tilde
)))
591 ;; User-defined spec -- find the spec name.
592 ((eq (setq spec
(char-after)) ?u
)
594 (when (and (eq (setq user-defined
(char-after)) ?
&)
595 (looking-at "&\\([^;]+\\);"))
596 (setq user-defined
(match-string 1))
597 (goto-char (match-end 1))))
599 ((and (eq spec ?
&) (looking-at "&\\([^;]+\\);"))
600 (setq extended-spec
(intern (match-string 1)))
601 (goto-char (match-end 1))))
603 (delete-region spec-beg
(point))
605 ;; Now we have all the relevant data on this spec, so
606 ;; we start doing stuff.
609 ;; "%%" just results in a "%".
614 (setq elem
(list tilde-form ?s
)))
615 ;; Treat user defined format specifiers specially.
619 (list (intern (format
620 (if (stringp user-defined
)
621 "gnus-user-format-function-%s"
622 "gnus-user-format-function-%c")
626 ;; Find the specification from `spec-alist'.
627 ((setq elem
(cdr (assq (or extended-spec spec
) spec-alist
))))
628 ;; We used to use "%l" for displaying the grouplens score.
630 (setq elem
'("" ?s
)))
632 (setq elem
'("*" ?s
))))
633 (setq elem-type
(cadr elem
))
634 ;; Insert the new format elements.
636 (not (and (featurep 'xemacs
)
637 gnus-use-correct-string-widths
)))
638 (insert (number-to-string pad-width
)))
639 ;; Create the form to be evaled.
640 (if (or max-width cut-width ignore-value
641 (and (featurep 'xemacs
)
642 gnus-use-correct-string-widths
))
645 (let ((el (car elem
)))
646 (cond ((= (cadr elem
) ?c
)
647 (setq el
(list 'char-to-string el
)))
649 (setq el
(list 'int-to-string el
))))
651 (setq el
(gnus-tilde-ignore-form el ignore-value
)))
653 (setq el
(gnus-tilde-cut-form el cut-width
)))
655 (setq el
(gnus-tilde-max-form el max-width
)))
657 (setq el
(gnus-pad-form el pad-width
)))
660 (push (car elem
) flist
))))
661 (setq fstring
(buffer-substring-no-properties (point-min) (point-max))))
663 ;; Do some postprocessing to increase efficiency.
668 ((string= fstring
"")
670 ;; Not a format string.
671 ((not (string-match "%" fstring
))
673 ;; A format string with just a single string spec.
674 ((string= fstring
"%s")
676 ;; A single character.
677 ((string= fstring
"%c")
680 ((string= fstring
"%d")
683 (list `(princ ,(car flist
)))
684 (list `(int-to-string ,(car flist
)))))
685 ;; Just lots of chars and strings.
686 ((string-match "\\`\\(%[cs]\\)+\\'" fstring
)
688 ;; A single string spec at the beginning of the spec.
689 ((string-match "\\`%[sc][^%]+\\'" fstring
)
690 (list (car flist
) (substring fstring
2)))
691 ;; A single string spec in the middle of the spec.
692 ((string-match "\\`\\([^%]+\\)%[sc]\\([^%]+\\)\\'" fstring
)
693 (list (match-string 1 fstring
) (car flist
) (match-string 2 fstring
)))
694 ;; A single string spec in the end of the spec.
695 ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring
)
696 (list (match-string 1 fstring
) (car flist
)))
697 ;; Only string (and %) specs (XEmacs only!)
698 ((and (featurep 'xemacs
)
699 gnus-make-format-preserve-properties
701 "\\`\\([^%]*\\(%%\\|%-?\\([1-9][0-9]*\\)?s\\)\\)*[^%]*\\'"
703 (list (cons 'gnus-xmas-format
(cons fstring
(nreverse flist
)))))
704 ;; A more complex spec.
706 (list (cons 'format
(cons fstring
(nreverse flist
)))))))
712 (cons 'insert result
)))
713 (cond ((stringp result
)
716 (cons 'concat result
))
719 (defun gnus-eval-format (format &optional alist props
)
720 "Eval the format variable FORMAT, using ALIST.
721 If PROPS, insert the result."
722 (let ((form (gnus-parse-format format alist props
)))
724 (gnus-add-text-properties (point) (progn (eval form
) (point)) props
)
727 (defun gnus-compile ()
728 "Byte-compile the user-defined format specs."
731 (let ((entries gnus-format-specs
)
732 (byte-compile-warnings '(unresolved callargs redefine
))
735 (gnus-message 7 "Compiling format specs...")
738 (setq entry
(pop entries
))
739 (if (memq (car entry
) '(gnus-version version
))
740 (setq gnus-format-specs
(delq entry gnus-format-specs
))
741 (let ((form (caddr entry
)))
742 (when (and (listp form
)
743 ;; Under GNU Emacs, it's (byte-code ...)
744 (not (eq 'byte-code
(car form
)))
745 ;; Under XEmacs, it's (funcall #<compiled-function ...>)
746 (not (and (eq 'funcall
(car form
))
747 (byte-code-function-p (cadr form
)))))
748 (defalias 'gnus-tmp-func
`(lambda () ,form
))
749 (byte-compile 'gnus-tmp-func
)
750 (setcar (cddr entry
) (gnus-byte-code 'gnus-tmp-func
))))))
752 (push (cons 'version emacs-version
) gnus-format-specs
)
753 ;; Mark the .newsrc.eld file as "dirty".
755 (gnus-message 7 "Compiling user specs...done"))))
757 (defun gnus-set-format (type &optional insertable
)
758 (set (intern (format "gnus-%s-line-format-spec" type
))
760 (symbol-value (intern (format "gnus-%s-line-format" type
)))
761 (symbol-value (intern (format "gnus-%s-line-format-alist" type
)))
767 ;; coding: iso-8859-1
770 ;; arch-tag: a4328fa1-1f84-4b09-97ad-4b5767cfd50f
771 ;;; gnus-spec.el ends here