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

Re: Typing in password multiple times AND ampersands in mailbox names



Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

> Simon Josefsson <jas@pdc.kth.se> writes:
> 
> > Replace all `G e' methods with "nnimap:exchange" and the groups will
> > use the one defined in your .gnus. I know, this should be the default,
> > but I'm haven't spotted all places where Gnus add list method instead
> > of a string method so this has to be done manually some times.
>
> FYI: I have to do it manually every time I type `G m', then enter the
> group, then enter the empty string as address.  My secondary select
> method is: (nnimap "" (nnimap-address "foo"))

With this patch to Gnus (checking it into CVS now) you can either type
"nnimap:" as the select method, or "nnimap" and then press enter on
the address. Both cases should result in a select method of "nnimap:"
on the newly created group, please tell me if it didn't work.

It also make the select method a string when subscribing from the
server buffer.

1999-11-06  Simon Josefsson  <jas@pdc.kth.se>

	* gnus.el (gnus-read-method): Add methods from
	`gnus-opened-servers' to completion. Map entered method/address
	into existing methods if possible.

	* gnus-group.el (gnus-group-make-group): Simplify method.

	* gnus-srvr.el (gnus-browse-unsubscribe-group): Simplify method.

Index: gnus-group.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-group.el,v
retrieving revision 5.26
diff -w -u -r5.26 gnus-group.el
--- gnus-group.el	1999/10/23 10:52:06	5.26
+++ gnus-group.el	1999/11/05 23:35:04
@@ -1810,10 +1810,11 @@
 
   (when (stringp method)
     (setq method (or (gnus-server-to-method method) method)))
-  (let* ((meth (when (and method
+  (let* ((meth (gnus-method-simplify
+		(when (and method
 			  (not (gnus-server-equal method gnus-select-method)))
 		 (if address (list (intern method) address)
-		   method)))
+		    method))))
 	 (nname (if method (gnus-group-prefixed-name name meth) name))
 	 backend info)
     (when (gnus-gethash nname gnus-newsrc-hashtb)
Index: gnus-srvr.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-srvr.el,v
retrieving revision 5.12
diff -w -u -r5.12 gnus-srvr.el
--- gnus-srvr.el	1999/10/27 01:50:07	5.12
+++ gnus-srvr.el	1999/11/05 23:35:04
@@ -726,7 +726,8 @@
 		   nil nil (if (gnus-server-equal
 				gnus-browse-current-method "native")
 			       nil
-			     gnus-browse-current-method))
+			     (gnus-method-simplify 
+			      gnus-browse-current-method)))
 	     gnus-level-default-subscribed gnus-level-killed
 	     (and (car (nth 1 gnus-newsrc-alist))
 		  (gnus-gethash (car (nth 1 gnus-newsrc-alist))
Index: gnus.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v
retrieving revision 5.101
diff -w -u -r5.101 gnus.el
--- gnus.el	1999/11/05 19:15:14	5.101
+++ gnus.el	1999/11/05 23:35:05
@@ -2772,6 +2772,9 @@
 Allow completion over sensible values."
   (let* ((servers
 	  (append gnus-valid-select-methods
+		  (mapcar (lambda (i) (list (format "%s:%s" (caar i)
+						    (cadar i))))
+			  gnus-opened-servers)
 		  gnus-predefined-server-alist
 		  gnus-server-alist))
 	 (method
@@ -2782,11 +2785,18 @@
      ((equal method "")
       (setq method gnus-select-method))
      ((assoc method gnus-valid-select-methods)
-      (list (intern method)
-	    (if (memq 'prompt-address
+      (let ((address (if (memq 'prompt-address
 		      (assoc method gnus-valid-select-methods))
 		(read-string "Address: ")
 	      "")))
+	(or (let ((opened gnus-opened-servers))
+	      (while (and opened
+			  (not (equal (format "%s:%s" method address)
+				      (format "%s:%s" (caaar opened) 
+					      (cadaar opened)))))
+		(pop opened))
+	      (caar opened))
+	    (list (intern method) address))))
      ((assoc method servers)
       method)
      (t