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

nnimap 0.35 -> 0.36 patches



Index: nnimap/ChangeLog
diff -u nnimap/ChangeLog:1.105 nnimap/ChangeLog:1.109
--- nnimap/ChangeLog:1.105	Thu Oct 15 18:17:26 1998
+++ nnimap/ChangeLog	Sun Oct 18 13:59:13 1998
@@ -1,3 +1,41 @@
+1998-10-18 22:56:28  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap 0.36 released.
+
+1998-10-18 22:01:59  Simon Josefsson  <jas@pdc.kth.se>
+
+	* imap.el (imap-folder-subscribe):
+	(imap-folder-unsubscribe): Typo.
+
+1998-10-18 21:59:31  Simon Josefsson  <jas@pdc.kth.se>
+
+	* imap.el (imap-folder-map): Return list of function values.
+	(imap-folder-lsub):
+	(imap-folder-list):
+	(imap-folder-subscribe):
+	(imap-folder-unsubscribe): New functions.
+	(imap-cb-list): Mailbox flags are always strings.
+
+1998-10-18 19:34:21  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-split-to-groups): Fold continuation lines.
+
+1998-10-18 18:55:19  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-request-article-part): Need to symbol-function
+	for subrp to work.
+
+1998-10-17 23:41:56  Keisuke Mori <ksk@ntts.com>
+
+	* nnimap.el (nnimap-request-article-part): Make sure
+	string-as-multibyte is a built-in function.
+
+1998-10-16 13:33:13  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-expunge-close-group):
+	(nnimap-authenticate): 
+	(nnimap-update-flags-hook): Removed unused variables.
+
 1998-10-16 03:15:18  Simon Josefsson  <jas@pdc.kth.se>
 
 	* nnimap 0.35 released.
Index: nnimap/imap.el
diff -u nnimap/imap.el:1.48 nnimap/imap.el:1.50
--- nnimap/imap.el:1.48	Thu Oct 15 18:11:18 1998
+++ nnimap/imap.el	Sun Oct 18 13:04:01 1998
@@ -566,6 +566,46 @@
 	    imap-message-data nil)
       t)))
 
+(defun imap-folder-lsub (&optional reference buffer)
+  "Return a list of strings of subscribed mailboxes on server in
+BUFFER. REFERENCE is the implementation-specific string that has to be
+passed to LSUB."
+  (with-current-buffer (or buffer (current-buffer))
+    (imap-folder-reset)
+    (when (imap-ok-p (imap-send-command-wait 
+		      (concat "LSUB \"" reference "\" \"*\"")))
+      (imap-folder-map 'identity))))
+
+(defun imap-folder-list (&optional root have-delimiter reference buffer)
+  "List all mailboxes that starts with ROOT in BUFFER. If
+HAVE-DELIMITER is non-nil, a hierarchy delimiter is not added to
+ROOT. REFERENCE is the implementation-specific string that has to be
+passed to LIST."
+  (with-current-buffer (or buffer (current-buffer))
+    (imap-folder-reset)
+    ;; Find hierarchy separator
+    (unless have-delimiter
+      (imap-send-command-wait (concat "LIST \"" reference "\" \"" root "\"")))
+    (when (imap-ok-p 
+	   (imap-send-command-wait 
+	    (concat "LIST \"" reference "\" \"" root
+		    (when (and (not have-delimiter) root)
+		      (imap-folder-get 'delimiter root))
+		    "%\"")))
+      (imap-folder-map 'identity))))
+
+(defun imap-folder-subscribe (mailbox &optional buffer)
+  "Send the SUBSCRIBE command on the mailbox to server in
+BUFFER. Returns non-nil if successful."
+  (with-current-buffer (or buffer (current-buffer))
+    (imap-ok-p (imap-send-command-wait (concat "SUBSCRIBE " mailbox)))))
+
+(defun imap-folder-unsubscribe (mailbox &optional buffer)
+  "Send the SUBSCRIBE command on the mailbox to server in
+BUFFER. Returns non-nil if successful."
+  (with-current-buffer (or buffer (current-buffer))
+    (imap-ok-p (imap-send-command-wait (concat "UNSUBSCRIBE " mailbox)))))
+
 ;;; Variable setters and getters
 
 (defun imap-capability-get (&optional buffer)
@@ -605,12 +645,15 @@
                      imap-current-folder) imap-data-folder) prop)))
 
 (defun imap-folder-map (func &optional buffer)
-  "Call (func FOLDER) for each folder in `imap-data-folder'."
+  "Call (func FOLDER) for each folder in `imap-data-folder', returning
+a sequence."
   (with-current-buffer (or buffer (current-buffer))
-    (mapatoms 
-     (lambda (s)
-       (funcall func (symbol-name s)))
-     imap-data-folder)))
+    (let (result)
+      (mapatoms 
+       (lambda (s)
+	 (push (funcall func (symbol-name s)) result))
+       imap-data-folder)
+      result)))
 
 (defun imap-folder-reset (&optional buffer)
   (with-current-buffer (or buffer (current-buffer)) 
@@ -912,7 +955,7 @@
   (let ((name (if (symbolp name-symbol-or-string)
                   (symbol-name name-symbol-or-string)
                 name-symbol-or-string)))
-    (imap-folder-set 'flags taglist name)
+    (imap-folder-set 'flags (mapcar 'symbol-name taglist) name)
     (imap-folder-set 'delimiter delim name)
     (when (eq code 'LSUB) 
       (imap-folder-set 'subbed t name))))
Index: nnimap/nnimap.el
diff -u nnimap/nnimap.el:1.82 nnimap/nnimap.el:1.87
--- nnimap/nnimap.el:1.82	Thu Oct 15 16:47:39 1998
+++ nnimap/nnimap.el	Sun Oct 18 13:58:56 1998
@@ -95,7 +95,7 @@
 
 (nnoo-declare nnimap) ; we derive from no one
 
-(defconst nnimap-version "nnimap 0.35")
+(defconst nnimap-version "nnimap 0.36")
 
 ;; Various server variables.
 
@@ -387,7 +387,7 @@
 (defun nnimap-authenticate (server &optional buffer)
   (with-current-buffer (or buffer (current-buffer))
     ;; Login
-    (let (list alist user passwd ok)
+    (let (list alist ok)
       (and (fboundp 'gnus-parse-netrc)
 	   (setq list (gnus-parse-netrc nnimap-authinfo-file)
 		 alist (or (and (gnus-netrc-get (gnus-netrc-machine 
@@ -529,7 +529,7 @@
         ;; Find the article by number
         (nnimap-send-command-wait (format "UID FETCH %d (%s%s)" article part
 					  (if add-peek ".PEEK" "")))
-        (let ((text (funcall (if (fboundp 'string-as-multibyte)
+        (let ((text (funcall (if (subrp (symbol-function 'string-as-multibyte))
 				 'string-as-multibyte
 			       'identity) (imap-message-get article part))))
           (with-current-buffer (or to-buffer nntp-server-buffer)
@@ -801,6 +801,10 @@
       (mapcar (lambda (rule) 
 		(let ((group (car rule))
 		      (regexp (cadr rule)))
+		  ;; Fold continuation lines.
+		  (goto-char (point-min))
+		  (while (re-search-forward "\\(\r?\n[ \t]+\\)+" nil t)
+		    (replace-match " " t t))
 		  (goto-char (point-min))
 		  (when (re-search-forward regexp nil t)
 		    (setq to-groups (cons group to-groups)))))
@@ -1170,7 +1174,7 @@
 	    ((eq nnimap-expunge-on-close 'never)
 	     (imap-unselect-folder))
 	    ((eq nnimap-expunge-on-close 'ask)
-	     (let ((deleted (imap-search "DELETED")))
+	     (when (imap-search "DELETED")
 	       (if (gnus-y-or-n-p (format "Expunge articles in group `%s'? "
 					  imap-current-folder))
 		   (and (nnimap-ok-p (nnimap-send-command-wait "EXPUNGE"))
@@ -1334,7 +1338,7 @@
 	;; Update marks.
 	
 	(let ((types gnus-article-mark-lists) 
-	      type list old-mark new-mark add del)
+	      type old-mark new-mark add del)
 	  (while (setq type (cdr (pop types)))
 	    ;; cache, score, bookmark are not proper flags.
 	    (unless (memq type '(cache score bookmark))