diff options
author | Lars Magne Ingebrigtsen <larsi@gnus.org> | 1997-09-24 01:50:24 +0000 |
---|---|---|
committer | Lars Magne Ingebrigtsen <larsi@gnus.org> | 1997-09-24 01:50:24 +0000 |
commit | a8151ef7e5caf46b41fc52f8189b07d1fa6c184e (patch) | |
tree | 8eb82a1990da4afe2e247c1397e42a20128f0568 /lisp/gnus/nnvirtual.el | |
parent | 5f016f400343a57d641642ce114f90d3a15082e1 (diff) | |
download | emacs-a8151ef7e5caf46b41fc52f8189b07d1fa6c184e.tar.gz |
*** empty log message ***
Diffstat (limited to 'lisp/gnus/nnvirtual.el')
-rw-r--r-- | lisp/gnus/nnvirtual.el | 25 |
1 files changed, 16 insertions, 9 deletions
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) |