Changes committed gnus/lisp (ChangeLog gnus-group.el)

"Reiner Steib" <[email protected]>
Newsgroups gmane.emacs.gnus.commits
Message-ID <[email protected]>
Modified: ChangeLog gnus-group.el

(gnus-group-gmane-group-download-format): New variable.
(gnus-group-read-ephemeral-gmane-group): New command.


Index: ChangeLog
diff -u gnus/lisp/ChangeLog:7.1723 gnus/lisp/ChangeLog:7.1724
--- ChangeLog:7.1723	Fri Dec 28 23:28:12 2007
+++ ChangeLog	Sun Jan  6 11:24:29 2008
@@ -1,3 +1,8 @@
+2008-01-06  Reiner Steib  <[email protected]>
+
+	* gnus-group.el (gnus-group-gmane-group-download-format): New variable.
+	(gnus-group-read-ephemeral-gmane-group): New command.
+
 2007-12-28  Reiner Steib  <[email protected]>
 
 	* message.el (message-send-mail-function): Increase custom version.
Index: gnus-group.el
diff -u gnus/lisp/gnus-group.el:7.105 gnus/lisp/gnus-group.el:7.106
--- gnus-group.el:7.105	Sun Dec 16 05:23:18 2007
+++ gnus-group.el	Sun Jan  6 11:24:29 2008
@@ -1,7 +1,7 @@
 ;;; gnus-group.el --- group mode commands for Gnus
 
 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <[email protected]>
 ;; Keywords: news
@@ -2319,6 +2319,44 @@
 	(quit
 	 (message "Quit reading the ephemeral group")
 	 nil)))))
+
+(defvar gnus-group-gmane-group-download-format
+  "http://download.gmane.org/%s/%s/%s")
+(autoload 'url-insert-file-contents "url-handlers")
+
+;; FIXME: Make gnus-group-gmane-group-download-format customizable.  Add
+;; documentation, menu, key bindings...
+
+(defun gnus-group-read-ephemeral-gmane-group (group start end)
+  "Read articles from Gmane group GROUP as an ephemeral group.
+START and END specify the articles range.  The articles are
+downloaded via HTTP using the URL specified by
+`gnus-group-gmane-group-download-format'."
+  ;; See <http://gmane.org/export.php> for more information.
+  (interactive
+   (list
+    (gnus-group-completing-read "Gmane group: ")
+    (read-number "Start article number: ")
+    (read-number "End article number: ")))
+  (when (< (- end start) 0)
+    (error "Invalid range."))
+  (when (> (- end start)
+	   (min (or gnus-large-ephemeral-newsgroup 100) 100))
+    (unless (y-or-n-p
+	     (format "Large range (%s to %s), continue anyway? "
+		     start end))
+      (error "Range too large.  Aborted.")))
+  (let ((tmpfile (make-temp-file "gmane.gnus-temp-group-")))
+    (with-temp-file tmpfile
+      (url-insert-file-contents
+       (format gnus-group-gmane-group-download-format
+	       group start end))
+      (write-region (point-min) (point-max) tmpfile)
+      (gnus-group-read-ephemeral-group
+       "rs-gnus-read-gmane"
+       `(nndoc ,tmpfile
+	       (nndoc-article-type guess))))
+    (delete-file tmpfile)))
 
 (defun gnus-group-jump-to-group (group &optional prompt)
   "Jump to newsgroup GROUP.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.