;;; gnus-cite.el --- parse citations in articles for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
;; Free Software Foundation, Inc.
;; Author: Per Abhiddenware
:group 'gnus-cite
:type 'integer)
+(defcustom gnus-cite-blank-line-after-header t
+ "If non-nil, put a blank line between the citation header and the button."
+ :group 'gnus-cite
+ :type 'boolean)
+
;;; Internal Variables:
(defvar gnus-cite-article nil)
(concat "^" (regexp-quote (cdar marks)) " *"))
(fill-prefix
(if (string= (cdar marks) "") ""
- (concat (cdar marks) " "))))
+ (concat (cdar marks) " ")))
+ use-hard-newlines)
(fill-region (point-min) (point-max)))
(set-marker (caar marks) nil)
(setq marks (cdr marks)))
(setq beg nil)
(setq end (point-marker))))))
(when (and beg end)
- (or (memq 'cite gnus-article-wash-types)
- (push 'cite gnus-article-wash-types))
+ (gnus-add-wash-type 'cite)
;; We use markers for the end-points to facilitate later
;; wrapping and mangling of text.
(setq beg (set-marker (make-marker) beg)
end (set-marker (make-marker) end))
(gnus-add-text-properties-when 'article-type nil beg end props)
(goto-char beg)
- (unless (save-excursion (search-backward "\n\n" nil t))
+ (when (and gnus-cite-blank-line-after-header
+ (not (save-excursion (search-backward "\n\n" nil t))))
(insert "\n"))
(put-text-property
(setq start (point-marker))
'article-type 'cite beg end
(cons 'article-type (cons 'cite
gnus-hidden-properties))))
- (or (memq 'cite gnus-article-wash-types)
- (push 'cite gnus-article-wash-types))
+ (gnus-add-wash-type 'cite)
(gnus-add-text-properties-when
'article-type nil beg end
(cons 'article-type (cons 'cite
(defun gnus-cite-delete-overlays ()
(dolist (overlay gnus-cite-overlay-list)
- (when (or (not (gnus-overlay-end overlay))
- (and (>= (gnus-overlay-end overlay) (point-min))
- (<= (gnus-overlay-end overlay) (point-max))))
- (setq gnus-cite-overlay-list (delete overlay gnus-cite-overlay-list))
- (gnus-delete-overlay overlay))))
+ (ignore-errors
+ (when (or (not (gnus-overlay-end overlay))
+ (and (>= (gnus-overlay-end overlay) (point-min))
+ (<= (gnus-overlay-end overlay) (point-max))))
+ (setq gnus-cite-overlay-list (delete overlay gnus-cite-overlay-list))
+ (ignore-errors
+ (gnus-delete-overlay overlay))))))
(defun gnus-cite-parse-wrapper ()
;; Wrap chopped gnus-cite-parse.
gnus-hidden-properties))
((assq number gnus-cite-attribution-alist))
(t
- (or (memq 'cite gnus-article-wash-types)
- (push 'cite gnus-article-wash-types))
+ (gnus-add-wash-type 'cite)
(gnus-add-text-properties
(point) (progn (forward-line 1) (point))
(nconc (list 'article-type 'cite)