diff options
| author | Lars Magne Ingebrigtsen | 2010-11-21 07:11:35 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-11-21 07:11:35 +0000 |
| commit | e39a5583efbaa11447f89e13f3f0e5a178b95225 (patch) | |
| tree | 7946ebc9e38a22d5ee6f7c768c659b18604ef7e0 | |
| parent | bee3419feac23216cff6ffc529312da96828b2e1 (diff) | |
| download | emacs-e39a5583efbaa11447f89e13f3f0e5a178b95225.tar.gz emacs-e39a5583efbaa11447f89e13f3f0e5a178b95225.zip | |
nnimap.el (nnimap-unselect-group): Made into its own function.
(nnimap-request-rename-group): Unselect group before renaming. This had gotten lost somewhere.
(nnimap-request-accept-article): Keep track of examined groups, and unselect the group before APPENDing to read-only groups.
(nnimap-request-move-article): Clear flags before moving so that they can be re-set later.
| -rw-r--r-- | lisp/gnus/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 24 |
2 files changed, 29 insertions, 5 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5e10f34d4e1..9dbfbfb8219 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2010-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * nnimap.el (nnimap-unselect-group): Made into its own function. | ||
| 4 | (nnimap-request-rename-group): Unselect group before renaming. This | ||
| 5 | had gotten lost somewhere. | ||
| 6 | (nnimap-request-accept-article): Keep track of examined groups, and | ||
| 7 | unselect the group before APPENDing to read-only groups. | ||
| 8 | (nnimap-request-move-article): Clear flags before moving so that they | ||
| 9 | can be re-set later. | ||
| 10 | |||
| 1 | 2010-11-20 Katsumi Yamaoka <yamaoka@jpl.org> | 11 | 2010-11-20 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 12 | ||
| 3 | * gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again. | 13 | * gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again. |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index ed69c4cdab2..af58ce2468d 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -125,7 +125,7 @@ textual parts.") | |||
| 125 | 125 | ||
| 126 | (defstruct nnimap | 126 | (defstruct nnimap |
| 127 | group process commands capabilities select-result newlinep server | 127 | group process commands capabilities select-result newlinep server |
| 128 | last-command-time greeting) | 128 | last-command-time greeting examined) |
| 129 | 129 | ||
| 130 | (defvar nnimap-object nil) | 130 | (defvar nnimap-object nil) |
| 131 | 131 | ||
| @@ -727,13 +727,17 @@ textual parts.") | |||
| 727 | (deffoo nnimap-request-rename-group (group new-name &optional server) | 727 | (deffoo nnimap-request-rename-group (group new-name &optional server) |
| 728 | (when (nnimap-possibly-change-group nil server) | 728 | (when (nnimap-possibly-change-group nil server) |
| 729 | (with-current-buffer (nnimap-buffer) | 729 | (with-current-buffer (nnimap-buffer) |
| 730 | ;; Make sure we don't have this group open read/write by asking | 730 | (nnimap-unselect-group) |
| 731 | ;; to examine a mailbox that doesn't exist. This seems to be | ||
| 732 | ;; the only way that allows us to reliably go back to unselected | ||
| 733 | ;; state on Courier. | ||
| 734 | (car (nnimap-command "RENAME %S %S" | 731 | (car (nnimap-command "RENAME %S %S" |
| 735 | (utf7-encode group t) (utf7-encode new-name t)))))) | 732 | (utf7-encode group t) (utf7-encode new-name t)))))) |
| 736 | 733 | ||
| 734 | (defun nnimap-unselect-group () | ||
| 735 | ;; Make sure we don't have this group open read/write by asking | ||
| 736 | ;; to examine a mailbox that doesn't exist. This seems to be | ||
| 737 | ;; the only way that allows us to reliably go back to unselected | ||
| 738 | ;; state on Courier. | ||
| 739 | (nnimap-command "EXAMINE DOES.NOT.EXIST")) | ||
| 740 | |||
| 737 | (deffoo nnimap-request-expunge-group (group &optional server) | 741 | (deffoo nnimap-request-expunge-group (group &optional server) |
| 738 | (when (nnimap-possibly-change-group group server) | 742 | (when (nnimap-possibly-change-group group server) |
| 739 | (with-current-buffer (nnimap-buffer) | 743 | (with-current-buffer (nnimap-buffer) |
| @@ -774,6 +778,9 @@ textual parts.") | |||
| 774 | (if internal-move-group | 778 | (if internal-move-group |
| 775 | (let ((result | 779 | (let ((result |
| 776 | (with-current-buffer (nnimap-buffer) | 780 | (with-current-buffer (nnimap-buffer) |
| 781 | ;; Clear all flags before moving. | ||
| 782 | (nnimap-send-command "UID STORE %d FLAGS.SILENT ()" | ||
| 783 | article) | ||
| 777 | (nnimap-command "UID COPY %d %S" | 784 | (nnimap-command "UID COPY %d %S" |
| 778 | article | 785 | article |
| 779 | (utf7-encode internal-move-group t))))) | 786 | (utf7-encode internal-move-group t))))) |
| @@ -863,6 +870,7 @@ textual parts.") | |||
| 863 | (erase-buffer) | 870 | (erase-buffer) |
| 864 | (unless (equal group (nnimap-group nnimap-object)) | 871 | (unless (equal group (nnimap-group nnimap-object)) |
| 865 | (setf (nnimap-group nnimap-object) nil) | 872 | (setf (nnimap-group nnimap-object) nil) |
| 873 | (setf (nnimap-examined nnimap-object) group) | ||
| 866 | (nnimap-send-command "EXAMINE %S" (utf7-encode group t))) | 874 | (nnimap-send-command "EXAMINE %S" (utf7-encode group t))) |
| 867 | (let ((sequence | 875 | (let ((sequence |
| 868 | (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) | 876 | (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) |
| @@ -936,6 +944,10 @@ textual parts.") | |||
| 936 | (nnimap-add-cr) | 944 | (nnimap-add-cr) |
| 937 | (setq message (buffer-substring-no-properties (point-min) (point-max))) | 945 | (setq message (buffer-substring-no-properties (point-min) (point-max))) |
| 938 | (with-current-buffer (nnimap-buffer) | 946 | (with-current-buffer (nnimap-buffer) |
| 947 | ;; If we have this group open read-only, then unselect it | ||
| 948 | ;; before appending to it. | ||
| 949 | (when (equal (nnimap-examined nnimap-object) group) | ||
| 950 | (nnimap-unselect-group)) | ||
| 939 | (erase-buffer) | 951 | (erase-buffer) |
| 940 | (setq sequence (nnimap-send-command | 952 | (setq sequence (nnimap-send-command |
| 941 | "APPEND %S {%d}" (utf7-encode group t) | 953 | "APPEND %S {%d}" (utf7-encode group t) |
| @@ -994,6 +1006,7 @@ textual parts.") | |||
| 994 | (with-current-buffer (nnimap-buffer) | 1006 | (with-current-buffer (nnimap-buffer) |
| 995 | (setf (nnimap-group nnimap-object) nil) | 1007 | (setf (nnimap-group nnimap-object) nil) |
| 996 | (dolist (group groups) | 1008 | (dolist (group groups) |
| 1009 | (setf (nnimap-examined nnimap-object) group) | ||
| 997 | (push (list (nnimap-send-command "EXAMINE %S" (utf7-encode group t)) | 1010 | (push (list (nnimap-send-command "EXAMINE %S" (utf7-encode group t)) |
| 998 | group) | 1011 | group) |
| 999 | sequences)) | 1012 | sequences)) |
| @@ -1052,6 +1065,7 @@ textual parts.") | |||
| 1052 | active (cdr (assq 'active params)) | 1065 | active (cdr (assq 'active params)) |
| 1053 | uidvalidity (cdr (assq 'uidvalidity params)) | 1066 | uidvalidity (cdr (assq 'uidvalidity params)) |
| 1054 | modseq (cdr (assq 'modseq params))) | 1067 | modseq (cdr (assq 'modseq params))) |
| 1068 | (setf (nnimap-examined nnimap-object) group) | ||
| 1055 | (if (and qresyncp | 1069 | (if (and qresyncp |
| 1056 | uidvalidity | 1070 | uidvalidity |
| 1057 | modseq) | 1071 | modseq) |