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

nnimap 0.3.19 released



Jim Radford's changes, mostly.

It could work with Gnus 5.5 now.

Get it from http://vic20.dzp.se/gnus-imap/nnimap.tar.gz

/s

1998-08-12 15:31:46  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap 0.3.19 released

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

	* imap4rev1.el (imap-debug): disable undo on debug-buffers.
	
	* imap4rev1.el (imap-parse-line): Accept with APPENDUID and UIDNEXT.

	* nnimap.el (nnimap-possibly-change-group): Typo, wrong
	variable name.

	* nnimap.el (nnimap-debug): disable undo on debug-buffers.

	* nnimap.el (nnimap-request-group): Return max==0
	min==1 when there is zero articles.

	* nnimap.el (nnimap-send-command-wait): We need to quote "%"s for
 	`format' within gnus-message, but I don't know how without 10
 	lines of code.  If someone knows a simple way to replace "%" with
 	"%%" in a string let me know.

	* nnimap.el (nnimap-open-server): Only use gnus-parse-netrc
	if available.  Removed some extraneous quotes that made
	edebug die.

	* nnimap.el (nnimap-possibly-change-server): use the server
 	argument if non nil, otherwise we break multiple servers.

	* nnimap.el (nnimap-possibly-change-group): don't bother using
	sending a default server to `nnimap-possibly-change-server', It uses
	the same one anyway.

	* nnimap.el (nnimap-open-server): call nnoo-change-server from
	only one place.

1998-08-11 15:19:17  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el (nnimap-request-list): server in gnus-message

1998-08-11 14:25:01  Simon Josefsson  <jas@pdc.kth.se>

	* nnimap.el: put physical-address in backend defs

diff -u nnimap-0.3.18/imap4rev1.el nnimap-0.3.19/imap4rev1.el
--- nnimap-0.3.18/imap4rev1.el	Mon Aug 10 01:01:51 1998
+++ nnimap-0.3.19/imap4rev1.el	Wed Aug 12 15:00:15 1998
@@ -165,6 +165,7 @@
 
 (when imap-debug ; (untrace-all)
   (require 'trace)
+  (buffer-disable-undo (get-buffer-create imap-debug))
   (mapc (lambda (f) (trace-function-background f imap-debug)) 
         '(imap-open-server
           imap-close-server
@@ -643,15 +644,15 @@
                    (mapconcat 'identity
                               '("\"[^\"]*\"" ; quoted strings
                                 "\\[\\|\\]" ; [] characters
-                                "UIDVALIDITY \\([0123456789]+\\)"
+                                "\\(UIDNEXT\\|UIDVALIDITY\\|APPENDUID\\) \\([0123456789]+\\)"
                                 "\\."   ; . characters
                                 "\\#"   ; # characters
                                 "\\\\"  ; \ characters
                                 "\r\n"  ; CRLF
                                 "{\\([^}]+\\)}") ; string literals
                               "\\|") nil t)) ; regexp or
-        (and (match-string 2)
-             (setq jump-amount (string-to-number (match-string 2))))
+        (and (match-string 3)
+             (setq jump-amount (string-to-number (match-string 3))))
         (let ((pc (preceding-char)))
           (cond ((eq pc ?\n)
                  (setq finished t))
@@ -665,7 +666,8 @@
                  (replace-match "}"))
                 ((and (>= pc ?0)
                       (<= pc ?9))
-                 (replace-match "UIDVALIDITY \"\\1\""))
+                 ;; replace numbers too big for emacs with strings
+                 (replace-match "\\1 \"\\2\""))
                 ((eq pc ?\})
                  (delete-region (match-beginning 0) (match-end 0))
                  (delete-char 2)
@@ -781,6 +783,8 @@
     (when var
       (cond ((equal var 'ALERT)
              (y-or-n-p (concat "IMAP: ALERT! " string)))
+            ((equal var 'APPENDUID)
+             (imap-folder-set 'appenduid (cons value (caddr code))))
             ((equal var 'PERMANENTFLAGS)
              (imap-folder-set 'permanentflags value))
             ((equal var 'READ-ONLY)
diff -u nnimap-0.3.18/nnimap.el nnimap-0.3.19/nnimap.el
--- nnimap-0.3.18/nnimap.el	Tue Aug 11 00:34:39 1998
+++ nnimap-0.3.19/nnimap.el	Wed Aug 12 15:26:23 1998
@@ -29,19 +29,14 @@
 ;;;          "yoyo"
 ;;;          (nnimap-server-address "robby.caltech.edu"))))
 
-;;; And inside Gnus, use the server buffer ('^', gnus-group-enter-server-mode)
-;;; to subscribe to mailboxes. Type '^' in the *Group* buffer, select your
-;;; IMAP server and press 'u' to subscribe.
-
-;;;  Note that there is a bug in some versions of gnus-start.el, you
-;;;  need to change 
-;;;      (while (re-search-backward "[][';?()#]" nil t)
-;;;  to
-;;;      (while (re-search-backward "[][';?()#.]" nil t)
-;;;  otherwise files that start with a dot like .mailboxes (not however
-;;;  ~/.mailboxes will give an error.
+;;; And inside Gnus, use 'U' (gnus-group-unsubscribe-group) to subscribe to
+;;; mailboxes.
 
-;;; Todo (in order of priority):
+;;; Note that Gnus can't deal with groups starting with '.' (a dot),
+;;; this means that you will have to use ~/iMail/ instead of ./iMail
+;;; (or similair).
+
+;;; Todo (roughly in order of priority):
 
 ;;;   o Verify that we don't use IMAP4rev1 specific things (RFC2060 App B)
 ;;;   o nnimap-request-close-group should do incremental flag setting
@@ -60,6 +55,7 @@
 ;;;     call it more often and from where.
 ;;;   o Add update-info calls? To request-group, close-group, retrieve-groups
 ;;;   o Add asynchronous support with two server connections (use BODY.PEEK)
+;;;   o Local storage article caching
 ;;;   o Add support for the following: (if applicable)
 
 ;;;       request-list-newsgroups, request-regenerate
@@ -92,11 +88,12 @@
 
 (eval-when-compile (require 'cl))
 
-(gnus-declare-backend "nnimap" 'mail 'respool 'address 'prompt-address) ; prompt-address???
+(gnus-declare-backend "nnimap" 'mail 'respool 'address 'prompt-address 
+		      'physical-address)
 
 (nnoo-declare nnimap) ; we derive from no one
 
-(defconst nnimap-version "nnimap 0.3.18")
+(defconst nnimap-version "nnimap 0.3.19")
 
 (defvoo nnimap-list-pattern "*" 
 "*PATTERN or list of PATTERNS use to limit available groups.  
@@ -238,6 +235,7 @@
 
 (when nnimap-debug
   (require 'trace)
+  (buffer-disable-undo (get-buffer-create nnimap-debug))
   (mapc (lambda (f) (trace-function-background f nnimap-debug))
         '(
           nnimap-close-group
@@ -342,13 +340,14 @@
           'headers)))))
 
 (deffoo nnimap-open-server (server &optional defs)
-  (or (nnimap-server-opened server)
+  (or (and (nnimap-server-opened server)
+	   (nnoo-change-server 'nnimap server defs))
       (progn
         (unless (assq 'nnimap-server-address defs)
           (push (list 'nnimap-server-address server) defs))
         (unless (assq 'nnimap-server-buffer defs)
           (push (list 'nnimap-server-buffer (concat " *nnimap* " server)) defs))
-        (nnoo-change-server 'nnimap server defs)
+	(nnoo-change-server 'nnimap server defs)
 	(let* ((pos (string-match ":" nnimap-server-address))
 	       (port (and pos 
 			  (string-to-number 
@@ -370,10 +369,13 @@
 		  (sit-for 2)
 		  (error))
 		;; Login
-		(let* ((list (gnus-parse-netrc nnimap-authinfo-file))
-		       (alist (gnus-netrc-machine list nnimap-server-address))
-		       (user (gnus-netrc-get alist "login"))
-		       (passwd (gnus-netrc-get alist "password")))
+		(let (list alist user passwd)
+                  (and (fboundp 'gnus-parse-netrc)
+                       (setq list (gnus-parse-netrc nnimap-authinfo-file)
+                             alist (gnus-netrc-machine
+				    list nnimap-server-address)
+			     user (gnus-netrc-get alist "login")
+			     passwd (gnus-netrc-get alist "password")))
 		  (with-current-buffer nnimap-server-buffer
 		    (setq imap-password passwd))
 		  (while (not (imap-login user nnimap-server-buffer))
@@ -383,9 +385,9 @@
 		    (sleep-for 2)))
 		(push (cons server nnimap-server-buffer)
 		      nnimap-server-buffer-alist))
-	    ('error (kill-buffer nnimap-server-buffer)
+	    (error (kill-buffer nnimap-server-buffer)
 		    nil)
-	    ('quit (let (imap-last-status)
+	    (quit (let (imap-last-status)
 		     (imap-close-server nnimap-server-buffer)
 		     (kill-buffer nnimap-server-buffer)
 		     nil)))))))
@@ -493,7 +495,7 @@
 	    (with-current-buffer nntp-server-buffer
 	      (erase-buffer)
 	      (insert (format "211 %d %d %d %s\n" 
-			      exists (apply 'min articles)
+			      exists (max 1 (apply 'min articles))
 			      (apply 'max articles) group)))
 	    t)))));)
 
@@ -601,7 +603,7 @@
                         (concat nnimap-list-method " "
                                 (car pattern) " "
                                 (cdr pattern)))))
-        (gnus-message 8 "Generating active list")
+        (gnus-message 8 "Generating active list for %s" server)
         (mapatoms 'nnimap-request-list-mapper imap-data-folder)))
     (setq nnimap-group-alist (nnmail-get-active))
     t))
@@ -954,13 +956,14 @@
    ","))
 
 (defun nnimap-send-command-wait (command &optional buffer)
-  (gnus-message 10 (apply 'concat
-                         (if (listp command)
-                             (mapcar
-                              (lambda (s-b) 
-                                (if (bufferp s-b) (buffer-name s-b) s-b)) 
-                              command)
-                           (list command))))
+  (unless (and (stringp command) (string-match "%" command))
+    (gnus-message 10 (apply 'concat
+			   (if (listp command)
+			       (mapcar
+				(lambda (s-b) 
+				  (if (bufferp s-b) (buffer-name s-b) s-b)) 
+				command)
+			     (list command)))))
   (imap-send-command-wait command buffer))
 
 (defun nnimap-ok-p (status)
@@ -978,13 +981,11 @@
 (defun nnimap-possibly-change-server (server)
   "Change to server SERVER if needed (open it if it's closed). If SERVER is
 nil, change to current server."
-  (and (nnimap-open-server (nnoo-current-server 'nnimap))
-       (nnoo-change-server 'nnimap (or server (nnoo-current-server 'nnimap))
-			   nil)))
+  (and (setq server (or server (nnoo-current-server 'nnimap)))
+       (nnimap-open-server server)))
 
 (defun nnimap-possibly-change-group (group &optional server)
-  (when (nnimap-possibly-change-server (or server (nnoo-current-server 
-						   'nnimap)))
+  (when (nnimap-possibly-change-server server)
     (with-current-buffer nnimap-server-buffer
       (when group
 	(unless (string= group imap-current-folder)
@@ -1008,7 +1009,7 @@
 	      (if old-uid
 		  (when (not (equal old-uid new-uid))
 		    (message "UIDVALIDITY clash. Old value `%s', new `%s'"
-			     old-uidvalidity new-uidvalidity)
+			     old-uid new-uid)
 		    (setq imap-current-folder nil))
 		(gnus-group-add-parameter groupname 
 					  (cons 'uidvalidity new-uid)))))))
diff -u nnimap-0.3.18/ChangeLog nnimap-0.3.19/ChangeLog
--- nnimap-0.3.18/ChangeLog	Tue Aug 11 00:35:21 1998
+++ nnimap-0.3.19/ChangeLog	Wed Aug 12 15:31:50 1998
@@ -1,3 +1,48 @@
+1998-08-12 15:31:46  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap 0.3.19 released
+
+1998-08-11  Jim Radford  <radford@robby.caltech.edu>
+
+	* imap4rev1.el (imap-debug): disable undo on debug-buffers.
+	
+	* imap4rev1.el (imap-parse-line): Accept with APPENDUID and UIDNEXT.
+
+	* nnimap.el (nnimap-possibly-change-group): Typo, wrong
+	variable name.
+
+	* nnimap.el (nnimap-debug): disable undo on debug-buffers.
+
+	* nnimap.el (nnimap-request-group): Return max==0
+	min==1 when there is zero articles.
+
+	* nnimap.el (nnimap-send-command-wait): We need to quote "%"s for
+ 	`format' within gnus-message, but I don't know how without 10
+ 	lines of code.  If someone knows a simple way to replace "%" with
+ 	"%%" in a string let me know.
+
+	* nnimap.el (nnimap-open-server): Only use gnus-parse-netrc
+	if available.  Removed some extraneous quotes that made
+	edebug die.
+
+	* nnimap.el (nnimap-possibly-change-server): use the server
+ 	argument if non nil, otherwise we break multiple servers.
+
+	* nnimap.el (nnimap-possibly-change-group): don't bother using
+	sending a default server to `nnimap-possibly-change-server', It uses
+	the same one anyway.
+
+	* nnimap.el (nnimap-open-server): call nnoo-change-server from
+	only one place.
+
+1998-08-11 15:19:17  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-request-list): server in gnus-message
+
+1998-08-11 14:25:01  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el: put physical-address in backend defs
+
 1998-08-11 00:35:05  Simon Josefsson  <jas@pdc.kth.se>
 
 	* nnimap 0.3.18 released