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

nnimap 0.121 -> 0.122 patches



Index: nnimap/ChangeLog
diff -c nnimap/ChangeLog:1.248 nnimap/ChangeLog:1.251
*** nnimap/ChangeLog:1.248	Mon Jul  5 07:15:27 1999
--- nnimap/ChangeLog	Tue Jul  6 06:13:02 1999
***************
*** 1,4 ****
--- 1,26 ----
+ 1999-07-06  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap 0.122 released.
+ 
+ 	* nnimap.el (nnimap-possibly-change-group): Report error.
+ 	(nnimap-request-newgroups): New function.
+ 	(nnimap-request-article-part): Report error.
+ 	(nnimap-request-group): Let n-p-c-group handle error.
+ 	(nnimap-request-newgroups): New function.
+ 
+ 1999-07-06  Jon K Hellan  <Jon.K.Hellan@item.ntnu.no>
+ 
+ 	* utf7.el (utf7-fragment-encode): Remove trailing '=' both in imap
+ 	and normal variant.
+ 	(utf7-fragment-decode): Add back trailing '=' both in imap and
+ 	normal variant.
+         (utf7-imap-fragment-decode): Remove it
+ 
  1999-07-05  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-request-group): Nnheader-report on failure.
+ 
+ 	* imap.el (imap-error-text): New function.
  
  	* nnimap 0.121 released.
  
Index: nnimap/imap.el
diff -c nnimap/imap.el:1.154 nnimap/imap.el:1.156
*** nnimap/imap.el:1.154	Mon Jul  5 02:22:40 1999
--- nnimap/imap.el	Tue Jul  6 03:41:59 1999
***************
*** 132,138 ****
  ;; o Don't use `read' at all (important places fixed)
  ;; o Accept list of articles instead of message set string in most
  ;;   imap-message-* functions.
! ;; o Sleep.
  ;;
  
  ;;; Code:
--- 132,138 ----
  ;; o Don't use `read' at all (important places fixed)
  ;; o Accept list of articles instead of message set string in most
  ;;   imap-message-* functions.
! ;; o A wrapper for Cyrus' new `imtest'
  ;;
  
  ;;; Code:
***************
*** 339,344 ****
--- 339,348 ----
        t
      (setq imap-error status)
      nil))
+ 
+ (defun imap-error-text (&optional buffer)
+   (with-current-buffer (or buffer (current-buffer))
+     (nth 3 (car imap-failed-tags))))
  
  
  ;; Server functions; stream stuff:
Index: nnimap/nnimap.el
diff -c nnimap/nnimap.el:1.197 nnimap/nnimap.el:1.202
*** nnimap/nnimap.el:1.197	Mon Jul  5 07:15:13 1999
--- nnimap/nnimap.el	Tue Jul  6 06:12:40 1999
***************
*** 24,36 ****
  
  ;;; Commentary:
  
! ;; Todo (roughly in order of priority):
  ;;
! ;;   o What about Gnus's article editing, can we support it?
  ;;   o Verify that we don't use IMAP4rev1 specific things (RFC2060 App B)
  ;;   o Dont uid fetch 1,* in nnimap-retrive-groups (slow)
  ;;   o Split up big fetches (1,* header especially) in smaller chunks
- ;;   o Use \Draft to support the draft group??
  ;;   o What do I do with gnus-newsgroup-*?
  ;;   o Tell Gnus about new groups (how can we tell?)
  ;;   o Add asynchronous support
--- 24,44 ----
  
  ;;; Commentary:
  
! ;; Todo, major things:
  ;;
! ;;   o Fix Gnus to handle leading '.' in group names (fixed?)
! ;;   o NOV cache
! ;;   o Finish disconnected mode (moving articles between mailboxes unplugged)
! ;;   o Sieve
! ;;   o MIME (partial article fetches)
! ;;   o Split to other backends, different split rules for different
! ;;     servers/inboxes
! ;;
! ;; Todo, minor things:
! ;;
  ;;   o Verify that we don't use IMAP4rev1 specific things (RFC2060 App B)
  ;;   o Dont uid fetch 1,* in nnimap-retrive-groups (slow)
  ;;   o Split up big fetches (1,* header especially) in smaller chunks
  ;;   o What do I do with gnus-newsgroup-*?
  ;;   o Tell Gnus about new groups (how can we tell?)
  ;;   o Add asynchronous support
***************
*** 40,54 ****
  ;;       request-list-newsgroups, request-regenerate
  ;;       list-active-group,
  ;;       request-associate-buffer, request-restore-buffer,
! ;;   o Do The Right Thing when UIDVALIDITY changes
! ;;   o Split to other backends, different split rules for different
! ;;     servers/inboxes
! ;;   o Fix Gnus to handle leading '.' in group names
  ;;   o Support RFC2221 (Login referrals)
  ;;   o IMAP2BIS compatibility? (RFC2061)
  ;;   o ACAP stuff (perhaps a different project, would be nice to ACAPify 
  ;;     .newsrc.eld)
! ;;   o MIME
  
  (eval-and-compile
    (require 'imap))
--- 48,60 ----
  ;;       request-list-newsgroups, request-regenerate
  ;;       list-active-group,
  ;;       request-associate-buffer, request-restore-buffer,
! ;;   o Do The Right Thing when UIDVALIDITY changes (fixed?)
  ;;   o Support RFC2221 (Login referrals)
  ;;   o IMAP2BIS compatibility? (RFC2061)
  ;;   o ACAP stuff (perhaps a different project, would be nice to ACAPify 
  ;;     .newsrc.eld)
! ;;   o What about Gnus's article editing, can we support it?
! ;;   o Use \Draft to support the draft group??
  
  (eval-and-compile
    (require 'imap))
***************
*** 65,71 ****
  (gnus-declare-backend "nnimap" 'mail 'address 'prompt-address
  		      'physical-address)
  
! (defconst nnimap-version "nnimap 0.121")
  
  (defvoo nnimap-address nil
    "Address of physical IMAP server.  If nil, use the virtual server's name.")
--- 71,77 ----
  (gnus-declare-backend "nnimap" 'mail 'address 'prompt-address
  		      'physical-address)
  
! (defconst nnimap-version "nnimap 0.122")
  
  (defvoo nnimap-address nil
    "Address of physical IMAP server.  If nil, use the virtual server's name.")
***************
*** 283,296 ****
  	    t
  	  (when imap-current-mailbox
  	    (nnimap-expunge-close-group))
! 	  (when (imap-mailbox-select group)
! 	    (if (nnimap-verify-uidvalidity group 
! 					   (or server nnimap-current-server))
! 		imap-current-mailbox
! 	      (imap-mailbox-unselect)
! 	      (gnus-message 1 "nnimap: Group %s is not uid-valid." group)
! 	      (ding)
! 	      nil)))))))
  
  (defun nnimap-replace-whitespace (string)
    "Return STRING with all whitespace replaced with space."
--- 289,303 ----
  	    t
  	  (when imap-current-mailbox
  	    (nnimap-expunge-close-group))
! 	  (if (imap-mailbox-select group)
! 	      (if (nnimap-verify-uidvalidity group 
! 					     (or server nnimap-current-server))
! 		  imap-current-mailbox
! 		(imap-mailbox-unselect)
! 		(gnus-message 1 "nnimap: Group %s is not uid-valid." group)
! 		(ding)
! 		nil)
! 	    (nnheader-report 'nnimap (imap-error-text))))))))
  
  (defun nnimap-replace-whitespace (string)
    "Return STRING with all whitespace replaced with space."
***************
*** 509,515 ****
  	(gnus-message 9 "nnimap: Fetching (part of) article %d...done"
  		      article))
        (if (bobp)
! 	  (nnheader-report 'nnimap "No such article")
  	(cons group article)))))
  
  (deffoo nnimap-request-article (article &optional group server to-buffer)
--- 516,523 ----
  	(gnus-message 9 "nnimap: Fetching (part of) article %d...done"
  		      article))
        (if (bobp)
! 	  (nnheader-report 'nnimap "No such article: %s"
! 			   (imap-error-text nnimap-server-buffer))
  	(cons group article)))))
  
  (deffoo nnimap-request-article (article &optional group server to-buffer)
***************
*** 772,777 ****
--- 780,804 ----
  (deffoo nnimap-request-scan (&optional group server)
    (nnimap-split-articles group server))
  
+ (deffoo nnimap-request-newgroups (date &optional server)
+   (when (nnimap-possibly-change-server server)
+     (with-current-buffer nntp-server-buffer
+       (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s..."
+ 		    (if (> (length server) 0) " on " "") server)
+       (erase-buffer)
+       (dolist (pattern (nnimap-pattern-to-list-arguments 
+ 			nnimap-list-pattern))
+ 	(dolist (mbx (imap-mailbox-lsub nnimap-server-buffer (car pattern)))
+ 	  (or (member "\\NoSelect" 
+ 		      (imap-mailbox-get 'list-flags mbx nnimap-server-buffer))
+ 	      ;; Escape SPC in mailboxes xxx relies on gnus internals
+ 	      ;; We lie about high/low article number
+ 	      (insert (format "%s 0 1 y\n" 
+ 			      (nnimap-replace-in-string mbx " " "\\ "))))))
+       (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s...done"
+ 		    (if (> (length server) 0) " on " "") server))
+     t))
+       
  (deffoo nnimap-request-create-group (group &optional server args)
    (when (nnimap-possibly-change-server server)
      (or (imap-mailbox-status group 'uidvalidity nnimap-server-buffer)
***************
*** 1083,1088 ****
--- 1110,1116 ----
    (buffer-disable-undo (get-buffer-create nnimap-debug))
    (mapc (lambda (f) (trace-function-background f nnimap-debug))
          '(
+ nnimap-replace-in-string
  nnimap-possibly-change-server
  nnimap-verify-uidvalidity
  nnimap-find-minmax-uid
***************
*** 1091,1096 ****
--- 1119,1126 ----
  nnimap-retrieve-headers-progress
  nnimap-retrieve-headers-store-uids
  nnimap-retrieve-headers-get-uids
+ nnimap-group-overview-filename
+ nnimap-retrieve-headers-from-file
  nnimap-retrieve-headers
  nnimap-open-connection
  nnimap-open-server
***************
*** 1110,1115 ****
--- 1140,1146 ----
  nnimap-request-list
  nnimap-request-post
  nnimap-retrieve-groups
+ nnimap-request-update-info-internal
  nnimap-request-type
  nnimap-request-set-mark
  nnimap-split-to-groups
***************
*** 1117,1122 ****
--- 1148,1154 ----
  nnimap-split-find-inbox
  nnimap-split-articles
  nnimap-request-scan
+ nnimap-request-newgroups
  nnimap-request-create-group
  nnimap-time-substract
  nnimap-date-days-ago
***************
*** 1130,1140 ****
  gnus-group-nnimap-edit-acl
  gnus-group-nnimap-edit-acl-done
  nnimap-group-mode-hook
- nnimap-request-update-info-internal
  nnimap-mark-to-predicate
  nnimap-mark-to-flag-1
  nnimap-mark-to-flag
  nnimap-mark-permanent-p
  nnimap-update-alist-soft
  nnimap-range-to-string
            )))
--- 1162,1172 ----
  gnus-group-nnimap-edit-acl
  gnus-group-nnimap-edit-acl-done
  nnimap-group-mode-hook
  nnimap-mark-to-predicate
  nnimap-mark-to-flag-1
  nnimap-mark-to-flag
  nnimap-mark-permanent-p
+ nnimap-remassoc
  nnimap-update-alist-soft
  nnimap-range-to-string
            )))
Index: nnimap/utf7.el
diff -c nnimap/utf7.el:1.4 nnimap/utf7.el:1.5
*** nnimap/utf7.el:1.4	Sat Jun 26 07:51:06 1999
--- nnimap/utf7.el	Tue Jul  6 04:23:30 1999
***************
*** 34,40 ****
  ;;; to represent characters outside US-ASCII in mailbox names in IMAP.
  ;;; This library supports both variants, but the IMAP variation was the
  ;;; reason I wrote it. 
! ;;; The routines convert UTF-7 -> UTF-16 (16 bit Unicode) 
  ;;; -> current character set, and vice versa. 
  ;;; However, until Emacs supports Unicode, the only Emacs character set
  ;;; supported here is ISO-8859.1, which can trivially be converted to/from
--- 34,40 ----
  ;;; to represent characters outside US-ASCII in mailbox names in IMAP.
  ;;; This library supports both variants, but the IMAP variation was the
  ;;; reason I wrote it. 
! ;;; The routines convert UTF-7 -> UTF-16 (16 bit encoding of Unicode) 
  ;;; -> current character set, and vice versa. 
  ;;; However, until Emacs supports Unicode, the only Emacs character set
  ;;; supported here is ISO-8859.1, which can trivially be converted to/from
***************
*** 85,100 ****
      (narrow-to-region start end)
      (funcall (utf7-get-u16char-converter 'to-utf-16))
      (base64-encode-region start (point-max))
      (let ((pm (point-max)))
!       (if for-imap 
! 	  (progn
! 	    (goto-char start)
! 	    (while (search-forward "," nil t)
! 	      (replace-match "/"))
! 	    (skip-chars-forward "^= \t\n" pm))
! 	(goto-char pm)
! 	(skip-chars-backward " \t\n"))
!       ;; We strip whitespace at end, because base64 may include garbage.
        (delete-region (point) pm))))
  
  (defun utf7-decode-internal (&optional for-imap)
--- 85,96 ----
      (narrow-to-region start end)
      (funcall (utf7-get-u16char-converter 'to-utf-16))
      (base64-encode-region start (point-max))
+     (goto-char start)
      (let ((pm (point-max)))
!       (when for-imap 
! 	(while (search-forward "," nil t)
! 	  (replace-match "/")))
!       (skip-chars-forward "^= \t\n" pm)
        (delete-region (point) pm))))
  
  (defun utf7-decode-internal (&optional for-imap)
***************
*** 125,144 ****
  Use IMAP modification if FOR-IMAP is non-nil."
    (save-restriction
      (narrow-to-region start end)
!     (if for-imap
! 	(utf7-imap-fragment-decode start end)
!       (base64-decode-region start end))
      (funcall (utf7-get-u16char-converter 'from-utf-16))))
  
- (defun utf7-imap-fragment-decode (start end)
-   "Decode base64 encoded fragment from START to END of UTF-7 text in buffer.
- Use IMAP modification."
-   (goto-char start)
-   (while (search-forward "," nil 'move-to-end) (replace-match "/"))
-   (let ((pl (utf7-imap-get-pad-length (- end start) 4)))
-     (insert (make-string pl ?=))
-     (base64-decode-region start (+ end pl))))
- 
  (defun utf7-get-u16char-converter (which-way)
    "Return a function to convert between UTF-16 and current character set."
    ;; Add test to check if we are really Latin-1.
--- 121,134 ----
  Use IMAP modification if FOR-IMAP is non-nil."
    (save-restriction
      (narrow-to-region start end)
!     (when for-imap
!       (goto-char start)
!       (while (search-forward "," nil 'move-to-end) (replace-match "/")))
!     (let ((pl (utf7-imap-get-pad-length (- end start) 4)))
!       (insert (make-string pl ?=))
!       (base64-decode-region start (+ end pl)))
      (funcall (utf7-get-u16char-converter 'from-utf-16))))
  
  (defun utf7-get-u16char-converter (which-way)
    "Return a function to convert between UTF-16 and current character set."
    ;; Add test to check if we are really Latin-1.
***************
*** 149,155 ****
  
  (defun utf7-latin1-u16-char-converter ()
    "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode.
! Character are in character pairs in narrowed buffer."
    (goto-char (point-min))
    (while (not (eobp))
      (insert 0)
--- 139,145 ----
  
  (defun utf7-latin1-u16-char-converter ()
    "Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode.
! Characters are converted to raw byte pairs in narrowed buffer."
    (goto-char (point-min))
    (while (not (eobp))
      (insert 0)
***************
*** 157,163 ****
  
  (defun utf7-u16-latin1-char-converter ()
    "Convert 16 bit Unicode characters to latin 1 (ISO-8859.1).
! Characters are in character pairs in narrowed buffer."
    (goto-char (point-min))
    (while (not (eobp))
      (if (= 0 (following-char))
--- 147,153 ----
  
  (defun utf7-u16-latin1-char-converter ()
    "Convert 16 bit Unicode characters to latin 1 (ISO-8859.1).
! Characters are in raw byte pairs in narrowed buffer."
    (goto-char (point-min))
    (while (not (eobp))
      (if (= 0 (following-char))