Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
[bpt/emacs.git] / lisp / gnus / nndoc.el
index ea32a8f..1de9a20 100644 (file)
@@ -122,7 +122,7 @@ from the document.")
      (subtype digest guess))
     (lanl-gov-announce
      (article-begin . "^\\\\\\\\\n")
-     (head-begin . "^Paper.*:")
+     (head-begin . "^\\(Paper.*:\\|arXiv:\\)")
      (head-end   . "\\(^\\\\\\\\.*\n\\|-----------------\\)")
      (body-begin . "")
      (body-end   . "\\(-------------------------------------------------\\|%-%-%-%-%-%-%-%-%-%-%-%-%-%-\\|%%--%%--%%--%%--%%--%%--%%--%%--\\|%%%---%%%---%%%---%%%---\\)")
@@ -624,25 +624,28 @@ from the document.")
 
 (defun nndoc-lanl-gov-announce-type-p ()
   (when (let ((case-fold-search nil))
-         (re-search-forward "^\\\\\\\\\nPaper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+" nil t))
+         (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+\\|arXiv:\\)" nil t))
     t))
 
 (defun nndoc-transform-lanl-gov-announce (article)
-  (goto-char (point-max))
-  (when (re-search-backward "^\\\\\\\\ +( *\\([^ ]*\\) , *\\([^ ]*\\))" nil t)
-    (replace-match "\n\nGet it at \\1 (\\2)" t nil))
-  (goto-char (point-min))
-  (while (re-search-forward "^\\\\\\\\$" nil t)
-    (replace-match "" t nil))
-  (goto-char (point-min))
-  (when (re-search-forward "^replaced with revised version +\\(.*[^ ]\\) +" nil t)
-    (replace-match "Date: \\1 (revised) " t nil))
-  (goto-char (point-min))
-  (unless (re-search-forward "^From" nil t)
+  (let ((case-fold-search nil))
+    (goto-char (point-max))
+    (when (re-search-backward "^\\\\\\\\ +( *\\([^ ]*\\) , *\\([^ ]*\\))" nil t)
+      (replace-match "\n\nGet it at \\1 (\\2)" t nil))
     (goto-char (point-min))
-    (when (re-search-forward "^Authors?: \\(.*\\)" nil t)
+    (while (re-search-forward "^\\\\\\\\$" nil t)
+      (replace-match "" t nil))
+    (goto-char (point-min))
+    (when (re-search-forward "^replaced with revised version +\\(.*[^ ]\\) +" nil t)
+      (replace-match "Date: \\1 (revised) " t nil))
+    (goto-char (point-min))
+    (unless (re-search-forward "^From" nil t)
       (goto-char (point-min))
-      (insert "From: " (match-string 1) "\n"))))
+      (when (re-search-forward "^Authors?: \\(.*\\)" nil t)
+       (goto-char (point-min))
+       (insert "From: " (match-string 1) "\n")))
+    (when (re-search-forward "^arXiv:" nil t)
+      (replace-match "Paper: arXiv:" t nil))))
 
 (defun nndoc-generate-lanl-gov-head (article)
   (let ((entry (cdr (assq article nndoc-dissection-alist)))
@@ -653,8 +656,8 @@ from the document.")
       (save-restriction
        (narrow-to-region (car entry) (nth 1 entry))
        (goto-char (point-min))
-       (when (looking-at "^Paper.*: \\([a-zA-Z-\\.]+/[0-9]+\\)")
-         (setq subject (concat " (" (match-string 1) ")"))
+       (when (looking-at "^\\(Paper.*: \\|arXiv:\\)\\([0-9a-zA-Z-\\./]+\\)")
+         (setq subject (concat " (" (match-string 2) ")"))
          (when (re-search-forward "^From: \\(.*\\)" nil t)
            (setq from (concat "<"
                               (cadr (funcall gnus-extract-address-components