From a8151ef7e5caf46b41fc52f8189b07d1fa6c184e Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Wed, 24 Sep 1997 01:50:24 +0000 Subject: *** empty log message *** --- lisp/gnus/nnvirtual.el | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'lisp/gnus/nnvirtual.el') diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index 05db7591112..aece7417cbc 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -374,22 +374,29 @@ to virtual article number.") (insert "Xref: " system-name " " group ":") (princ article (current-buffer)) + (insert " ") ;; If there were existing xref lines, clean them up to have the correct ;; component server prefix. - (let ((xref-end (save-excursion - (search-forward "\t" (gnus-point-at-eol) 'move) - (point))) - (len (length prefix))) - (unless (= (point) xref-end) + (save-restriction + (narrow-to-region (point) + (or (search-forward "\t" (gnus-point-at-eol) t) + (gnus-point-at-eol))) + (goto-char (point-min)) + (when (re-search-forward "Xref: *[^\n:0-9 ]+ *" nil t) + (replace-match "" t t)) + (goto-char (point-min)) + (when (re-search-forward + (concat (gnus-group-real-name group) ":[0-9]+") + nil t) + (replace-match "" t t)) + (unless (= (point) (point-max)) (insert " ") (when (not (string= "" prefix)) - (while (re-search-forward "[^ ]+:[0-9]+" xref-end t) + (while (re-search-forward "[^ ]+:[0-9]+" nil t) (save-excursion (goto-char (match-beginning 0)) - (insert prefix)) - (setq xref-end (+ xref-end len))) - ))) + (insert prefix)))))) ;; Ensure a trailing \t. (end-of-line) -- cgit v1.2.1