From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/7501 Path: main.gmane.org!not-for-mail From: Jan Vroonhof Newsgroups: gmane.emacs.gnus.general Subject: rgnus 0.06 nndoc bug-fix and preprint type Date: 06 Aug 1996 22:14:34 +0200 Sender: vroonhof@math.ethz.ch Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.71) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035147805 7430 80.91.224.250 (20 Oct 2002 21:03:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:03:25 +0000 (UTC) Cc: larsi@ifi.uio.no Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id NAA08087 for ; Tue, 6 Aug 1996 13:51:46 -0700 Original-Received: from frege.math.ethz.ch (root@frege-math-bb.math.ethz.ch [129.132.148.14]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id ; Tue, 6 Aug 1996 22:15:13 +0200 Original-Received: from fresnel.math.ethz.ch (vroonhof@fresnel-d-math-south-g-servers.math.ethz.ch [129.132.145.6]) by frege.math.ethz.ch (8.6.4/Main-mathdept-mailer) with ESMTP id WAA12544; Tue, 6 Aug 1996 22:15:11 +0200 Original-Received: (vroonhof@localhost) by fresnel.math.ethz.ch (8.6.9/D-MATH-client) id WAA00428; Tue, 6 Aug 1996 22:14:35 +0200 Original-To: ding@ifi.uio.no Original-Lines: 130 X-Mailer: Red Gnus v0.6/XEmacs 19.14 Xref: main.gmane.org gmane.emacs.gnus.general:7501 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:7501 This patch (against 0.06): 1. fixes a bug in nndoc type guesses (added a sentinel value to virtual types) 2. enables slack-digest dections only if we are really looking for a digest 3. adds preprint-announcement style (only xxx.lanl.gov supported at the moment). This is a somewhat more robust version of my older patch. Detection could be better though. and here it is *** ChangeLog.orig Mon Aug 5 02:13:31 1996 --- ChangeLog Tue Aug 6 22:05:27 1996 *************** *** 1,3 **** --- 1,15 ---- + Tue Aug 6 21:58:26 1996 Jan Vroonhof + + * nndoc.el (nndoc-generate-lanl-gov-head): New function + (nndoc-transform-lanl-gov-announce): New function + (nndoc-lanl-gov-announce-type-p): New funtion + (nndoc-type-alist): Added support for preprint announcements + (nndoc-type-alist): Only use 'slack-digests' if forced to. + + Tue Aug 6 20:41:02 1996 Jan Vroonhof + + * nndoc.el (nndoc-type-alist): tried to call nndoc-guess-type-p + Mon Aug 5 01:12:24 1996 Lars Magne Ingebrigtsen * nntp.el (nntp-request-type): Defined again. *** nndoc.el.orig Wed Jul 31 03:07:55 1996 --- nndoc.el Tue Aug 6 22:05:30 1996 *************** *** 1,4 **** - ;;; nndoc.el --- single file access for Gnus ;; Copyright (C) 1995,96 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen --- 1,3 ---- *************** *** 97,107 **** (body-begin . "^ ?$") (file-end . "^End of") (prepare-body-function . nndoc-unquote-dashes) ! (subtype digest guess)) (guess ! (guess . nndoc-guess-type)) (digest ! (guess . nndoc-guess-digest-type)) )) --- 96,121 ---- (body-begin . "^ ?$") (file-end . "^End of") (prepare-body-function . nndoc-unquote-dashes) ! (subtype digest)) ;; impossible to really guess? ! (lanl-gov-announce ! (article-begin . "^\\\\\\\\\n") ! (head-begin . "^Paper.*:") ! (head-end . "^\\\\\\\\\n") ! (body-begin . "") ! (body-end . "-------------------------------------------------") ! (file-end . "^Title: Recent Seminal") ! (generate-head-function . nndoc-generate-lanl-gov-hea ! (article-transform-function . nndoc-transform-lanl-gov-announce) ! (subtype preprints guess)) (guess ! (guess . t) ! (subtype nil)) (digest ! (guess . t) ! (subtype nil)) ! (preprints ! (guess . t) ! (subtype nil)) )) *************** *** 444,449 **** --- 458,502 ---- (defun nndoc-slack-digest-type-p () 0) + (defun nndoc-lanl-gov-announce-type-p () + (when (let ((case-fold-search nil)) + (re-search-forward "^\\\\\\\\\nPaper: [a-z-]+/[0-9]+" 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)) + ;; (when (re-search-backward "^\\\\\\\\$" nil t) + ;; (replace-match "" t t)) + ) + + (defun nndoc-generate-lanl-gov-head (article) + (let ((entry (cdr (assq article nndoc-dissection-alist))) + (e-mail "no address given") + subject from) + (save-excursion + (set-buffer nndoc-current-buffer) + (save-restriction + (narrow-to-region (car entry) (nth 1 entry)) + (goto-char (point-min)) + (when (looking-at "^Paper.*: \\([a-z-]+/[0-9]+\\)") + (setq subject (concat " (" (match-string 1) ")")) + (when (re-search-forward "^From: \\([^ ]+\\)" nil t) + (setq e-mail (match-string 1))) + (when (re-search-forward "^Title: \\([^\f]*\\)\nAuthors?: \\(.*\\)" + nil t) + (setq subject (concat (match-string 1) subject)) + (setq from (concat (match-string 2) " <" e-mail ">")))) + )) + (while (string-match "(\[^)\]*)" from) + (setq from (replace-match "" t t from))) + (insert "From: " (or from "unknown") + "\nSubject: " (or subject "(no subject)") "\n"))) + + + ;;; ;;; Functions for dissecting the documents ;;;