diff lisp/gnus/gnus-srvr.el @ 110583:b6d2a63ad993

Merge changes made in Gnus trunk. nnimap.el: Implement partial IMAP article fetch. nnimap.el: Have nnimap not update the infos if it can't get info from the server. Implement functions for showing the complete articles. gnus-int.el (gnus-open-server): Don't query whether to go offline -- just do it. gnus-art.el (gnus-mime-delete-part): Fix plural for "byte" when there isn't a single byte. nndoc.el (nndoc-type-alist): Move mime-parts after mbox. Suggested by Jay Berkenbilt. mm-decode.el (mm-save-part): Allow saving to other directories the normal Emacs way. gnus-html.el (gnus-html-rescale-image): Use our defalias gnus-window-inside-pixel-edges. gnus-srvr.el (gnus-server-copy-server): Add documentation. gnus.texi (Using IMAP): Document the new nnimap. nnimap.el (nnimap-wait-for-response): Search further when we're not using streaming. gnus-int.el (gnus-check-server): Say what the error was when opening failed. nnheader.el (nnheader-get-report-string): New function. gnus-int.el (gnus-check-server): Use report-string. nnimap.el (nnimap-open-connection): Add more error reporting when nnimap fails early. gnus-start.el (gnus-get-unread-articles): Don't try to open failed servers twice. nnimap.el (nnimap-wait-for-response): Reversed logic in the nnimap-streaming test. gnus-art.el: Removed CTAN button stuff, which I don't think is very relevant any more. Remove NoCeM support, since nobody seems to use it any more. Remove earcon and gnus-audio. gnus.el (gnus): Silence gnus-load message. gnus-group.el (gnus-read-ephemeral-bug-group): Add the bug email address to the To list for easier response. gnus.texi (Connecting to an IMAP Server): Show how to use as primary method instead of secondary.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 26 Sep 2010 04:03:19 +0000
parents 33cf78a271ef
children 2b8ece636433
line wrap: on
line diff
--- a/lisp/gnus/gnus-srvr.el	Sun Sep 26 03:39:24 2010 +0200
+++ b/lisp/gnus/gnus-srvr.el	Sun Sep 26 04:03:19 2010 +0000
@@ -28,6 +28,7 @@
 (eval-when-compile (require 'cl))
 
 (require 'gnus)
+(require 'gnus-start)
 (require 'gnus-spec)
 (require 'gnus-group)
 (require 'gnus-int)
@@ -547,6 +548,7 @@
   (gnus-server-list-servers))
 
 (defun gnus-server-copy-server (from to)
+  "Copy a server definiton to a new name."
   (interactive
    (list
     (or (gnus-server-server-name)
@@ -643,6 +645,30 @@
 (defvar gnus-browse-menu-hook nil
   "*Hook run after the creation of the browse mode menu.")
 
+(defcustom gnus-browse-subscribe-newsgroup-method
+  'gnus-subscribe-alphabetically
+  "Function(s) called when subscribing groups in the Browse Server Buffer
+A few pre-made functions are supplied: `gnus-subscribe-randomly'
+inserts new groups at the beginning of the list of groups;
+`gnus-subscribe-alphabetically' inserts new groups in strict
+alphabetic order; `gnus-subscribe-hierarchically' inserts new groups
+in hierarchical newsgroup order; `gnus-subscribe-interactively' asks
+for your decision; `gnus-subscribe-killed' kills all new groups;
+`gnus-subscribe-zombies' will make all new groups into zombies;
+`gnus-subscribe-topics' will enter groups into the topics that
+claim them."
+  :version "24.1"
+  :group 'gnus-server
+  :type '(radio (function-item gnus-subscribe-randomly)
+		(function-item gnus-subscribe-alphabetically)
+		(function-item gnus-subscribe-hierarchically)
+		(function-item gnus-subscribe-interactively)
+		(function-item gnus-subscribe-killed)
+		(function-item gnus-subscribe-zombies)
+		(function-item gnus-subscribe-topics)
+		function
+		(repeat function)))
+
 (defvar gnus-browse-mode-hook nil)
 (defvar gnus-browse-mode-map nil)
 (put 'gnus-browse-mode 'mode-class 'special)
@@ -890,7 +916,9 @@
   (gnus-browse-next-group (- n)))
 
 (defun gnus-browse-unsubscribe-current-group (arg)
-  "(Un)subscribe to the next ARG groups."
+  "(Un)subscribe to the next ARG groups.
+The variable `gnus-browse-subscribe-newsgroup-method' determines
+how new groups will be entered into the group buffer."
   (interactive "p")
   (when (eobp)
     (error "No group at current line"))
@@ -939,22 +967,24 @@
 	    ;; subscribe to it.
  	    (if (gnus-ephemeral-group-p group)
 		(gnus-kill-ephemeral-group group))
-	    ;; We need to discern between killed/zombie groups and
-	    ;; just unsubscribed ones.
-	    (gnus-group-change-level
-	     (or (gnus-group-entry group)
-		 (list t group gnus-level-default-subscribed
-		       nil nil (if (gnus-server-equal
-				    gnus-browse-current-method "native")
-				   nil
-				 (gnus-method-simplify
-				  gnus-browse-current-method))))
-	     gnus-level-default-subscribed (gnus-group-level group)
-	     (and (car (nth 1 gnus-newsrc-alist))
-		  (gnus-group-entry (car (nth 1 gnus-newsrc-alist))))
-	     (null (gnus-group-entry group)))
+	    (let ((entry (gnus-group-entry group)))
+	      (if entry
+		  ;; Just change the subscription level if it is an
+		  ;; unsubscribed group.
+		  (gnus-group-change-level entry
+					   gnus-level-default-subscribed)
+		;; If it is a killed group or a zombie, feed it to the
+		;; mechanism for new group subscription.
+		(gnus-call-subscribe-functions
+		 gnus-browse-subscribe-newsgroup-method
+		 group)))
 	    (delete-char 1)
-	    (insert ? ))
+	    (insert (let ((lvl (gnus-group-level group)))
+		      (cond
+		       ((< lvl gnus-level-unsubscribed) ? )
+		       ((< lvl gnus-level-zombie) ?U)
+		       ((< lvl gnus-level-killed) ?Z)
+		       (t ?K)))))
 	(gnus-group-change-level
 	 group gnus-level-unsubscribed gnus-level-default-subscribed)
 	(delete-char 1)