emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gnus/gnus-group.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/gnus/gnus-group.el,v
Date: Sat, 29 Mar 2008 19:54:14 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/03/29 19:54:11

Index: lisp/gnus/gnus-group.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-group.el,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -b -r1.72 -r1.73
--- lisp/gnus/gnus-group.el     10 Mar 2008 00:50:21 -0000      1.72
+++ lisp/gnus/gnus-group.el     29 Mar 2008 19:54:10 -0000      1.73
@@ -2325,7 +2325,7 @@
         (message "Quit reading the ephemeral group")
         nil)))))
 
-(defcustom gnus-group-gmane-group-download-format
+(defcustom gnus-gmane-group-download-format
   "http://download.gmane.org/%s/%s/%s";
   "URL for downloading mbox files.
 It must contain three \"%s\".  They correspond to the group, the
@@ -2338,11 +2338,11 @@
 ;; FIXME:
 ;; - Add documentation, menu, key bindings, ...
 
-(defun gnus-group-read-ephemeral-gmane-group (group start &optional range)
+(defun gnus-read-ephemeral-gmane-group (group start &optional range)
   "Read articles from Gmane group GROUP as an ephemeral group.
 START is the first article.  RANGE specifies how many articles
 are fetched.  The articles are downloaded via HTTP using the URL
-specified by `gnus-group-gmane-group-download-format'."
+specified by `gnus-gmane-group-download-format'."
   ;; See <http://gmane.org/export.php> for more information.
   (interactive
    (list
@@ -2357,7 +2357,7 @@
        (gnus-thread-sort-functions '(gnus-thread-sort-by-number)))
     (with-temp-file tmpfile
       (url-insert-file-contents
-       (format gnus-group-gmane-group-download-format
+       (format gnus-gmane-group-download-format
               group start (+ start range)))
       (write-region (point-min) (point-max) tmpfile)
       (gnus-group-read-ephemeral-group
@@ -2366,7 +2366,7 @@
               (nndoc-article-type mbox))))
     (delete-file tmpfile)))
 
-(defun gnus-group-read-ephemeral-gmane-group-url (url)
+(defun gnus-read-ephemeral-gmane-group-url (url)
   "Create an ephemeral Gmane group from URL.
 
 Valid input formats include:
@@ -2378,7 +2378,7 @@
   ;;   be customizable?
   ;; - The URLs should be added to `gnus-button-alist'.  Probably we should
   ;;   prompt the user to decide: "View via `browse-url' or in Gnus? "
-  ;;   (`gnus-group-read-ephemeral-gmane-group-url')
+  ;;   (`gnus-read-ephemeral-gmane-group-url')
   (interactive
    (list (gnus-group-completing-read "Gmane URL: ")))
   (let (group start range)
@@ -2411,7 +2411,54 @@
            start (string-to-number (match-string 2 url))))
      (t
       (error "Can't parse URL %s" url)))
-    (gnus-group-read-ephemeral-gmane-group group start range)))
+    (gnus-read-ephemeral-gmane-group group start range)))
+
+(defcustom gnus-bug-group-download-format-alist
+  '((emacs ;; Only a test bed yet:
+     . 
"http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?mbox=yes;bug=%s";)
+    (debian
+     . "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=%s&mbox=yes";))
+  "Alist of symbols for bug trackers and the corresponding URL format string.
+The URL format string must contain a single \"%s\", specifying
+the bug number, and browsing the URL must return mbox output."
+  :group 'gnus-group-foreign
+  :version "23.1" ;; No Gnus
+  :type '(repeat (cons (symbol) (string :tag "URL format string"))))
+
+(defun gnus-read-ephemeral-bug-group (number mbox-url)
+  "Browse bug NUMBER as ephemeral group."
+  (interactive (list (read-string "Enter bug number: "
+                                 (thing-at-point 'word) nil)
+                    ;; FIXME: Add completing-read from
+                    ;; `gnus-emacs-bug-group-download-format' ...
+                    (cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
+  (when (stringp number)
+    (setq number (string-to-number number)))
+  (let ((tmpfile (make-temp-file "gnus-temp-group-")))
+    (with-temp-file tmpfile
+      (url-insert-file-contents (format mbox-url number))
+      (write-region (point-min) (point-max) tmpfile)
+      (gnus-group-read-ephemeral-group
+       "gnus-read-ephemeral-bug"
+       `(nndoc ,tmpfile
+              (nndoc-article-type mbox))))
+    (delete-file tmpfile)))
+
+(defun gnus-read-ephemeral-debian-bug-group (number)
+  "Browse Debian bug NUMBER as ephemeral group."
+  (interactive (list (read-string "Enter bug number: "
+                                 (thing-at-point 'word) nil)))
+  (gnus-read-ephemeral-bug-group
+   number
+   (cdr (assoc 'debian gnus-bug-group-download-format-alist))))
+
+(defun gnus-read-ephemeral-emacs-bug-group (number)
+  "Browse Emacs bug NUMBER as ephemeral group."
+  (interactive (list (read-string "Enter bug number: "
+                                 (thing-at-point 'word) nil)))
+  (gnus-read-ephemeral-bug-group
+   number
+   (cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
 
 (defun gnus-group-jump-to-group (group &optional prompt)
   "Jump to newsgroup GROUP.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]