Mercurial > emacs
comparison lisp/gnus/gnus-group.el @ 87647:b04073873562
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-985
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 08 Jan 2008 14:16:13 +0000 |
parents | cdbb1d6ce433 |
children | d5a92df16467 606f2d163a64 |
comparison
equal
deleted
inserted
replaced
87646:cd9db6999a23 | 87647:b04073873562 |
---|---|
1 ;;; gnus-group.el --- group mode commands for Gnus | 1 ;;; gnus-group.el --- group mode commands for Gnus |
2 | 2 |
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. | 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> | 6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
7 ;; Keywords: news | 7 ;; Keywords: news |
8 | 8 |
9 ;; This file is part of GNU Emacs. | 9 ;; This file is part of GNU Emacs. |
2318 ;;(error nil) | 2318 ;;(error nil) |
2319 (quit | 2319 (quit |
2320 (message "Quit reading the ephemeral group") | 2320 (message "Quit reading the ephemeral group") |
2321 nil))))) | 2321 nil))))) |
2322 | 2322 |
2323 (defvar gnus-group-gmane-group-download-format | |
2324 "http://download.gmane.org/%s/%s/%s") | |
2325 (autoload 'url-insert-file-contents "url-handlers") | |
2326 | |
2327 ;; FIXME: Make gnus-group-gmane-group-download-format customizable. Add | |
2328 ;; documentation, menu, key bindings... | |
2329 | |
2330 (defun gnus-group-read-ephemeral-gmane-group (group start end) | |
2331 "Read articles from Gmane group GROUP as an ephemeral group. | |
2332 START and END specify the articles range. The articles are | |
2333 downloaded via HTTP using the URL specified by | |
2334 `gnus-group-gmane-group-download-format'." | |
2335 ;; See <http://gmane.org/export.php> for more information. | |
2336 (interactive | |
2337 (list | |
2338 (gnus-group-completing-read "Gmane group: ") | |
2339 (read-number "Start article number: ") | |
2340 (read-number "End article number: "))) | |
2341 (when (< (- end start) 0) | |
2342 (error "Invalid range.")) | |
2343 (when (> (- end start) | |
2344 (min (or gnus-large-ephemeral-newsgroup 100) 100)) | |
2345 (unless (y-or-n-p | |
2346 (format "Large range (%s to %s), continue anyway? " | |
2347 start end)) | |
2348 (error "Range too large. Aborted."))) | |
2349 (let ((tmpfile (make-temp-file "gmane.gnus-temp-group-"))) | |
2350 (with-temp-file tmpfile | |
2351 (url-insert-file-contents | |
2352 (format gnus-group-gmane-group-download-format | |
2353 group start end)) | |
2354 (write-region (point-min) (point-max) tmpfile) | |
2355 (gnus-group-read-ephemeral-group | |
2356 "rs-gnus-read-gmane" | |
2357 `(nndoc ,tmpfile | |
2358 (nndoc-article-type guess)))) | |
2359 (delete-file tmpfile))) | |
2360 | |
2323 (defun gnus-group-jump-to-group (group &optional prompt) | 2361 (defun gnus-group-jump-to-group (group &optional prompt) |
2324 "Jump to newsgroup GROUP. | 2362 "Jump to newsgroup GROUP. |
2325 | 2363 |
2326 If PROMPT (the prefix) is a number, use the prompt specified in | 2364 If PROMPT (the prefix) is a number, use the prompt specified in |
2327 `gnus-group-jump-to-group-prompt'." | 2365 `gnus-group-jump-to-group-prompt'." |