X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnimap.el;h=f326f134ed4ec3d7d83d3f3c3f1e59dbad889b12;hb=6910044663bc77081e08faabd6385cd34a9c8f5d;hp=a78346c60cfeb1ac9d38df662deb12d8137251a5;hpb=27049d84774e4c9c6984be6654ce69031bd78599;p=gnus diff --git a/lisp/nnimap.el b/lisp/nnimap.el index a78346c60..f326f134e 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -117,7 +117,7 @@ some servers.") (defvoo nnimap-fetch-partial-articles nil "If non-nil, Gnus will fetch partial articles. -If t, nnimap will fetch only the first part. If a string, it +If t, Gnus will fetch only the first part. If a string, it will fetch all parts that have types that match that string. A likely value would be \"text/\" to automatically fetch all textual parts.") @@ -201,7 +201,10 @@ textual parts.") (while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r?\n" (save-excursion - (or (re-search-forward "\\* [0-9]+ FETCH" nil t) + ;; Start of the header section. + (or (re-search-forward "] {[0-9]+}\r?\n" nil t) + ;; Start of the next FETCH. + (re-search-forward "\\* [0-9]+ FETCH" nil t) (point-max))) t) (setq size (string-to-number (match-string 1))) @@ -289,7 +292,7 @@ textual parts.") (defun nnimap-make-process-buffer (buffer) (with-current-buffer - (generate-new-buffer (format "*nnimap %s %s %s*" + (generate-new-buffer (format " *nnimap %s %s %s*" nnimap-address nnimap-server-port (gnus-buffer-exists-p buffer))) (mm-disable-multibyte) @@ -865,6 +868,7 @@ textual parts.") ;; Move the article to a different method. (let ((result (eval accept-form))) (when result + (nnimap-possibly-change-group group server) (nnimap-delete-article article) result))))))) @@ -1187,7 +1191,8 @@ textual parts.") (dolist (response responses) (let* ((sequence (car response)) (response (cadr response)) - (group (cadr (assoc sequence sequences)))) + (group (cadr (assoc sequence sequences))) + (egroup (encode-coding-string group 'utf-8))) (when (and group (equal (caar response) "OK")) (let ((uidnext (nnimap-find-parameter "UIDNEXT" response)) @@ -1199,15 +1204,14 @@ textual parts.") (setq highest (1- (string-to-number (car uidnext))))) (cond ((null highest) - (insert (format "%S 0 1 y\n" (utf7-decode group t)))) + (insert (format "%S 0 1 y\n" egroup))) ((zerop exists) ;; Empty group. - (insert (format "%S %d %d y\n" - (utf7-decode group t) + (insert (format "%S %d %d y\n" egroup highest (1+ highest)))) (t ;; Return the widest possible range. - (insert (format "%S %d 1 y\n" (utf7-decode group t) + (insert (format "%S %d 1 y\n" egroup (or highest exists))))))))) t))))) @@ -1219,7 +1223,7 @@ textual parts.") (nnimap-get-groups))) (unless (assoc group nnimap-current-infos) ;; Insert dummy numbers here -- they don't matter. - (insert (format "%S 0 1 y\n" (utf7-encode group))))) + (insert (format "%S 0 1 y\n" (encode-coding-string group 'utf-8))))) t))) (deffoo nnimap-retrieve-group-data-early (server infos) @@ -1720,13 +1724,18 @@ textual parts.") (nnimap-wait-for-response nnimap-sequence)) nnimap-sequence) +(defvar nnimap-record-commands nil + "If non-nil, log commands to the \"*imap log*\" buffer.") + (defun nnimap-log-command (command) - (with-current-buffer (get-buffer-create "*imap log*") - (goto-char (point-max)) - (insert (format-time-string "%H:%M:%S") " " - (if nnimap-inhibit-logging - "(inhibited)\n" - command))) + (when nnimap-record-commands + (with-current-buffer (get-buffer-create "*imap log*") + (goto-char (point-max)) + (insert (format-time-string "%H:%M:%S") + " [" nnimap-address "] " + (if nnimap-inhibit-logging + "(inhibited)\n" + command)))) command) (defun nnimap-command (&rest args)