From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64583 Path: news.gmane.org!not-for-mail From: Dan Christensen Newsgroups: gmane.emacs.gnus.general Subject: update lanl/arXiv nndoc support [patch] Date: Thu, 03 May 2007 07:51:12 -0400 Message-ID: <87ejlyt9an.fsf@uwo.ca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1178211949 19927 80.91.229.12 (3 May 2007 17:05:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 May 2007 17:05:49 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13094@lists.math.uh.edu Thu May 03 19:05:47 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1HjekL-0006Br-GR for ding-account@gmane.org; Thu, 03 May 2007 19:05:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Hjej0-0007W7-Hy; Thu, 03 May 2007 12:04:14 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1HjZqd-0006GY-B4 for ding@lists.math.uh.edu; Thu, 03 May 2007 06:51:47 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1HjZqa-00047J-Qt for ding@lists.math.uh.edu; Thu, 03 May 2007 06:51:47 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1HjZqZ-0007H0-00 for ; Thu, 03 May 2007 13:51:43 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HjZqO-0005z3-W1 for ding@gnus.org; Thu, 03 May 2007 13:51:33 +0200 Original-Received: from bas3-london14-1096779874.dsl.bell.ca ([65.95.136.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 May 2007 13:51:32 +0200 Original-Received: from jdc by bas3-london14-1096779874.dsl.bell.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 May 2007 13:51:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 82 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bas3-london14-1096779874.dsl.bell.ca User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.0.92 (gnu/linux) Cancel-Lock: sha1:tWIbm/GksczWnT9Yni6zAJ//2r4= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64583 Archived-At: --=-=-= The patch below updates the nndoc support for the messages sent by the arXiv (http://www.arxiv.org). Please apply. I have copyright assignment papers on file. About half of the patch is indentation changes. Dan --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nndoc.el.patch --- nndoc.el.orig 2007-05-02 16:26:40.000000000 -0400 +++ nndoc.el 2007-05-02 22:24:08.000000000 -0400 @@ -122,7 +122,7 @@ (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 @@ (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 @@ (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 --=-=-=--