comparison lisp/gnus/nndoc.el @ 91085:880960b70474

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
author Miles Bader <miles@gnu.org>
date Sun, 11 Nov 2007 00:56:44 +0000
parents f55f9811f5d7 a3c27999decb
children 606f2d163a64
comparison
equal deleted inserted replaced
91084:a4347a111894 91085:880960b70474
120 (file-end . "^End of") 120 (file-end . "^End of")
121 (prepare-body-function . nndoc-unquote-dashes) 121 (prepare-body-function . nndoc-unquote-dashes)
122 (subtype digest guess)) 122 (subtype digest guess))
123 (lanl-gov-announce 123 (lanl-gov-announce
124 (article-begin . "^\\\\\\\\\n") 124 (article-begin . "^\\\\\\\\\n")
125 (head-begin . "^Paper.*:") 125 (head-begin . "^\\(Paper.*:\\|arXiv:\\)")
126 (head-end . "\\(^\\\\\\\\.*\n\\|-----------------\\)") 126 (head-end . "\\(^\\\\\\\\.*\n\\|-----------------\\)")
127 (body-begin . "") 127 (body-begin . "")
128 (body-end . "\\(-------------------------------------------------\\|%-%-%-%-%-%-%-%-%-%-%-%-%-%-\\|%%--%%--%%--%%--%%--%%--%%--%%--\\|%%%---%%%---%%%---%%%---\\)") 128 (body-end . "\\(-------------------------------------------------\\|%-%-%-%-%-%-%-%-%-%-%-%-%-%-\\|%%--%%--%%--%%--%%--%%--%%--%%--\\|%%%---%%%---%%%---%%%---\\)")
129 (file-end . "\\(^Title: Recent Seminal\\|%%%---%%%---%%%---%%%---\\)") 129 (file-end . "\\(^Title: Recent Seminal\\|%%%---%%%---%%%---%%%---\\)")
130 (generate-head-function . nndoc-generate-lanl-gov-head) 130 (generate-head-function . nndoc-generate-lanl-gov-head)
622 (defun nndoc-slack-digest-type-p () 622 (defun nndoc-slack-digest-type-p ()
623 0) 623 0)
624 624
625 (defun nndoc-lanl-gov-announce-type-p () 625 (defun nndoc-lanl-gov-announce-type-p ()
626 (when (let ((case-fold-search nil)) 626 (when (let ((case-fold-search nil))
627 (re-search-forward "^\\\\\\\\\nPaper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+" nil t)) 627 (re-search-forward "^\\\\\\\\\n\\(Paper\\( (\\*cross-listing\\*)\\)?: [a-zA-Z-\\.]+/[0-9]+\\|arXiv:\\)" nil t))
628 t)) 628 t))
629 629
630 (defun nndoc-transform-lanl-gov-announce (article) 630 (defun nndoc-transform-lanl-gov-announce (article)
631 (goto-char (point-max)) 631 (let ((case-fold-search nil))
632 (when (re-search-backward "^\\\\\\\\ +( *\\([^ ]*\\) , *\\([^ ]*\\))" nil t) 632 (goto-char (point-max))
633 (replace-match "\n\nGet it at \\1 (\\2)" t nil)) 633 (when (re-search-backward "^\\\\\\\\ +( *\\([^ ]*\\) , *\\([^ ]*\\))" nil t)
634 (goto-char (point-min)) 634 (replace-match "\n\nGet it at \\1 (\\2)" t nil))
635 (while (re-search-forward "^\\\\\\\\$" nil t)
636 (replace-match "" t nil))
637 (goto-char (point-min))
638 (when (re-search-forward "^replaced with revised version +\\(.*[^ ]\\) +" nil t)
639 (replace-match "Date: \\1 (revised) " t nil))
640 (goto-char (point-min))
641 (unless (re-search-forward "^From" nil t)
642 (goto-char (point-min)) 635 (goto-char (point-min))
643 (when (re-search-forward "^Authors?: \\(.*\\)" nil t) 636 (while (re-search-forward "^\\\\\\\\$" nil t)
637 (replace-match "" t nil))
638 (goto-char (point-min))
639 (when (re-search-forward "^replaced with revised version +\\(.*[^ ]\\) +" nil t)
640 (replace-match "Date: \\1 (revised) " t nil))
641 (goto-char (point-min))
642 (unless (re-search-forward "^From" nil t)
644 (goto-char (point-min)) 643 (goto-char (point-min))
645 (insert "From: " (match-string 1) "\n")))) 644 (when (re-search-forward "^Authors?: \\(.*\\)" nil t)
645 (goto-char (point-min))
646 (insert "From: " (match-string 1) "\n")))
647 (when (re-search-forward "^arXiv:" nil t)
648 (replace-match "Paper: arXiv:" t nil))))
646 649
647 (defun nndoc-generate-lanl-gov-head (article) 650 (defun nndoc-generate-lanl-gov-head (article)
648 (let ((entry (cdr (assq article nndoc-dissection-alist))) 651 (let ((entry (cdr (assq article nndoc-dissection-alist)))
649 (from "<no address given>") 652 (from "<no address given>")
650 subject date) 653 subject date)
651 (save-excursion 654 (save-excursion
652 (set-buffer nndoc-current-buffer) 655 (set-buffer nndoc-current-buffer)
653 (save-restriction 656 (save-restriction
654 (narrow-to-region (car entry) (nth 1 entry)) 657 (narrow-to-region (car entry) (nth 1 entry))
655 (goto-char (point-min)) 658 (goto-char (point-min))
656 (when (looking-at "^Paper.*: \\([a-zA-Z-\\.]+/[0-9]+\\)") 659 (when (looking-at "^\\(Paper.*: \\|arXiv:\\)\\([0-9a-zA-Z-\\./]+\\)")
657 (setq subject (concat " (" (match-string 1) ")")) 660 (setq subject (concat " (" (match-string 2) ")"))
658 (when (re-search-forward "^From: \\(.*\\)" nil t) 661 (when (re-search-forward "^From: \\(.*\\)" nil t)
659 (setq from (concat "<" 662 (setq from (concat "<"
660 (cadr (funcall gnus-extract-address-components 663 (cadr (funcall gnus-extract-address-components
661 (match-string 1))) ">"))) 664 (match-string 1))) ">")))
662 (if (re-search-forward "^Date: +\\([^(]*\\)" nil t) 665 (if (re-search-forward "^Date: +\\([^(]*\\)" nil t)