* rgnus 0.06 nndoc bug-fix and preprint type
@ 1996-08-06 20:14 Jan Vroonhof
0 siblings, 0 replies; only message in thread
From: Jan Vroonhof @ 1996-08-06 20:14 UTC (permalink / raw)
Cc: larsi
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 <vroonhof@math.ethz.ch (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 <vroonhof@math.ethz.ch>
+
+ * nndoc.el (nndoc-type-alist): tried to call nndoc-guess-type-p
+
Mon Aug 5 01:12:24 1996 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
* 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 <larsi@ifi.uio.no>
--- 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))
))
\f
--- 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))
))
\f
***************
*** 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
;;;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-08-06 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-06 20:14 rgnus 0.06 nndoc bug-fix and preprint type Jan Vroonhof
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).