* [Red Gnus, prototype patch] nndoc support for preprint announcements (xxx.lanl.gov)
@ 1996-07-23 9:56 Jan Vroonhof
0 siblings, 0 replies; only message in thread
From: Jan Vroonhof @ 1996-07-23 9:56 UTC (permalink / raw)
Cc: ding
Hi Lars and all,
Naturally I split the daily preprint announcements I receive into
different mailgroups. Now it occured to me that they look a lot like
digests and so they would be a nice application for nndoc.
Just to see how difficult or easy it was I tried it and low and behold
it works! It is soooooo easy! (Thanks Lars!). I have included the
patch below.
Now this is a good application of the
kibozed-collection-of-nndoc-groups-of-all-messages-in-a-group
backend-to-come of Red Gnus if there ever was one.
Jan
P.S. I just noticed that the patch does't properly defvar
nndoc-type-alist, sorry. defvar is a pain if you are debugging.
Patch:
*** /u/users/vroonhof/jvsoft/lib/xemacs/site-lisp/gnus-5.2.37/lisp/ChangeLog Fri Jul 19 01:27:46 1996
--- ChangeLog Mon Jul 22 23:11:38 1996
***************
*** 1,3 ****
--- 1,10 ----
+ Mon Jul 22 23:09:25 1996 Jan Vroonhof <vroonhof@math.ethz.ch (Jan Vroonhof)>
+
+ * nndoc.el (nndoc-type-alist): Added support for xxx.lanl.gov
+ preprint announcements
+ (nndoc-generate-preprint-announce-head): New function
+ (nndoc-transform-preprint-announce): New functions
+
Fri Jul 19 00:31:22 1996 Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
* gnus.el (gnus-subscribe-newsgroup): Add new groups to top-level
*** /u/users/vroonhof/jvsoft/lib/xemacs/site-lisp/gnus-5.2.37/lisp/nndoc.el Wed Jun 5 19:17:38 1996
--- nndoc.el Mon Jul 22 23:09:46 1996
***************
*** 43,49 ****
(defvoo nndoc-post-type 'mail
"*Whether the nndoc group is `mail' or `post'.")
! (defvar nndoc-type-alist
`((mmdf
(article-begin . "^\^A\^A\^A\^A\n")
(body-end . "^\^A\^A\^A\^A\n"))
--- 43,50 ----
(defvoo nndoc-post-type 'mail
"*Whether the nndoc group is `mail' or `post'.")
! (defvar nndoc-type-alist nil)
! (setq nndoc-type-alist
`((mmdf
(article-begin . "^\^A\^A\^A\^A\n")
(body-end . "^\^A\^A\^A\^A\n"))
***************
*** 75,80 ****
--- 76,90 ----
(head-end . "^\t")
(generate-head . nndoc-generate-clari-briefs-head)
(article-transform . nndoc-transform-clari-briefs))
+ (preprint-announce
+ (article-begin . "^\\\\\\\\\n")
+ (head-begin . "^Paper.*:")
+ (head-end . "^\\\\\\\\\n")
+ (body-begin . "")
+ (body-end . "-------------------------------------------------")
+ (file-end . "^Title: Recent Seminal")
+ (generate-head . nndoc-generate-preprint-announce-head)
+ (article-transform . nndoc-transform-preprint-announce))
(slack-digest
(article-begin . "^------------------------------*[\n \t]+")
(head-end . "^ ?$")
***************
*** 326,331 ****
--- 336,344 ----
((let ((case-fold-search nil))
(re-search-forward "^\t[^a-z]+ ([^a-z]+) --" nil t))
'clari-briefs)
+ ((let ((case-fold-search nil))
+ (re-search-forward "^\\\\\\\\\nPaper: [a-z-]+/[0-9]+" nil t))
+ 'preprint-announce)
(t
'digest)))
***************
*** 335,341 ****
nndoc-first-article
nndoc-article-end nndoc-head-begin nndoc-head-end
nndoc-file-end nndoc-article-begin
! nndoc-body-begin nndoc-body-end-function nndoc-body-end
nndoc-prepare-body nndoc-article-transform
nndoc-generate-head nndoc-body-begin-function
nndoc-head-begin-function)))
--- 348,355 ----
nndoc-first-article
nndoc-article-end nndoc-head-begin nndoc-head-end
nndoc-file-end nndoc-article-begin
! nndoc-body-begin nndoc-body-begin
! doc-body-end-function nndoc-body-end
nndoc-prepare-body nndoc-article-transform
nndoc-generate-head nndoc-body-begin-function
nndoc-head-begin-function)))
***************
*** 471,476 ****
--- 485,523 ----
(forward-line 1))
t))
+ (defun nndoc-transform-preprint-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))
+
+ ; (run-hooks 'nndoc-preprint-announce-body-prepare-hook)
+ ; (nndoc-generate-preprint-announce-head article)
+ )
+
+ (defun nndoc-generate-preprint-announce-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 subject (match-string 1)))
+ (setq from (concat (match-string 2) " <" e-mail ">"))))
+ ))
+ (insert "From: " (or from "unknown")
+ "\nSubject: " (or subject "(no subject)") "\n")))
+
+
(provide 'nndoc)
;;; nndoc.el ends here
--
Jan Vroonhof http://www.math.ethz.ch/~vroonhof/
Mathematik, vroonhof@math.ethz.ch
HG E16, ETH-Zentrum, Tel: +41-1-6325456/25154
Raemistrasse 101, CH-8092 Zuerich. Fax: +41-1-6321085
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-07-23 9:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-23 9:56 [Red Gnus, prototype patch] nndoc support for preprint announcements (xxx.lanl.gov) 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).