From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/48607 Path: main.gmane.org!not-for-mail From: Jan Egil Hagen Newsgroups: gmane.emacs.gnus.general Subject: Re: nnrss-generate-download-script Date: Thu, 02 Jan 2003 21:19:51 +0100 Organization: University of Oslo, Department of Informatics Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1041538814 7063 80.91.224.249 (2 Jan 2003 20:20:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 2 Jan 2003 20:20:14 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18UBoo-0001oQ-00 for ; Thu, 02 Jan 2003 21:19:54 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18UBp7-0007HO-00; Thu, 02 Jan 2003 14:20:13 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 02 Jan 2003 14:21:06 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id OAA25000 for ; Thu, 2 Jan 2003 14:20:53 -0600 (CST) Original-Received: (qmail 6974 invoked by alias); 2 Jan 2003 20:19:56 -0000 Original-Received: (qmail 6969 invoked from network); 2 Jan 2003 20:19:56 -0000 Original-Received: from pat.uio.no (7411@129.240.130.16) by 66.230.238.6 with SMTP; 2 Jan 2003 20:19:56 -0000 Original-Received: from sjau.ifi.uio.no ([129.240.65.207]) by pat.uio.no with esmtp (Exim 2.12 #7) id 18UBom-0003r7-00 for ding@gnus.org; Thu, 2 Jan 2003 21:19:52 +0100 Original-Received: (from janha@localhost) by sjau.ifi.uio.no ; Thu, 2 Jan 2003 21:19:51 +0100 (MET) Original-To: ding@gnus.org Mail-Copies-To: Never In-Reply-To: User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (sparc-sun-solaris2.7) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:48607 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:48607 --=-=-= * Lars Magne Ingebrigtsen | Could you send a context diff instead of a plain patch? The latter | is kinda hard to read... | | (diff --unified, for instance.) Sorry, --unified wasn't supported by the version of diff I was using. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnrss.el.diff --- nnrss.el Wed Jan 1 23:25:59 2003 +++ my-nnrss.el Wed Jan 1 23:24:35 2003 @@ -164,7 +164,9 @@ "News and announcements from the Jabber Software Foundation.") )) -(defvar nnrss-use-local nil) +(defvar nnrss-use-local nil + "If true, don't download RSS feed if local version downloaded with +the script generated by nnrss-generate-download-script exists.") (defvar nnrss-description-field 'X-Gnus-Description "Field name used for DESCRIPTION. @@ -180,6 +182,14 @@ ENTRY is the record of the current headline. GROUP is the group name. ARTICLE is the article number of the current headline.") + +(defvar nnrss-wget-command "wget" +"The command used as wget in nnrss-generate-download-script") + +(defvar nnrss-generated-download-script-file + (format "%s/download-script.sh" (expand-file-name nnrss-directory)) +"Where to place the script generated by nnrss-generate-download-script") + (nnoo-define-basics nnrss) ;;; Interface functions @@ -482,7 +492,7 @@ nnrss-directory)))) (insert-file-contents file) (setq url (or (nth 2 (assoc group nnrss-server-data)) - (second (assoc group nnrss-group-alist)))) + (nth 1 (assoc group nnrss-group-alist)))) (unless url (setq url (read-string (format "RSS url of %s: " group "http://"))) @@ -541,15 +551,21 @@ "Generate a download script in the current buffer. It is useful when `(setq nnrss-use-local t)'." (interactive) - (insert "#!/bin/sh\n") - (insert "WGET=wget\n") - (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n") - (dolist (elem nnrss-server-data) - (let ((url (or (nth 2 elem) - (second (assoc (car elem) nnrss-group-alist))))) - (insert "$WGET -q -O \"$RSSDIR\"/'" - (nnrss-translate-file-chars (concat (car elem) ".xml")) - "' '" url "'\n")))) + (with-temp-buffer + (insert "#!/bin/sh\n") + (insert "WGET=" nnrss-wget-command "\n") + (insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n") + (dolist (elem nnrss-server-data) + (let ((url (or (nth 2 elem) + (nth 1 (assoc (car elem) nnrss-group-alist))))) + (insert "$WGET -q -O \"$RSSDIR\"/'" + (nnrss-translate-file-chars (concat (car elem) ".xml")) + "' '" url "' &\n"))) + (insert "wait\n") + (write-region (point-min) (point-max) + nnrss-generated-download-script-file) + (set-file-modes nnrss-generated-download-script-file 448))) + (defun nnrss-translate-file-chars (name) (let ((nnheader-file-name-translation-alist --=-=-= | See the "Writing New Back Ends" node in the Gnus manual. Thanks. I will now stop trying to understand Oort with the 5.9.0 manual. :) -- World works; done by its invalids --=-=-=--