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

[PATCH] Ephemeral support




In case you didn't know, you can open a group read-only (ephemerally)
by doing C-M-RET.  This makes it actually work.

1998-08-12  Jim Radford  <radford@robby.caltech.edu>

	* nnimap.el (nnimap-possibly-change-group): Fixed emphemeral
	support by passing normally qualifed name for `gnus-ephemeral-p'.

diff -u nnimap.el~ nnimap.el
--- nnimap.el~	Wed Aug 12 21:53:49 1998
+++ nnimap.el	Wed Aug 12 21:53:49 1998
@@ -989,33 +997,33 @@
 
 (defun nnimap-possibly-change-group (group &optional server)
   (when (nnimap-possibly-change-server server)
+    (setq server (or server (nnoo-current-server 'nnimap)))
     (with-current-buffer nnimap-server-buffer
       (when group
 	(unless (string= group imap-current-folder)
 	  (setq imap-message-data (make-vector 199 0)) ; itty bitty obarray???
 	  ;; Folder must be set during SELECT
 	  (setq imap-current-folder group)
-	  (if (not (nnimap-ok-p (nnimap-send-command-wait
-				 (concat (if (gnus-ephemeral-group-p group)
-					     "EXAMINE"
-					   "SELECT")
-					 " " group))))
-	      ;; Failed SELECT unselects the current group
-	      (setq imap-current-folder nil)
-	    ;; check/set UIDVALIDITY
-	    (let* ((groupname (gnus-group-normally-qualified
-			       'nnimap
-			       (or server (nnoo-current-server 'nnimap))
-			       group))
-		   (new-uid (imap-folder-get 'uidvalidity))
-		   (old-uid (gnus-group-get-parameter groupname 'uidvalidity)))
-	      (if old-uid
-		  (when (not (equal old-uid new-uid))
-		    (message "UIDVALIDITY clash. Old value `%s', new `%s'"
-			     old-uid new-uid)
-		    (setq imap-current-folder nil))
-		(gnus-group-add-parameter groupname 
-					  (cons 'uidvalidity new-uid)))))))
+          (let ((groupname (gnus-group-normally-qualified
+                            'nnimap server group)))
+            (if (not (nnimap-ok-p (nnimap-send-command-wait
+                                   (concat (if (gnus-ephemeral-group-p
+                                                groupname)
+                                               "EXAMINE"
+                                             "SELECT")
+                                           " " group))))
+                ;; Failed SELECT unselects the current group
+                (setq imap-current-folder nil)
+              ;; check/set UIDVALIDITY
+              (let ((new-uid (imap-folder-get 'uidvalidity))
+                    (old-uid (gnus-group-get-parameter groupname 'uidvalidity)))
+                (if old-uid
+                    (when (not (equal old-uid new-uid))
+                      (message "UIDVALIDITY clash. Old value `%s', new `%s'"
+                               old-uid new-uid)
+                      (setq imap-current-folder nil))
+                  (gnus-group-add-parameter groupname 
+                                            (cons 'uidvalidity new-uid))))))))
       imap-current-folder)))
 
 ;;; Other functions