1 ;;; gnus-cite.el --- parse citations in articles for Gnus
2 ;; Copyright (C) 1995,96 Free Software Foundation, Inc.
4 ;; Author: Per Abrahamsen <abraham@iesd.auc.dk>
5 ;; Keywords: news, mail
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
34 (defgroup gnus-cite nil
39 (defcustom gnus-cited-text-button-line-format "%(%{[...]%}%)\n"
40 "Format of cited text buttons."
44 (defcustom gnus-cited-lines-visible nil
45 "The number of lines of hidden cited text to remain visible."
47 :type '(choice (const :tag "none" nil)
50 (defcustom gnus-cite-parse-max-size 25000
51 "Maximum article size (in bytes) where parsing citations is allowed.
52 Set it to nil to parse all articles."
54 :type '(choice (const :tag "all" nil)
57 (defcustom gnus-cite-prefix-regexp
58 "^[]>|:}+ ]*[]>|:}+]\\(.*>\\)?\\|^.*>"
59 "Regexp matching the longest possible citation prefix on a line."
63 (defcustom gnus-cite-max-prefix 20
64 "Maximum possible length for a citation prefix."
68 (defcustom gnus-supercite-regexp
69 (concat "^\\(" gnus-cite-prefix-regexp "\\)? *"
70 ">>>>> +\"\\([^\"\n]+\\)\" +==")
71 "Regexp matching normal Supercite attribution lines.
72 The first grouping must match prefixes added by other packages."
76 (defcustom gnus-supercite-secondary-regexp "^.*\"\\([^\"\n]+\\)\" +=="
77 "Regexp matching mangled Supercite attribution lines.
78 The first regexp group should match the Supercite attribution."
82 (defcustom gnus-cite-minimum-match-count 2
83 "Minimum number of identical prefixes before we believe it's a citation."
87 (defcustom gnus-cite-attribution-prefix "in article\\|in <"
88 "Regexp matching the beginning of an attribution line."
92 (defcustom gnus-cite-attribution-suffix
93 "\\(wrote\\|writes\\|said\\|says\\):[ \t]*$"
94 "Regexp matching the end of an attribution line.
95 The text matching the first grouping will be used as a button."
99 (defface gnus-cite-attribution-face '((t
101 "Face used for attribution lines.")
103 (defcustom gnus-cite-attribution-face 'gnus-cite-attribution-face
104 "Face used for attribution lines.
105 It is merged with the face for the cited text belonging to the attribution."
109 (defface gnus-cite-face-1 '((((class color)
111 (:foreground "light blue"))
114 (:foreground "MidnightBlue"))
119 (defface gnus-cite-face-2 '((((class color)
121 (:foreground "light cyan"))
124 (:foreground "firebrick"))
129 (defface gnus-cite-face-3 '((((class color)
131 (:foreground "light yellow"))
134 (:foreground "dark green"))
139 (defface gnus-cite-face-4 '((((class color)
141 (:foreground "light pink"))
144 (:foreground "OrangeRed"))
149 (defface gnus-cite-face-5 '((((class color)
151 (:foreground "pale green"))
154 (:foreground "dark khaki"))
159 (defface gnus-cite-face-6 '((((class color)
161 (:foreground "beige"))
164 (:foreground "dark violet"))
169 (defface gnus-cite-face-7 '((((class color)
171 (:foreground "orange"))
174 (:foreground "SteelBlue4"))
179 (defface gnus-cite-face-8 '((((class color)
181 (:foreground "magenta"))
184 (:foreground "magenta"))
189 (defface gnus-cite-face-9 '((((class color)
191 (:foreground "violet"))
194 (:foreground "violet"))
199 (defface gnus-cite-face-10 '((((class color)
201 (:foreground "medium purple"))
204 (:foreground "medium purple"))
209 (defface gnus-cite-face-11 '((((class color)
211 (:foreground "turquoise"))
214 (:foreground "turquoise"))
219 (defcustom gnus-cite-face-list
220 '(gnus-cite-face-1 gnus-cite-face-2 gnus-cite-face-3 gnus-cite-face-4
221 gnus-cite-face-5 gnus-cite-face-6 gnus-cite-face-7 gnus-cite-face-8
222 gnus-cite-face-9 gnus-cite-face-10 gnus-cite-face-11)
223 "List of faces used for highlighting citations.
225 When there are citations from multiple articles in the same message,
226 Gnus will try to give each citation from each article its own face.
227 This should make it easier to see who wrote what."
229 :type '(repeat face))
231 (defcustom gnus-cite-hide-percentage 50
232 "Only hide excess citation if above this percentage of the body."
236 (defcustom gnus-cite-hide-absolute 10
237 "Only hide excess citation if above this number of lines in the body."
241 ;;; Internal Variables:
243 (defvar gnus-cite-article nil)
245 (defvar gnus-cite-prefix-alist nil)
246 ;; Alist of citation prefixes.
247 ;; The cdr is a list of lines with that prefix.
249 (defvar gnus-cite-attribution-alist nil)
250 ;; Alist of attribution lines.
251 ;; The car is a line number.
252 ;; The cdr is the prefix for the citation started by that line.
254 (defvar gnus-cite-loose-prefix-alist nil)
255 ;; Alist of citation prefixes that have no matching attribution.
256 ;; The cdr is a list of lines with that prefix.
258 (defvar gnus-cite-loose-attribution-alist nil)
259 ;; Alist of attribution lines that have no matching citation.
260 ;; Each member has the form (WROTE IN PREFIX TAG), where
261 ;; WROTE: is the attribution line number
262 ;; IN: is the line number of the previous line if part of the same attribution,
263 ;; PREFIX: Is the citation prefix of the attribution line(s), and
264 ;; TAG: Is a Supercite tag, if any.
266 (defvar gnus-cited-text-button-line-format-alist
267 `((?b (marker-position beg) ?d)
268 (?e (marker-position end) ?d)
269 (?l (- end beg) ?d)))
270 (defvar gnus-cited-text-button-line-format-spec nil)
274 (defun gnus-article-highlight-citation (&optional force)
275 "Highlight cited text.
276 Each citation in the article will be highlighted with a different face.
277 The faces are taken from `gnus-cite-face-list'.
278 Attribution lines are highlighted with the same face as the
279 corresponding citation merged with `gnus-cite-attribution-face'.
281 Text is considered cited if at least `gnus-cite-minimum-match-count'
282 lines matches `gnus-cite-prefix-regexp' with the same prefix.
284 Lines matching `gnus-cite-attribution-suffix' and perhaps
285 `gnus-cite-attribution-prefix' are considered attribution lines."
286 (interactive (list 'force))
288 (set-buffer gnus-article-buffer)
289 (gnus-cite-parse-maybe force)
290 (let ((buffer-read-only nil)
291 (alist gnus-cite-prefix-alist)
292 (faces gnus-cite-face-list)
293 (inhibit-point-motion-hooks t)
294 face entry prefix skip numbers number face-alist)
295 ;; Loop through citation prefixes.
297 (setq entry (car alist)
302 faces (or (cdr faces) gnus-cite-face-list)
303 face-alist (cons (cons prefix face) face-alist))
305 (setq number (car numbers)
306 numbers (cdr numbers))
307 (and (not (assq number gnus-cite-attribution-alist))
308 (not (assq number gnus-cite-loose-attribution-alist))
309 (gnus-cite-add-face number prefix face))))
310 ;; Loop through attribution lines.
311 (setq alist gnus-cite-attribution-alist)
313 (setq entry (car alist)
317 skip (gnus-cite-find-prefix number)
318 face (cdr (assoc prefix face-alist)))
319 ;; Add attribution button.
321 (when (re-search-forward gnus-cite-attribution-suffix
322 (save-excursion (end-of-line 1) (point))
324 (gnus-article-add-button (match-beginning 1) (match-end 1)
325 'gnus-cite-toggle prefix))
326 ;; Highlight attribution line.
327 (gnus-cite-add-face number skip face)
328 (gnus-cite-add-face number skip gnus-cite-attribution-face))
329 ;; Loop through attribution lines.
330 (setq alist gnus-cite-loose-attribution-alist)
332 (setq entry (car alist)
335 skip (gnus-cite-find-prefix number))
336 (gnus-cite-add-face number skip gnus-cite-attribution-face)))))
338 (defun gnus-dissect-cited-text ()
339 "Dissect the article buffer looking for cited text."
341 (set-buffer gnus-article-buffer)
342 (gnus-cite-parse-maybe)
343 (let ((alist gnus-cite-prefix-alist)
344 prefix numbers number marks m)
345 ;; Loop through citation prefixes.
347 (setq numbers (pop alist)
348 prefix (pop numbers))
350 (setq number (pop numbers))
351 (goto-char (point-min))
352 (forward-line number)
353 (push (cons (point-marker) "") marks)
355 (= (1- number) (car numbers)))
356 (setq number (pop numbers)))
357 (goto-char (point-min))
358 (forward-line (1- number))
359 (push (cons (point-marker) prefix) marks)))
360 (goto-char (point-min))
361 (search-forward "\n\n" nil t)
362 (push (cons (point-marker) "") marks)
363 (goto-char (point-max))
364 (article-search-signature)
365 (push (cons (point-marker) "") marks)
366 (setq marks (sort marks (lambda (m1 m2) (< (car m1) (car m2)))))
367 (let* ((omarks marks))
370 (if (= (caar omarks) (caadr omarks))
372 (unless (equal (cdar omarks) "")
373 (push (car omarks) marks))
374 (unless (equal (cdadr omarks) "")
375 (push (cadr omarks) marks))
376 (setq omarks (cdr omarks)))
377 (push (car omarks) marks))
378 (setq omarks (cdr omarks)))
380 (push (car omarks) marks))
381 (setq marks (setq m (nreverse marks)))
383 (if (and (equal (cdadr m) "")
384 (equal (cdar m) (cdaddr m))
385 (goto-char (caadr m))
387 (= (point) (caaddr m)))
392 (defun gnus-article-fill-cited-article (&optional force)
393 "Do word wrapping in the current article."
394 (interactive (list t))
396 (set-buffer gnus-article-buffer)
397 (let ((buffer-read-only nil)
398 (inhibit-point-motion-hooks t)
399 (marks (gnus-dissect-cited-text))
400 (adaptive-fill-mode nil))
404 (narrow-to-region (caar marks) (caadr marks))
405 (let ((adaptive-fill-regexp
406 (concat "^" (regexp-quote (cdar marks)) " *"))
407 (fill-prefix (cdar marks)))
408 (fill-region (point-min) (point-max)))
409 (set-marker (caar marks) nil)
410 (setq marks (cdr marks)))
412 (set-marker (caar marks) nil))
413 ;; All this information is now incorrect.
414 (setq gnus-cite-prefix-alist nil
415 gnus-cite-attribution-alist nil
416 gnus-cite-loose-prefix-alist nil
417 gnus-cite-loose-attribution-alist nil)))))
419 (defun gnus-article-hide-citation (&optional arg force)
420 "Toggle hiding of all cited text except attribution lines.
421 See the documentation for `gnus-article-highlight-citation'.
422 If given a negative prefix, always show; if given a positive prefix,
424 (interactive (append (article-hidden-arg) (list 'force)))
425 (setq gnus-cited-text-button-line-format-spec
426 (gnus-parse-format gnus-cited-text-button-line-format
427 gnus-cited-text-button-line-format-alist t))
429 (set-buffer gnus-article-buffer)
431 ((article-check-hidden-text 'cite arg)
433 ((article-text-type-exists-p 'cite)
434 (let ((buffer-read-only nil))
435 (article-hide-text-of-type 'cite)))
437 (let ((buffer-read-only nil)
438 (marks (gnus-dissect-cited-text))
439 (inhibit-point-motion-hooks t)
440 (props (nconc (list 'article-type 'cite)
441 gnus-hidden-properties))
446 (while (and marks (string= (cdar marks) ""))
447 (setq marks (cdr marks)))
449 (setq beg (caar marks)))
450 (while (and marks (not (string= (cdar marks) "")))
451 (setq marks (cdr marks)))
453 (setq end (caar marks)))
454 ;; Skip past lines we want to leave visible.
455 (when (and beg end gnus-cited-lines-visible)
457 (forward-line gnus-cited-lines-visible)
460 (setq beg (point-marker))))
462 (gnus-add-text-properties beg end props)
464 (unless (save-excursion (search-backward "\n\n" nil t))
469 (gnus-article-add-button
471 (progn (eval gnus-cited-text-button-line-format-spec) (point))
472 `gnus-article-toggle-cited-text (cons beg end))
474 'article-type 'annotation)
475 (set-marker beg (point)))))))))
477 (defun gnus-article-toggle-cited-text (region)
478 "Toggle hiding the text in REGION."
479 (let (buffer-read-only)
481 (if (text-property-any
482 (car region) (1- (cdr region))
483 (car gnus-hidden-properties) (cadr gnus-hidden-properties))
484 'remove-text-properties 'gnus-add-text-properties)
485 (car region) (cdr region) gnus-hidden-properties)))
487 (defun gnus-article-hide-citation-maybe (&optional arg force)
488 "Toggle hiding of cited text that has an attribution line.
489 If given a negative prefix, always show; if given a positive prefix,
491 This will do nothing unless at least `gnus-cite-hide-percentage'
492 percent and at least `gnus-cite-hide-absolute' lines of the body is
493 cited text with attributions. When called interactively, these two
494 variables are ignored.
495 See also the documentation for `gnus-article-highlight-citation'."
496 (interactive (append (article-hidden-arg) (list 'force)))
497 (unless (article-check-hidden-text 'cite arg)
499 (set-buffer gnus-article-buffer)
500 (gnus-cite-parse-maybe force)
501 (goto-char (point-min))
502 (search-forward "\n\n" nil t)
503 (let ((start (point))
504 (atts gnus-cite-attribution-alist)
505 (buffer-read-only nil)
506 (inhibit-point-motion-hooks t)
509 (goto-char (point-max))
510 (article-search-signature)
511 (setq total (count-lines start (point)))
513 (setq hiden (+ hiden (length (cdr (assoc (cdar atts)
514 gnus-cite-prefix-alist))))
517 (and (> (* 100 hiden) (* gnus-cite-hide-percentage total))
518 (> hiden gnus-cite-hide-absolute)))
519 (setq atts gnus-cite-attribution-alist)
521 (setq total (cdr (assoc (cdar atts) gnus-cite-prefix-alist))
524 (setq hiden (car total)
527 (unless (assq hiden gnus-cite-attribution-alist)
528 (gnus-add-text-properties
529 (point) (progn (forward-line 1) (point))
530 (nconc (list 'article-type 'cite)
531 gnus-hidden-properties))))))))))
533 (defun gnus-article-hide-citation-in-followups ()
534 "Hide cited text in non-root articles."
537 (set-buffer gnus-article-buffer)
538 (let ((article (cdr gnus-article-current)))
539 (unless (save-excursion
540 (set-buffer gnus-summary-buffer)
541 (gnus-article-displayed-root-p article))
542 (gnus-article-hide-citation)))))
544 ;;; Internal functions:
546 (defun gnus-cite-parse-maybe (&optional force)
547 ;; Parse if the buffer has changes since last time.
548 (if (equal gnus-cite-article gnus-article-current)
550 ;;Reset parser information.
551 (setq gnus-cite-prefix-alist nil
552 gnus-cite-attribution-alist nil
553 gnus-cite-loose-prefix-alist nil
554 gnus-cite-loose-attribution-alist nil)
555 ;; Parse if not too large.
557 gnus-cite-parse-max-size
558 (> (buffer-size) gnus-cite-parse-max-size))
560 (setq gnus-cite-article (cons (car gnus-article-current)
561 (cdr gnus-article-current)))
564 (defun gnus-cite-parse ()
565 ;; Parse and connect citation prefixes and attribution lines.
567 ;; Parse current buffer searching for citation prefixes.
568 (goto-char (point-min))
569 (unless (search-forward "\n\n" nil t)
570 (goto-char (point-max)))
571 (let ((line (1+ (count-lines (point-min) (point))))
574 (goto-char (point-max))
575 (article-search-signature)
577 alist entry start begin end numbers prefix)
578 ;; Get all potential prefixes in `alist'.
579 (while (< (point) max)
582 end (progn (beginning-of-line 2) (point))
585 ;; Ignore standard Supercite attribution prefix.
586 (when (looking-at gnus-supercite-regexp)
588 (setq end (1+ (match-end 1)))
589 (setq end (1+ begin))))
590 ;; Ignore very long prefixes.
591 (when (> end (+ (point) gnus-cite-max-prefix))
592 (setq end (+ (point) gnus-cite-max-prefix)))
593 (while (re-search-forward gnus-cite-prefix-regexp (1- end) t)
595 (setq end (match-end 0)
596 prefix (buffer-substring begin end))
597 (gnus-set-text-properties 0 (length prefix) nil prefix)
598 (setq entry (assoc prefix alist))
600 (setcdr entry (cons line (cdr entry)))
601 (push (list prefix line) alist))
604 (setq line (1+ line)))
605 ;; We got all the potential prefixes. Now create
606 ;; `gnus-cite-prefix-alist' containing the oldest prefix for each
607 ;; line that appears at least gnus-cite-minimum-match-count
608 ;; times. First sort them by length. Longer is older.
609 (setq alist (sort alist (lambda (a b)
610 (> (length (car a)) (length (car b))))))
612 (setq entry (car alist)
616 (cond ((null numbers)
617 ;; No lines with this prefix that wasn't also part of
620 ((< (length numbers) gnus-cite-minimum-match-count)
621 ;; Too few lines with this prefix. We keep it a bit
622 ;; longer in case it is an exact match for an attribution
623 ;; line, but we don't remove the line from other
625 (push entry gnus-cite-prefix-alist))
628 gnus-cite-prefix-alist)
629 ;; Remove articles from other prefixes.
633 (setq current (car loop)
636 (gnus-set-difference (cdr current) numbers))))))))
637 ;; No citations have been connected to attribution lines yet.
638 (setq gnus-cite-loose-prefix-alist (append gnus-cite-prefix-alist nil))
640 ;; Parse current buffer searching for attribution lines.
641 (goto-char (point-min))
642 (search-forward "\n\n" nil t)
643 (while (re-search-forward gnus-cite-attribution-suffix (point-max) t)
644 (let* ((start (match-beginning 0))
646 (wrote (count-lines (point-min) end))
647 (prefix (gnus-cite-find-prefix wrote))
648 ;; Check previous line for an attribution leader.
650 (beginning-of-line 1)
651 (when (looking-at gnus-supercite-secondary-regexp)
652 (buffer-substring (match-beginning 1)
656 (and (re-search-backward gnus-cite-attribution-prefix
658 (beginning-of-line 0)
661 (not (re-search-forward gnus-cite-attribution-suffix
663 (count-lines (point-min) (1+ (point)))))))
667 (push (list wrote in prefix tag)
668 gnus-cite-loose-attribution-alist)))
669 ;; Find exact supercite citations.
670 (gnus-cite-match-attributions 'small nil
674 (regexp-quote prefix) "[ \t]*"
675 (regexp-quote tag) ">"))))
676 ;; Find loose supercite citations after attributions.
677 (gnus-cite-match-attributions 'small t
683 ;; Find loose supercite citations anywhere.
684 (gnus-cite-match-attributions 'small nil
690 ;; Find nested citations after attributions.
691 (gnus-cite-match-attributions 'small-if-unique t
693 (concat "\\`" (regexp-quote prefix) ".+")))
694 ;; Find nested citations anywhere.
695 (gnus-cite-match-attributions 'small nil
697 (concat "\\`" (regexp-quote prefix) ".+")))
698 ;; Remove loose prefixes with too few lines.
699 (let ((alist gnus-cite-loose-prefix-alist)
702 (setq entry (car alist)
704 (when (< (length (cdr entry)) gnus-cite-minimum-match-count)
705 (setq gnus-cite-prefix-alist
706 (delq entry gnus-cite-prefix-alist)
707 gnus-cite-loose-prefix-alist
708 (delq entry gnus-cite-loose-prefix-alist)))))
709 ;; Find flat attributions.
710 (gnus-cite-match-attributions 'first t nil)
711 ;; Find any attributions (are we getting desperate yet?).
712 (gnus-cite-match-attributions 'first nil nil))
714 (defun gnus-cite-match-attributions (sort after fun)
715 ;; Match all loose attributions and citations (SORT AFTER FUN) .
717 ;; If SORT is `small', the citation with the shortest prefix will be
718 ;; used, if it is `first' the first prefix will be used, if it is
719 ;; `small-if-unique' the shortest prefix will be used if the
720 ;; attribution line does not share its own prefix with other
721 ;; loose attribution lines, otherwise the first prefix will be used.
723 ;; If AFTER is non-nil, only citations after the attribution line
724 ;; will be considered.
726 ;; If FUN is non-nil, it will be called with the arguments (WROTE
727 ;; PREFIX TAG) and expected to return a regular expression. Only
728 ;; citations whose prefix matches the regular expression will be
731 ;; WROTE is the attribution line number.
732 ;; PREFIX is the attribution line prefix.
733 ;; TAG is the Supercite tag on the attribution line.
734 (let ((atts gnus-cite-loose-attribution-alist)
736 att wrote in prefix tag regexp limit smallest best size)
744 regexp (if fun (funcall fun prefix tag) "")
745 size (cond ((eq sort 'small) t)
746 ((eq sort 'first) nil)
747 (t (< (length (gnus-cite-find-loose prefix)) 2)))
748 limit (if after wrote -1)
751 (let ((cites gnus-cite-loose-prefix-alist)
752 cite candidate numbers first compare)
754 (setq cite (car cites)
758 first (apply 'min numbers)
759 compare (if size (length candidate) first))
762 (string-match regexp candidate)
768 (setq gnus-cite-loose-attribution-alist
769 (delq att gnus-cite-loose-attribution-alist))
770 (push (cons wrote (car best)) gnus-cite-attribution-alist)
772 (push (cons in (car best)) gnus-cite-attribution-alist))
773 (when (memq best gnus-cite-loose-prefix-alist)
774 (let ((loop gnus-cite-prefix-alist)
777 (setq gnus-cite-loose-prefix-alist
778 (delq best gnus-cite-loose-prefix-alist))
780 (setq current (car loop)
782 (if (eq current best)
784 (setcdr current (gnus-set-difference (cdr current) numbers))
785 (when (null (cdr current))
786 (setq gnus-cite-loose-prefix-alist
787 (delq current gnus-cite-loose-prefix-alist)
788 atts (delq current atts)))))))))))
790 (defun gnus-cite-find-loose (prefix)
791 ;; Return a list of loose attribution lines prefixed by PREFIX.
792 (let* ((atts gnus-cite-loose-attribution-alist)
798 (when (string-equal (gnus-cite-find-prefix line) prefix)
802 (defun gnus-cite-add-face (number prefix face)
803 ;; At line NUMBER, ignore PREFIX and add FACE to the rest of the line.
805 (let ((inhibit-point-motion-hooks t)
808 (unless (eobp);; Sometimes things become confused.
809 (forward-char (length prefix))
810 (skip-chars-forward " \t")
813 (skip-chars-backward " \t")
816 (gnus-overlay-put (gnus-make-overlay from to) 'face face))))))
818 (defun gnus-cite-toggle (prefix)
820 (set-buffer gnus-article-buffer)
821 (let ((buffer-read-only nil)
822 (numbers (cdr (assoc prefix gnus-cite-prefix-alist)))
823 (inhibit-point-motion-hooks t)
826 (setq number (car numbers)
827 numbers (cdr numbers))
829 (cond ((get-text-property (point) 'invisible)
830 (remove-text-properties (point) (progn (forward-line 1) (point))
831 gnus-hidden-properties))
832 ((assq number gnus-cite-attribution-alist))
834 (gnus-add-text-properties
835 (point) (progn (forward-line 1) (point))
836 (nconc (list 'article-type 'cite)
837 gnus-hidden-properties))))))))
839 (defun gnus-cite-find-prefix (line)
840 ;; Return citation prefix for LINE.
841 (let ((alist gnus-cite-prefix-alist)
845 (setq entry (car alist)
847 (when (memq line (cdr entry))
848 (setq prefix (car entry))))
851 (gnus-add-shutdown 'gnus-cache-close 'gnus)
853 (defun gnus-cache-close ()
854 (setq gnus-cite-prefix-alist nil))
860 ;;; gnus-cite.el ends here