1 ;;; gnus-spec.el --- format spec functions for Gnus
3 ;; Copyright (C) 1996-2012 Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
27 ;; For Emacs <22.2 and XEmacs.
29 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
30 (eval-when-compile (require 'cl))
31 (defvar gnus-newsrc-file-version)
35 (defcustom gnus-use-correct-string-widths (featurep 'xemacs)
36 "*If non-nil, use correct functions for dealing with wide characters."
41 (defcustom gnus-make-format-preserve-properties (featurep 'xemacs)
42 "*If non-nil, use a replacement `format' function which preserves
43 text properties. This is only needed on XEmacs, as Emacs does this anyway."
48 ;;; Internal variables.
50 (defvar gnus-summary-mark-positions nil)
51 (defvar gnus-group-mark-positions nil)
52 (defvar gnus-group-indentation "")
54 ;; Format specs. The chunks below are the machine-generated forms
55 ;; that are to be evalled as the result of the default format strings.
56 ;; We write them in here to get them byte-compiled. That way the
57 ;; default actions will be quite fast, while still retaining the full
58 ;; flexibility of the user-defined format specs.
60 ;; First we have lots of dummy defvars to let the compiler know these
61 ;; are really dynamic variables.
63 (defvar gnus-tmp-unread)
64 (defvar gnus-tmp-replied)
65 (defvar gnus-tmp-score-char)
66 (defvar gnus-tmp-indentation)
67 (defvar gnus-tmp-opening-bracket)
68 (defvar gnus-tmp-lines)
69 (defvar gnus-tmp-name)
70 (defvar gnus-tmp-closing-bracket)
71 (defvar gnus-tmp-subject-or-nil)
72 (defvar gnus-tmp-subject)
73 (defvar gnus-tmp-marked)
74 (defvar gnus-tmp-marked-mark)
75 (defvar gnus-tmp-subscribed)
76 (defvar gnus-tmp-process-marked)
77 (defvar gnus-tmp-number-of-unread)
78 (defvar gnus-tmp-group-name)
79 (defvar gnus-tmp-group)
80 (defvar gnus-tmp-article-number)
81 (defvar gnus-tmp-unread-and-unselected)
82 (defvar gnus-tmp-news-method)
83 (defvar gnus-tmp-news-server)
84 (defvar gnus-tmp-article-number)
85 (defvar gnus-mouse-face)
86 (defvar gnus-mouse-face-prop)
87 (defvar gnus-tmp-header)
88 (defvar gnus-tmp-from)
90 (declare-function gnus-summary-from-or-to-or-newsgroups "gnus-sum"
91 (header gnus-tmp-from))
93 (defmacro gnus-lrm-string-p (string)
94 (if (fboundp 'bidi-string-mark-left-to-right)
95 ;; LRM, RLM, PDF characters as integers to avoid breaking Emacs
97 `(memq (aref ,string (1- (length ,string))) '(8206 8207 8236))
100 (defvar gnus-lrm-string (if (ignore-errors (string 8206))
101 (propertize (string 8206) 'invisible t)
104 (defun gnus-summary-line-format-spec ()
105 (insert gnus-tmp-unread gnus-tmp-replied
106 gnus-tmp-score-char gnus-tmp-indentation)
107 (gnus-put-text-property
111 (format "%c%4s: %-23s%c" gnus-tmp-opening-bracket gnus-tmp-lines
114 (gnus-summary-from-or-to-or-newsgroups
115 gnus-tmp-header gnus-tmp-from))))
116 (if (> (length val) 23)
117 (if (gnus-lrm-string-p val)
118 (concat (substring val 0 23) gnus-lrm-string)
119 (substring val 0 23))
121 gnus-tmp-closing-bracket))
123 gnus-mouse-face-prop gnus-mouse-face)
124 (insert " " gnus-tmp-subject-or-nil "\n"))
126 (defvar gnus-summary-line-format-spec
127 (gnus-byte-code 'gnus-summary-line-format-spec))
129 (defun gnus-summary-dummy-line-format-spec ()
131 (gnus-put-text-property
136 gnus-mouse-face-prop gnus-mouse-face)
137 (insert " " gnus-tmp-subject "\n"))
139 (defvar gnus-summary-dummy-line-format-spec
140 (gnus-byte-code 'gnus-summary-dummy-line-format-spec))
142 (defun gnus-group-line-format-spec ()
143 (insert gnus-tmp-marked-mark gnus-tmp-subscribed
144 gnus-tmp-process-marked
145 gnus-group-indentation
146 (format "%5s: " gnus-tmp-number-of-unread))
147 (gnus-put-text-property
150 (insert gnus-tmp-group "\n")
152 gnus-mouse-face-prop gnus-mouse-face))
153 (defvar gnus-group-line-format-spec
154 (gnus-byte-code 'gnus-group-line-format-spec))
156 (defvar gnus-format-specs
157 `((version . ,emacs-version)
158 (gnus-version . ,(gnus-continuum-version))
159 (group "%M\%S\%p\%P\%5y: %(%g%)\n" ,gnus-group-line-format-spec)
160 (summary-dummy "* %(: :%) %S\n"
161 ,gnus-summary-dummy-line-format-spec)
162 (summary "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n"
163 ,gnus-summary-line-format-spec))
164 "Alist of format specs.")
166 (defvar gnus-default-format-specs gnus-format-specs)
168 (defvar gnus-article-mode-line-format-spec nil)
169 (defvar gnus-summary-mode-line-format-spec nil)
170 (defvar gnus-group-mode-line-format-spec nil)
172 ;;; Phew. All that gruft is over with, fortunately.
175 (defun gnus-update-format (var)
176 "Update the format specification near point."
181 ;; Find the end of the current word.
182 (re-search-forward "[ \t\n]" nil t)
184 (when (re-search-backward "\\(gnus-[-a-z]+-line-format\\)" nil t)
186 (let* ((type (intern (progn (string-match "gnus-\\([-a-z]+\\)-line" var)
187 (match-string 1 var))))
188 (entry (assq type gnus-format-specs))
191 (setq gnus-format-specs (delq entry gnus-format-specs)))
193 (intern (format "%s-spec" var))
194 (gnus-parse-format (setq value (symbol-value (intern var)))
195 (symbol-value (intern (format "%s-alist" var)))
196 (not (string-match "mode" var))))
197 (setq spec (symbol-value (intern (format "%s-spec" var))))
198 (push (list type value spec) gnus-format-specs)
200 (pop-to-buffer "*Gnus Format*")
202 (lisp-interaction-mode)
203 (insert (gnus-pp-to-string spec))))
205 (defun gnus-update-format-specifications (&optional force &rest types)
206 "Update all (necessary) format specifications.
207 Return a list of updated types."
208 ;; Make the indentation array.
209 ;; See whether all the stored info needs to be flushed.
211 (not gnus-newsrc-file-version)
212 (not (equal (gnus-continuum-version)
213 (gnus-continuum-version gnus-newsrc-file-version)))
214 (not (equal emacs-version
215 (cdr (assq 'version gnus-format-specs)))))
216 (setq gnus-format-specs nil))
217 ;; Go through all the formats and see whether they need updating.
218 (let (new-format entry type val updated)
219 (while (setq type (pop types))
220 ;; Jump to the proper buffer to find out the value of the
221 ;; variable, if possible. (It may be buffer-local.)
223 (let ((buffer (intern (format "gnus-%s-buffer" type))))
224 (when (and (boundp buffer)
225 (setq val (symbol-value buffer))
226 (gnus-buffer-exists-p val))
228 (setq new-format (symbol-value
229 (intern (format "gnus-%s-line-format" type)))))
230 (setq entry (cdr (assq type gnus-format-specs)))
232 (equal (car entry) new-format))
233 ;; Use the old format.
234 (set (intern (format "gnus-%s-line-format-spec" type))
236 ;; This is a new format.
238 (if (not (stringp new-format))
239 ;; This is a function call or something.
241 ;; This is a "real" format.
245 (intern (format "gnus-%s-line-format-alist" type)))
246 (not (string-match "mode$" (symbol-name type))))))
247 ;; Enter the new format spec into the list.
250 (setcar (cdr entry) val)
251 (setcar entry new-format))
252 (push (list type new-format val) gnus-format-specs))
253 (set (intern (format "gnus-%s-line-format-spec" type)) val)
254 (push type updated))))
256 (unless (assq 'version gnus-format-specs)
257 (push (cons 'version emacs-version) gnus-format-specs))
260 (defcustom gnus-mouse-face-0 'highlight
261 "The \"%(hello%)\" face."
265 (defcustom gnus-mouse-face-1 'highlight
266 "The \"%1(hello%)\" face."
270 (defcustom gnus-mouse-face-2 'highlight
271 "The \"%2(hello%)\" face."
275 (defcustom gnus-mouse-face-3 'highlight
276 "The \"%3(hello%)\" face."
280 (defcustom gnus-mouse-face-4 'highlight
281 "The \"%4(hello%)\" face."
285 (defun gnus-mouse-face-function (form type)
286 `(gnus-put-text-property
287 (point) (progn ,@form (point))
291 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type)))))))
293 (defcustom gnus-face-0 'bold
294 "The \"%{hello%}\" face."
298 (defcustom gnus-face-1 'italic
299 "The \"%1{hello%}\" face."
303 (defcustom gnus-face-2 'bold-italic
304 "The \"%2{hello%}\" face."
308 (defcustom gnus-face-3 'bold
309 "The \"%3{hello%}\" face."
313 (defcustom gnus-face-4 'bold
314 "The \"%4{hello%}\" face."
318 (defun gnus-face-face-function (form type)
319 `(gnus-add-text-properties
320 (point) (progn ,@form (point))
321 '(gnus-face t face ,(symbol-value (intern (format "gnus-face-%d" type))))))
323 (defun gnus-balloon-face-function (form type)
324 `(gnus-put-text-property
325 (point) (progn ,@form (point))
326 ,(if (fboundp 'balloon-help-mode)
329 ,(intern (format "gnus-balloon-face-%d" type))))
331 (defun gnus-spec-tab (column)
333 `(insert-char ? (max (- ,column (current-column)) 0))
334 (let ((column (abs column)))
335 `(if (> (current-column) ,column)
337 (if (= (move-to-column ,column) ,column)
338 (delete-region (point) end)
339 (delete-region (1- (point)) end)
341 (insert-char ? (max (- ,column (current-column)) 0))))))
343 (defun gnus-correct-length (string)
344 "Return the correct width of STRING."
345 (apply #'+ (mapcar #'char-width string)))
347 (defun gnus-correct-substring (string start &optional end)
352 (length (length string))
353 (string (concat string "\0")))
354 ;; Find the start position.
355 (while (and (< seek length)
357 (incf wseek (char-width (aref string seek)))
360 ;; Find the end position.
361 (while (and (<= seek length)
364 (incf wseek (char-width (aref string seek)))
367 (substring string wstart (1- wend))))
369 (defun gnus-string-width-function ()
371 (gnus-use-correct-string-widths
372 'gnus-correct-length)
373 ((fboundp 'string-width)
378 (defun gnus-substring-function ()
380 (gnus-use-correct-string-widths
381 'gnus-correct-substring)
382 ((fboundp 'string-width)
383 'gnus-correct-substring)
387 (defun gnus-tilde-max-form (el max-width)
388 "Return a form that limits EL to MAX-WIDTH."
389 (let ((max (abs max-width))
390 (length-fun (gnus-string-width-function))
391 (substring-fun (gnus-substring-function)))
393 `(if (> (,length-fun ,el) ,max)
395 `(,substring-fun ,el (- (,length-fun ,el) ,max))
396 `(if (gnus-lrm-string-p ,el)
397 (concat (,substring-fun ,el 0 ,max) ,gnus-lrm-string)
398 (,substring-fun ,el 0 ,max)))
400 `(let ((val (eval ,el)))
401 (if (> (,length-fun val) ,max)
403 `(,substring-fun val (- (,length-fun val) ,max))
404 `(if (gnus-lrm-string-p val)
405 (concat (,substring-fun val 0 ,max) ,gnus-lrm-string)
406 (,substring-fun val 0 ,max)))
409 (defun gnus-tilde-cut-form (el cut-width)
410 "Return a form that cuts CUT-WIDTH off of EL."
411 (let ((cut (abs cut-width))
412 (length-fun (gnus-string-width-function))
413 (substring-fun (gnus-substring-function)))
415 `(if (> (,length-fun ,el) ,cut)
417 `(,substring-fun ,el 0 (- (,length-fun ,el) ,cut))
418 `(,substring-fun ,el ,cut))
420 `(let ((val (eval ,el)))
421 (if (> (,length-fun val) ,cut)
423 `(,substring-fun val 0 (- (,length-fun val) ,cut))
424 `(,substring-fun val ,cut))
427 (defun gnus-tilde-ignore-form (el ignore-value)
428 "Return a form that is blank when EL is IGNORE-VALUE."
430 `(if (equal ,el ,ignore-value)
432 `(let ((val (eval ,el)))
433 (if (equal val ,ignore-value)
436 (defun gnus-pad-form (el pad-width)
437 "Return a form that pads EL to PAD-WIDTH accounting for multi-column
438 characters correctly. This is because `format' may pad to columns or to
439 characters when given a pad value."
440 (let ((pad (abs pad-width))
441 (side (< 0 pad-width))
442 (length-fun (gnus-string-width-function)))
444 `(let ((need (- ,pad (,length-fun ,el))))
446 (concat ,(when side '(make-string need ?\ ))
448 ,(when (not side) '(make-string need ?\ )))
450 `(let* ((val (eval ,el))
451 (need (- ,pad (,length-fun val))))
453 (concat ,(when side '(make-string need ?\ ))
455 ,(when (not side) '(make-string need ?\ )))
458 (defun gnus-parse-format (format spec-alist &optional insert)
459 ;; This function parses the FORMAT string with the help of the
460 ;; SPEC-ALIST and returns a list that can be eval'ed to return the
461 ;; string. If the FORMAT string contains the specifiers %( and %)
462 ;; the text between them will have the mouse-face text property.
463 ;; If the FORMAT string contains the specifiers %[ and %], the text between
464 ;; them will have the balloon-help text property.
465 (let ((case-fold-search nil))
467 "\\`\\(.*\\)%[0-9]?[{(«]\\(.*\\)%[0-9]?[»})]\\(.*\n?\\)\\'\\|%[-0-9]*=\\|%[-0-9]*\\*"
469 (gnus-parse-complex-format format spec-alist)
470 ;; This is a simple format.
471 (gnus-parse-simple-format format spec-alist insert))))
473 (defun gnus-parse-complex-format (format spec-alist)
474 (let ((cursor-spec nil))
476 (gnus-set-work-buffer)
478 (goto-char (point-min))
479 (while (re-search-forward "\"" nil t)
480 (replace-match "\\\"" nil t))
481 (goto-char (point-min))
483 ;; Convert all font specs into font spec lists.
484 (while (re-search-forward "%\\([0-9]+\\)?\\([«»{}()]\\)" nil t)
485 (let ((number (if (match-beginning 1)
486 (match-string 1) "0"))
487 (delim (aref (match-string 2) 0)))
488 (if (or (= delim ?\()
491 (replace-match (concat "\"("
492 (cond ((= delim ?\() "mouse")
493 ((= delim ?\{) "face")
497 (replace-match "\")\""))))
498 (goto-char (point-max))
500 ;; Convert point position commands.
501 (goto-char (point-min))
502 (let ((case-fold-search nil))
503 (while (re-search-forward "%\\([-0-9]+\\)?\\*" nil t)
504 (replace-match "\"(point)\"" t t)
505 (setq cursor-spec t)))
506 ;; Convert TAB commands.
507 (goto-char (point-min))
508 (while (re-search-forward "%\\([-0-9]+\\)=" nil t)
509 (replace-match (format "\"(tab %s)\"" (match-string 1)) t t))
510 ;; Convert the buffer into the spec.
511 (goto-char (point-min))
512 (let ((form (read (current-buffer))))
514 `(let (gnus-position)
515 ,@(gnus-complex-form-to-spec form spec-alist)
517 (gnus-put-text-property gnus-position (1+ gnus-position)
520 ,@(gnus-complex-form-to-spec form spec-alist)))))))
522 (defun gnus-complex-form-to-spec (form spec-alist)
528 (gnus-parse-simple-format sform spec-alist t))
529 ((eq (car sform) 'point)
530 '(setq gnus-position (point)))
531 ((eq (car sform) 'tab)
532 (gnus-spec-tab (cadr sform)))
534 (funcall (intern (format "gnus-%s-face-function" (car sform)))
535 (gnus-complex-form-to-spec (cddr sform) spec-alist)
540 (defun gnus-xmas-format (fstring &rest args)
541 "A version of `format' which preserves text properties.
543 Required for XEmacs, where the built in `format' function strips all text
544 properties from both the format string and any inserted strings.
546 Only supports the format sequence %s, and %% for inserting
547 literal % characters. A pad width and an optional - (to right pad)
548 are supported for %s."
549 (let ((re "%%\\|%\\(-\\)?\\([1-9][0-9]*\\)?s")
553 (goto-char (point-min))
554 (while (re-search-forward re nil t)
555 (goto-char (match-end 0))
557 ((string= (match-string 0) "%%")
561 (error 'wrong-number-of-arguments #'my-format n fstring))
562 (let* ((minlen (string-to-number (or (match-string 2) "")))
564 (str (if (stringp arg) arg (format "%s" arg)))
565 (lpad (null (match-string 1)))
566 (padlen (max 0 (- minlen (length str)))))
568 (if lpad (insert-char ?\ padlen))
570 (unless lpad (insert-char ?\ padlen))
571 (setq args (cdr args))))))
574 (defun gnus-parse-simple-format (format spec-alist &optional insert)
575 ;; This function parses the FORMAT string with the help of the
576 ;; SPEC-ALIST and returns a list that can be eval'ed to return a
579 spec flist fstring elem result dontinsert user-defined
580 type value pad-width spec-beg cut-width ignore-value
581 tilde-form tilde elem-type extended-spec)
583 (gnus-set-work-buffer)
585 (goto-char (point-min))
586 (while (re-search-forward "%" nil t)
587 (setq user-defined nil
595 (setq spec-beg (1- (point)))
597 ;; Parse this spec fully.
600 ((looking-at "\\([-.0-9]+\\)\\(,[-0-9]+\\)?")
601 (setq pad-width (string-to-number (match-string 1)))
602 (when (match-beginning 2)
603 (setq max-width (string-to-number (buffer-substring
604 (1+ (match-beginning 2))
606 (goto-char (match-end 0)))
609 (setq tilde (read (current-buffer))
613 ((memq type '(pad pad-left))
614 (setq pad-width value))
615 ((eq type 'pad-right)
616 (setq pad-width (- value)))
617 ((memq type '(max-right max))
618 (setq max-width value))
620 (setq max-width (- value)))
621 ((memq type '(cut cut-left))
622 (setq cut-width value))
623 ((eq type 'cut-right)
624 (setq cut-width (- value)))
627 (if (stringp value) value (format "%s" value))))
629 (setq tilde-form value))
631 (error "Unknown tilde type: %s" tilde)))
636 ;; User-defined spec -- find the spec name.
637 ((eq (setq spec (char-after)) ?u)
639 (when (and (eq (setq user-defined (char-after)) ?&)
640 (looking-at "&\\([^;]+\\);"))
641 (setq user-defined (match-string 1))
642 (goto-char (match-end 1))))
644 ((and (eq spec ?&) (looking-at "&\\([^;]+\\);"))
645 (setq extended-spec (intern (match-string 1)))
646 (goto-char (match-end 1))))
648 (delete-region spec-beg (point))
650 ;; Now we have all the relevant data on this spec, so
651 ;; we start doing stuff.
654 ;; "%%" just results in a "%".
659 (setq elem (list tilde-form ?s)))
660 ;; Treat user defined format specifiers specially.
664 (list (intern (format
665 (if (stringp user-defined)
666 "gnus-user-format-function-%s"
667 "gnus-user-format-function-%c")
671 ;; Find the specification from `spec-alist'.
672 ((setq elem (cdr (assq (or extended-spec spec) spec-alist))))
673 ;; We used to use "%l" for displaying the grouplens score.
675 (setq elem '("" ?s)))
677 (setq elem '("*" ?s))))
678 (setq elem-type (cadr elem))
679 ;; Insert the new format elements.
681 (not (and (featurep 'xemacs)
682 gnus-use-correct-string-widths)))
683 (insert (number-to-string pad-width)))
684 ;; Create the form to be evalled.
685 (if (or max-width cut-width ignore-value
686 (and (featurep 'xemacs)
687 gnus-use-correct-string-widths))
690 (let ((el (car elem)))
691 (cond ((= (cadr elem) ?c)
692 (setq el (list 'char-to-string el)))
694 (setq el (list 'int-to-string el))))
696 (setq el (gnus-tilde-ignore-form el ignore-value)))
698 (setq el (gnus-tilde-cut-form el cut-width)))
700 (setq el (gnus-tilde-max-form el max-width)))
702 (setq el (gnus-pad-form el pad-width)))
705 (push (car elem) flist))))
706 (setq fstring (buffer-substring-no-properties (point-min) (point-max))))
708 ;; Do some postprocessing to increase efficiency.
713 ((string= fstring "")
715 ;; Not a format string.
716 ((not (string-match "%" fstring))
718 ;; A format string with just a single string spec.
719 ((string= fstring "%s")
721 ;; A single character.
722 ((string= fstring "%c")
725 ((string= fstring "%d")
728 `(insert (int-to-string ,(car flist)))
729 (list `(int-to-string ,(car flist)))))
730 ;; Just lots of chars and strings.
731 ((string-match "\\`\\(%[cs]\\)+\\'" fstring)
733 ;; A single string spec at the beginning of the spec.
734 ((string-match "\\`%[sc][^%]+\\'" fstring)
735 (list (car flist) (substring fstring 2)))
736 ;; A single string spec in the middle of the spec.
737 ((string-match "\\`\\([^%]+\\)%[sc]\\([^%]+\\)\\'" fstring)
738 (list (match-string 1 fstring) (car flist) (match-string 2 fstring)))
739 ;; A single string spec in the end of the spec.
740 ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring)
741 (list (match-string 1 fstring) (car flist)))
742 ;; Only string (and %) specs (XEmacs only!)
743 ((and (featurep 'xemacs)
744 gnus-make-format-preserve-properties
746 "\\`\\([^%]*\\(%%\\|%-?\\([1-9][0-9]*\\)?s\\)\\)*[^%]*\\'"
748 (list (cons 'gnus-xmas-format (cons fstring (nreverse flist)))))
749 ;; A more complex spec.
751 (list (cons 'format (cons fstring (nreverse flist)))))))
757 (cons 'insert result)))
758 (cond ((stringp result)
761 (cons 'concat result))
764 (defun gnus-eval-format (format &optional alist props)
765 "Eval the format variable FORMAT, using ALIST.
766 If PROPS, insert the result."
767 (let ((form (gnus-parse-format format alist props)))
769 (gnus-add-text-properties (point) (progn (eval form) (point)) props)
772 (defun gnus-compile ()
773 "Byte-compile the user-defined format specs."
776 (let ((entries gnus-format-specs)
777 (byte-compile-warnings '(unresolved callargs redefine))
780 (gnus-message 7 "Compiling format specs...")
783 (setq entry (pop entries))
784 (if (memq (car entry) '(gnus-version version))
785 (setq gnus-format-specs (delq entry gnus-format-specs))
786 (let ((form (caddr entry)))
787 (when (and (listp form)
788 ;; Under GNU Emacs, it's (byte-code ...)
789 (not (eq 'byte-code (car form)))
790 ;; Under XEmacs, it's (funcall #<compiled-function ...>)
791 (not (and (eq 'funcall (car form))
792 (byte-code-function-p (cadr form)))))
793 (defalias 'gnus-tmp-func `(lambda () ,form))
794 (byte-compile 'gnus-tmp-func)
795 (setcar (cddr entry) (gnus-byte-code 'gnus-tmp-func))))))
797 (push (cons 'version emacs-version) gnus-format-specs)
798 ;; Mark the .newsrc.eld file as "dirty".
800 (gnus-message 7 "Compiling user specs...done"))))
802 (defun gnus-set-format (type &optional insertable)
803 (set (intern (format "gnus-%s-line-format-spec" type))
805 (symbol-value (intern (format "gnus-%s-line-format" type)))
806 (symbol-value (intern (format "gnus-%s-line-format-alist" type)))
812 ;; coding: iso-8859-1
815 ;;; gnus-spec.el ends here