diff options
| author | Katsumi Yamaoka | 2010-03-23 07:37:09 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-03-23 07:37:09 +0000 |
| commit | ec7995fa614cc47343697d8fe62e0fa4a118df97 (patch) | |
| tree | 29b269830f5d19e034b598f63e9eef93f68315f6 | |
| parent | 1888398e25e7f329992efca189aeba21f6697465 (diff) | |
| download | emacs-ec7995fa614cc47343697d8fe62e0fa4a118df97.tar.gz emacs-ec7995fa614cc47343697d8fe62e0fa4a118df97.zip | |
Synch with Gnus trunk
=====================
2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-art.el (canlock-verify): Autoload it for Emacs 21.
* message.el (ecomplete-setup): Autoload it for Emacs <23.
* mml-sec.el (mml-secure-cache-passphrase): Default to t that is
password-cache's default if it is not bound.
(mml-secure-passphrase-cache-expiry): Default to 16 that is
password-cache-expiry's default if it is not bound.
* pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not
available in Emacs 21.
2010-03-23 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el (auth-sources): Fix up definition so extra parameters
are always inline.
2010-03-22 Martin Stjernholm <mast@lysator.liu.se>
* nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity
wasn't updated after mismatch. Clear cached mailbox info correctly
when uidvalidity changes.
(nnimap-group-prefixed-name): New function to avoid some code
duplication.
(nnimap-verify-uidvalidity, nnimap-group-overview-filename)
(nnimap-request-group): Use it.
(nnimap-retrieve-groups, nnimap-verify-uidvalidity)
(nnimap-update-unseen): Significantly improved speed of Gnus startup
with many imap folders. This is done by caching the group status from
the imap server persistently in a group parameter `imap-status'. (This
was cached before too if `nnimap-retrieve-groups-asynchronous' was set,
but not persistently, so every Gnus startup was still very slow.)
2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el: Set up autoloads. Bump to 23.2 because of the
secrets.el dependency.
(auth-sources): Add optional user name. Add secrets.el configuration
choice (unused right now).
2010-03-20 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-sum.el (gnus-summary-make-menu-bar): Let
`gnus-registry-install-shortcuts' fill in the functions.
* gnus-registry.el (gnus-summary-misc-menu): Declare to avoid
warnings.
(gnus-registry-misc-menus): Variable to hold registry mark menus.
(gnus-registry-install-shortcuts): Populate and use it in a
`gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks".
2010-03-20 Martin Stjernholm <mast@lysator.liu.se>
* nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name):
In-place substitutions for the group name encoding/decoding.
(nnimap-find-minmax-uid, nnimap-possibly-change-group)
(nnimap-retrieve-headers-progress, nnimap-possibly-change-group)
(nnimap-retrieve-headers-progress, nnimap-request-article-part)
(nnimap-update-unseen, nnimap-request-list)
(nnimap-retrieve-groups, nnimap-request-update-info-internal)
(nnimap-request-set-mark, nnimap-split-to-groups)
(nnimap-split-articles, nnimap-request-newgroups)
(nnimap-request-create-group, nnimap-request-accept-article)
(nnimap-request-delete-group, nnimap-request-rename-group)
(nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with
`encoded-mbx' for consistency.
(nnimap-close-group): Call `imap-current-mailbox' instead of using the
variable `imap-current-mailbox'.
* gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers)
(gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'.
2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs>
* pop3.el (pop3-display-message-size-flag): Display message size byte
counts during POP3 download.
(pop3-movemail): Use it.
(pop3-list): Implement listing of available messages.
2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change)
* nnir.el (nnir-get-article-nov-override-function): New function to
override the normal NOV retrieval.
(nnir-retrieve-headers): Use it.
| -rw-r--r-- | lisp/gnus/ChangeLog | 87 | ||||
| -rw-r--r-- | lisp/gnus/auth-source.el | 40 | ||||
| -rw-r--r-- | lisp/gnus/gnus-agent.el | 14 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 33 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 12 | ||||
| -rw-r--r-- | lisp/gnus/message.el | 2 | ||||
| -rw-r--r-- | lisp/gnus/mml-sec.el | 10 | ||||
| -rw-r--r-- | lisp/gnus/nnimap.el | 289 | ||||
| -rw-r--r-- | lisp/gnus/nnir.el | 52 | ||||
| -rw-r--r-- | lisp/gnus/pop3.el | 43 |
11 files changed, 414 insertions, 170 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 58d1c0dc8da..59b3ae87d80 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,90 @@ | |||
| 1 | 2010-03-23 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-art.el (canlock-verify): Autoload it for Emacs 21. | ||
| 4 | |||
| 5 | * message.el (ecomplete-setup): Autoload it for Emacs <23. | ||
| 6 | |||
| 7 | * mml-sec.el (mml-secure-cache-passphrase): Default to t that is | ||
| 8 | password-cache's default if it is not bound. | ||
| 9 | (mml-secure-passphrase-cache-expiry): Default to 16 that is | ||
| 10 | password-cache-expiry's default if it is not bound. | ||
| 11 | |||
| 12 | * pop3.el (pop3-list): Don't use 3rd arg of `split-string' which is not | ||
| 13 | available in Emacs 21. | ||
| 14 | |||
| 15 | 2010-03-23 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 16 | |||
| 17 | * auth-source.el (auth-sources): Fix up definition so extra parameters | ||
| 18 | are always inline. | ||
| 19 | |||
| 20 | 2010-03-22 Martin Stjernholm <mast@lysator.liu.se> | ||
| 21 | |||
| 22 | * nnimap.el (nnimap-verify-uidvalidity): Fixed bug where uidvalidity | ||
| 23 | wasn't updated after mismatch. Clear cached mailbox info correctly | ||
| 24 | when uidvalidity changes. | ||
| 25 | (nnimap-group-prefixed-name): New function to avoid some code | ||
| 26 | duplication. | ||
| 27 | (nnimap-verify-uidvalidity, nnimap-group-overview-filename) | ||
| 28 | (nnimap-request-group): Use it. | ||
| 29 | (nnimap-retrieve-groups, nnimap-verify-uidvalidity) | ||
| 30 | (nnimap-update-unseen): Significantly improved speed of Gnus startup | ||
| 31 | with many imap folders. This is done by caching the group status from | ||
| 32 | the imap server persistently in a group parameter `imap-status'. (This | ||
| 33 | was cached before too if `nnimap-retrieve-groups-asynchronous' was set, | ||
| 34 | but not persistently, so every Gnus startup was still very slow.) | ||
| 35 | |||
| 36 | 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 37 | |||
| 38 | * auth-source.el: Set up autoloads. Bump to 23.2 because of the | ||
| 39 | secrets.el dependency. | ||
| 40 | (auth-sources): Add optional user name. Add secrets.el configuration | ||
| 41 | choice (unused right now). | ||
| 42 | |||
| 43 | 2010-03-20 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 44 | |||
| 45 | * gnus-sum.el (gnus-summary-make-menu-bar): Let | ||
| 46 | `gnus-registry-install-shortcuts' fill in the functions. | ||
| 47 | |||
| 48 | * gnus-registry.el (gnus-summary-misc-menu): Declare to avoid | ||
| 49 | warnings. | ||
| 50 | (gnus-registry-misc-menus): Variable to hold registry mark menus. | ||
| 51 | (gnus-registry-install-shortcuts): Populate and use it in a | ||
| 52 | `gnus-summary-menu-hook' lambda, under "Gnus"->"Registry Marks". | ||
| 53 | |||
| 54 | 2010-03-20 Martin Stjernholm <mast@lysator.liu.se> | ||
| 55 | |||
| 56 | * nnimap.el (nnimap-decode-group-name, nnimap-encode-group-name): | ||
| 57 | In-place substitutions for the group name encoding/decoding. | ||
| 58 | (nnimap-find-minmax-uid, nnimap-possibly-change-group) | ||
| 59 | (nnimap-retrieve-headers-progress, nnimap-possibly-change-group) | ||
| 60 | (nnimap-retrieve-headers-progress, nnimap-request-article-part) | ||
| 61 | (nnimap-update-unseen, nnimap-request-list) | ||
| 62 | (nnimap-retrieve-groups, nnimap-request-update-info-internal) | ||
| 63 | (nnimap-request-set-mark, nnimap-split-to-groups) | ||
| 64 | (nnimap-split-articles, nnimap-request-newgroups) | ||
| 65 | (nnimap-request-create-group, nnimap-request-accept-article) | ||
| 66 | (nnimap-request-delete-group, nnimap-request-rename-group) | ||
| 67 | (nnimap-acl-get, nnimap-acl-edit): Use them. Replace `mbx' with | ||
| 68 | `encoded-mbx' for consistency. | ||
| 69 | (nnimap-close-group): Call `imap-current-mailbox' instead of using the | ||
| 70 | variable `imap-current-mailbox'. | ||
| 71 | |||
| 72 | * gnus-agent.el (gnus-agent-fetch-articles, gnus-agent-fetch-headers) | ||
| 73 | (gnus-agent-regenerate-group): Use `gnus-agent-decoded-group-name'. | ||
| 74 | |||
| 75 | 2010-03-20 Bojan Petrovic <bpetrovi@f.bg.ac.rs> | ||
| 76 | |||
| 77 | * pop3.el (pop3-display-message-size-flag): Display message size byte | ||
| 78 | counts during POP3 download. | ||
| 79 | (pop3-movemail): Use it. | ||
| 80 | (pop3-list): Implement listing of available messages. | ||
| 81 | |||
| 82 | 2010-03-20 Mark Triggs <mst@dishevelled.net> (tiny change) | ||
| 83 | |||
| 84 | * nnir.el (nnir-get-article-nov-override-function): New function to | ||
| 85 | override the normal NOV retrieval. | ||
| 86 | (nnir-retrieve-headers): Use it. | ||
| 87 | |||
| 1 | 2010-03-19 Michael Albinus <michael.albinus@gmx.de> | 88 | 2010-03-19 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 89 | ||
| 3 | * auth-source.el (netrc-machine-user-or-password): Autoload. | 90 | * auth-source.el (netrc-machine-user-or-password): Autoload. |
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 82c9ea8a44d..3b0d700a86f 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el | |||
| @@ -35,6 +35,9 @@ | |||
| 35 | 35 | ||
| 36 | (eval-when-compile (require 'cl)) | 36 | (eval-when-compile (require 'cl)) |
| 37 | (autoload 'netrc-machine-user-or-password "netrc") | 37 | (autoload 'netrc-machine-user-or-password "netrc") |
| 38 | (autoload 'secrets-search-items "secrets") | ||
| 39 | (autoload 'secrets-get-alias "secrets") | ||
| 40 | (autoload 'secrets-get-attribute "secrets") | ||
| 38 | 41 | ||
| 39 | (defgroup auth-source nil | 42 | (defgroup auth-source nil |
| 40 | "Authentication sources." | 43 | "Authentication sources." |
| @@ -49,7 +52,7 @@ | |||
| 49 | "List of authentication protocols and their names" | 52 | "List of authentication protocols and their names" |
| 50 | 53 | ||
| 51 | :group 'auth-source | 54 | :group 'auth-source |
| 52 | :version "23.1" ;; No Gnus | 55 | :version "23.2" ;; No Gnus |
| 53 | :type '(repeat :tag "Authentication Protocols" | 56 | :type '(repeat :tag "Authentication Protocols" |
| 54 | (cons :tag "Protocol Entry" | 57 | (cons :tag "Protocol Entry" |
| 55 | (symbol :tag "Protocol") | 58 | (symbol :tag "Protocol") |
| @@ -71,7 +74,7 @@ | |||
| 71 | (defcustom auth-source-do-cache t | 74 | (defcustom auth-source-do-cache t |
| 72 | "Whether auth-source should cache information." | 75 | "Whether auth-source should cache information." |
| 73 | :group 'auth-source | 76 | :group 'auth-source |
| 74 | :version "23.1" ;; No Gnus | 77 | :version "23.2" ;; No Gnus |
| 75 | :type `boolean) | 78 | :type `boolean) |
| 76 | 79 | ||
| 77 | (defcustom auth-source-debug nil | 80 | (defcustom auth-source-debug nil |
| @@ -85,7 +88,7 @@ If the value is t, debug messages are logged with `message'. | |||
| 85 | If the value is a function, debug messages are logged by calling | 88 | If the value is a function, debug messages are logged by calling |
| 86 | that function using the same arguments as `message'." | 89 | that function using the same arguments as `message'." |
| 87 | :group 'auth-source | 90 | :group 'auth-source |
| 88 | :version "23.1" ;; No Gnus | 91 | :version "23.2" ;; No Gnus |
| 89 | :type `(choice | 92 | :type `(choice |
| 90 | :tag "auth-source debugging mode" | 93 | :tag "auth-source debugging mode" |
| 91 | (const :tag "Log using `message' to the *Messages* buffer" t) | 94 | (const :tag "Log using `message' to the *Messages* buffer" t) |
| @@ -96,19 +99,32 @@ If the value is a function, debug messages are logged by calling | |||
| 96 | "Whether auth-source should hide passwords in log messages. | 99 | "Whether auth-source should hide passwords in log messages. |
| 97 | Only relevant if `auth-source-debug' is not nil." | 100 | Only relevant if `auth-source-debug' is not nil." |
| 98 | :group 'auth-source | 101 | :group 'auth-source |
| 99 | :version "23.1" ;; No Gnus | 102 | :version "23.2" ;; No Gnus |
| 100 | :type `boolean) | 103 | :type `boolean) |
| 101 | 104 | ||
| 102 | (defcustom auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)) | 105 | (defcustom auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)) |
| 103 | "List of authentication sources. | 106 | "List of authentication sources. |
| 104 | 107 | ||
| 105 | Each entry is the authentication type with optional properties." | 108 | Each entry is the authentication type with optional properties. |
| 109 | |||
| 110 | It's best to customize this with `M-x customize-variable' because the choices | ||
| 111 | can get pretty complex." | ||
| 106 | :group 'auth-source | 112 | :group 'auth-source |
| 107 | :version "23.1" ;; No Gnus | 113 | :version "23.2" ;; No Gnus |
| 108 | :type `(repeat :tag "Authentication Sources" | 114 | :type `(repeat :tag "Authentication Sources" |
| 109 | (list :tag "Source definition" | 115 | (list :tag "Source definition" |
| 110 | (const :format "" :value :source) | 116 | (const :format "" :value :source) |
| 111 | (string :tag "Authentication Source") | 117 | (choice :tag "Authentication backend choice" |
| 118 | (string :tag "Authentication Source (file)") | ||
| 119 | (list :tag "secrets.el (Secret Service API/KWallet/GNOME KeyRing)" | ||
| 120 | (const :format "" :value :secrets) | ||
| 121 | (choice :tag "Collection to use" | ||
| 122 | (string :tag "Collection name") | ||
| 123 | (const :tag "Default" 'default) | ||
| 124 | (const :tag "Any" t) | ||
| 125 | (const :tag "Temporary" "session") | ||
| 126 | (string :tag "Specific session name") | ||
| 127 | (const :tag "Fallback" nil)))) | ||
| 112 | (const :format "" :value :host) | 128 | (const :format "" :value :host) |
| 113 | (choice :tag "Host (machine) choice" | 129 | (choice :tag "Host (machine) choice" |
| 114 | (const :tag "Any" t) | 130 | (const :tag "Any" t) |
| @@ -118,7 +134,15 @@ Each entry is the authentication type with optional properties." | |||
| 118 | (choice :tag "Protocol" | 134 | (choice :tag "Protocol" |
| 119 | (const :tag "Any" t) | 135 | (const :tag "Any" t) |
| 120 | (const :tag "Fallback" nil) | 136 | (const :tag "Fallback" nil) |
| 121 | ,@auth-source-protocols-customize)))) | 137 | ,@auth-source-protocols-customize) |
| 138 | (repeat :tag "Extra Parameters" :inline t | ||
| 139 | (choice :tag "Extra parameter" | ||
| 140 | (list :tag "Preferred username" :inline t | ||
| 141 | (const :format "" :value :preferred-username) | ||
| 142 | (choice :tag "Personality or username" | ||
| 143 | (const :tag "Any" t) | ||
| 144 | (const :tag "Fallback" nil) | ||
| 145 | (string :tag "Specific user name")))))))) | ||
| 122 | 146 | ||
| 123 | ;; temp for debugging | 147 | ;; temp for debugging |
| 124 | ;; (unintern 'auth-source-protocols) | 148 | ;; (unintern 'auth-source-protocols) |
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index f385c71069b..17f1d0cdb1f 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el | |||
| @@ -1583,7 +1583,8 @@ downloaded into the agent." | |||
| 1583 | (setq selected-sets (nreverse selected-sets)) | 1583 | (setq selected-sets (nreverse selected-sets)) |
| 1584 | 1584 | ||
| 1585 | (gnus-make-directory dir) | 1585 | (gnus-make-directory dir) |
| 1586 | (gnus-message 7 "Fetching articles for %s..." group) | 1586 | (gnus-message 7 "Fetching articles for %s..." |
| 1587 | (gnus-agent-decoded-group-name group)) | ||
| 1587 | 1588 | ||
| 1588 | (unwind-protect | 1589 | (unwind-protect |
| 1589 | (while (setq articles (pop selected-sets)) | 1590 | (while (setq articles (pop selected-sets)) |
| @@ -1594,7 +1595,8 @@ downloaded into the agent." | |||
| 1594 | (let (article) | 1595 | (let (article) |
| 1595 | (while (setq article (pop articles)) | 1596 | (while (setq article (pop articles)) |
| 1596 | (gnus-message 10 "Fetching article %s for %s..." | 1597 | (gnus-message 10 "Fetching article %s for %s..." |
| 1597 | article group) | 1598 | article |
| 1599 | (gnus-agent-decoded-group-name group)) | ||
| 1598 | (when (or | 1600 | (when (or |
| 1599 | (gnus-backlog-request-article group article | 1601 | (gnus-backlog-request-article group article |
| 1600 | nntp-server-buffer) | 1602 | nntp-server-buffer) |
| @@ -1942,7 +1944,8 @@ article numbers will be returned." | |||
| 1942 | 1944 | ||
| 1943 | (if articles | 1945 | (if articles |
| 1944 | (progn | 1946 | (progn |
| 1945 | (gnus-message 7 "Fetching headers for %s..." group) | 1947 | (gnus-message 7 "Fetching headers for %s..." |
| 1948 | (gnus-agent-decoded-group-name group)) | ||
| 1946 | 1949 | ||
| 1947 | ;; Fetch them. | 1950 | ;; Fetch them. |
| 1948 | (gnus-make-directory (nnheader-translate-file-chars | 1951 | (gnus-make-directory (nnheader-translate-file-chars |
| @@ -3904,7 +3907,7 @@ If REREAD is not nil, downloaded articles are marked as unread." | |||
| 3904 | (sit-for 1) | 3907 | (sit-for 1) |
| 3905 | t))))) | 3908 | t))))) |
| 3906 | (when group | 3909 | (when group |
| 3907 | (gnus-message 5 "Regenerating in %s" group) | 3910 | (gnus-message 5 "Regenerating in %s" (gnus-agent-decoded-group-name group)) |
| 3908 | (let* ((gnus-command-method (or gnus-command-method | 3911 | (let* ((gnus-command-method (or gnus-command-method |
| 3909 | (gnus-find-method-for-group group))) | 3912 | (gnus-find-method-for-group group))) |
| 3910 | (file (gnus-agent-article-name ".overview" group)) | 3913 | (file (gnus-agent-article-name ".overview" group)) |
| @@ -3981,7 +3984,8 @@ If REREAD is not nil, downloaded articles are marked as unread." | |||
| 3981 | (or (not nov-arts) | 3984 | (or (not nov-arts) |
| 3982 | (> (car downloaded) (car nov-arts)))) | 3985 | (> (car downloaded) (car nov-arts)))) |
| 3983 | ;; This entry is missing from the overview file | 3986 | ;; This entry is missing from the overview file |
| 3984 | (gnus-message 3 "Regenerating NOV %s %d..." group | 3987 | (gnus-message 3 "Regenerating NOV %s %d..." |
| 3988 | (gnus-agent-decoded-group-name group) | ||
| 3985 | (car downloaded)) | 3989 | (car downloaded)) |
| 3986 | (let ((file (concat dir (number-to-string (car downloaded))))) | 3990 | (let ((file (concat dir (number-to-string (car downloaded))))) |
| 3987 | (mm-with-unibyte-buffer | 3991 | (mm-with-unibyte-buffer |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 1a66404f841..b3b156f69dc 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -4192,6 +4192,8 @@ If variable `gnus-use-long-file-name' is non-nil, it is | |||
| 4192 | (put-text-property (match-end 0) (point-max) | 4192 | (put-text-property (match-end 0) (point-max) |
| 4193 | 'face eface))))))))) | 4193 | 'face eface))))))))) |
| 4194 | 4194 | ||
| 4195 | (autoload 'canlock-verify "canlock" nil t) ;; for Emacs 21. | ||
| 4196 | |||
| 4195 | (defun article-verify-cancel-lock () | 4197 | (defun article-verify-cancel-lock () |
| 4196 | "Verify Cancel-Lock header." | 4198 | "Verify Cancel-Lock header." |
| 4197 | (interactive) | 4199 | (interactive) |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index e77b66e150d..db10440116b 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -60,6 +60,7 @@ | |||
| 60 | (require 'gnus-sum) | 60 | (require 'gnus-sum) |
| 61 | (require 'gnus-util) | 61 | (require 'gnus-util) |
| 62 | (require 'nnmail) | 62 | (require 'nnmail) |
| 63 | (require 'easymenu) | ||
| 63 | 64 | ||
| 64 | (defvar gnus-adaptive-word-syntax-table) | 65 | (defvar gnus-adaptive-word-syntax-table) |
| 65 | 66 | ||
| @@ -137,6 +138,10 @@ references.'" | |||
| 137 | (const :tag "Always Install" t) | 138 | (const :tag "Always Install" t) |
| 138 | (const :tag "Ask Me" ask))) | 139 | (const :tag "Ask Me" ask))) |
| 139 | 140 | ||
| 141 | (defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning. | ||
| 142 | |||
| 143 | (defvar gnus-registry-misc-menus nil) ; ugly way to keep the menus | ||
| 144 | |||
| 140 | (defcustom gnus-registry-clean-empty t | 145 | (defcustom gnus-registry-clean-empty t |
| 141 | "Whether the empty registry entries should be deleted. | 146 | "Whether the empty registry entries should be deleted. |
| 142 | Registry entries are considered empty when they have no groups | 147 | Registry entries are considered empty when they have no groups |
| @@ -764,7 +769,8 @@ FUNCTION should take two parameters, a mark symbol and the cell value." | |||
| 764 | "Install the keyboard shortcuts and menus for the registry. | 769 | "Install the keyboard shortcuts and menus for the registry. |
| 765 | Uses `gnus-registry-marks' to find what shortcuts to install." | 770 | Uses `gnus-registry-marks' to find what shortcuts to install." |
| 766 | (let (keys-plist) | 771 | (let (keys-plist) |
| 767 | (gnus-registry-do-marks | 772 | (setq gnus-registry-misc-menus nil) |
| 773 | (gnus-registry-do-marks | ||
| 768 | :char | 774 | :char |
| 769 | (lambda (mark data) | 775 | (lambda (mark data) |
| 770 | (let ((function-format | 776 | (let ((function-format |
| @@ -813,19 +819,34 @@ Uses `gnus-registry-marks' to find what shortcuts to install." | |||
| 813 | ;; all this just to get the mark, I must be doing it wrong | 819 | ;; all this just to get the mark, I must be doing it wrong |
| 814 | (intern ,(symbol-name mark)) | 820 | (intern ,(symbol-name mark)) |
| 815 | articles ,remove t) | 821 | articles ,remove t) |
| 822 | (gnus-message | ||
| 823 | 9 | ||
| 824 | "Applying mark %s to %d articles" | ||
| 825 | ,(symbol-name mark) (length articles)) | ||
| 816 | (dolist (article articles) | 826 | (dolist (article articles) |
| 817 | (gnus-summary-update-article | 827 | (gnus-summary-update-article |
| 818 | article | 828 | article |
| 819 | (assoc article (gnus-data-list nil))))))) | 829 | (assoc article (gnus-data-list nil))))))) |
| 820 | (push (intern function-name) keys-plist) | 830 | (push (intern function-name) keys-plist) |
| 821 | (push shortcut keys-plist) | 831 | (push shortcut keys-plist) |
| 822 | (gnus-message | 832 | (push (vector (format "%s %s" |
| 833 | (upcase-initials variant-name) | ||
| 834 | (symbol-name mark)) | ||
| 835 | (intern function-name) t) | ||
| 836 | gnus-registry-misc-menus) | ||
| 837 | (gnus-message | ||
| 823 | 9 | 838 | 9 |
| 824 | "Defined mark handling function %s" | 839 | "Defined mark handling function %s" |
| 825 | function-name)))))) | 840 | function-name)))))) |
| 826 | (gnus-define-keys-1 | 841 | (gnus-define-keys-1 |
| 827 | '(gnus-registry-mark-map "M" gnus-summary-mark-map) | 842 | '(gnus-registry-mark-map "M" gnus-summary-mark-map) |
| 828 | keys-plist))) | 843 | keys-plist) |
| 844 | (add-hook 'gnus-summary-menu-hook | ||
| 845 | (lambda () | ||
| 846 | (easy-menu-add-item | ||
| 847 | gnus-summary-misc-menu | ||
| 848 | nil | ||
| 849 | (cons "Registry Marks" gnus-registry-misc-menus)))))) | ||
| 829 | 850 | ||
| 830 | ;;; use like this: | 851 | ;;; use like this: |
| 831 | ;;; (defalias 'gnus-user-format-function-M | 852 | ;;; (defalias 'gnus-user-format-function-M |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 2464b132839..608224e436d 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -2635,17 +2635,6 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) | |||
| 2635 | ["Set expirable mark" gnus-summary-mark-as-expirable t] | 2635 | ["Set expirable mark" gnus-summary-mark-as-expirable t] |
| 2636 | ["Set bookmark" gnus-summary-set-bookmark t] | 2636 | ["Set bookmark" gnus-summary-set-bookmark t] |
| 2637 | ["Remove bookmark" gnus-summary-remove-bookmark t]) | 2637 | ["Remove bookmark" gnus-summary-remove-bookmark t]) |
| 2638 | ("Registry Mark" | ||
| 2639 | ["Important" gnus-registry-set-article-Important-mark t] | ||
| 2640 | ["Not Important" gnus-registry-remove-article-Important-mark t] | ||
| 2641 | ["Work" gnus-registry-set-article-Work-mark t] | ||
| 2642 | ["Not Work" gnus-registry-remove-article-Work-mark t] | ||
| 2643 | ["Later" gnus-registry-set-article-Later-mark t] | ||
| 2644 | ["Not Later" gnus-registry-remove-article-Later-mark t] | ||
| 2645 | ["Personal" gnus-registry-set-article-Personal-mark t] | ||
| 2646 | ["Not Personal" gnus-registry-remove-article-Personal-mark t] | ||
| 2647 | ["To Do" gnus-registry-set-article-To-Do-mark t] | ||
| 2648 | ["Not To Do" gnus-registry-remove-article-To-Do-mark t]) | ||
| 2649 | ("Limit to" | 2638 | ("Limit to" |
| 2650 | ["Marks..." gnus-summary-limit-to-marks t] | 2639 | ["Marks..." gnus-summary-limit-to-marks t] |
| 2651 | ["Subject..." gnus-summary-limit-to-subject t] | 2640 | ["Subject..." gnus-summary-limit-to-subject t] |
| @@ -2691,6 +2680,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) | |||
| 2691 | gnus-newsgroup-process-stack] | 2680 | gnus-newsgroup-process-stack] |
| 2692 | ["Save" gnus-summary-save-process-mark t] | 2681 | ["Save" gnus-summary-save-process-mark t] |
| 2693 | ["Run command on marked..." gnus-summary-universal-argument t])) | 2682 | ["Run command on marked..." gnus-summary-universal-argument t])) |
| 2683 | ("Registry Marks") | ||
| 2694 | ("Scroll article" | 2684 | ("Scroll article" |
| 2695 | ["Page forward" gnus-summary-next-page | 2685 | ["Page forward" gnus-summary-next-page |
| 2696 | ,@(if (featurep 'xemacs) '(t) | 2686 | ,@(if (featurep 'xemacs) '(t) |
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index abdc163bb16..03a4a40a66f 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el | |||
| @@ -2850,6 +2850,8 @@ See also `message-forbidden-properties'." | |||
| 2850 | (inhibit-read-only t)) | 2850 | (inhibit-read-only t)) |
| 2851 | (remove-text-properties begin end message-forbidden-properties)))) | 2851 | (remove-text-properties begin end message-forbidden-properties)))) |
| 2852 | 2852 | ||
| 2853 | (autoload 'ecomplete-setup "ecomplete") ;; for Emacs <23. | ||
| 2854 | |||
| 2853 | ;;;###autoload | 2855 | ;;;###autoload |
| 2854 | (define-derived-mode message-mode text-mode "Message" | 2856 | (define-derived-mode message-mode text-mode "Message" |
| 2855 | "Major mode for editing mail and news to be sent. | 2857 | "Major mode for editing mail and news to be sent. |
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index e394593ec12..35155b89ac2 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el | |||
| @@ -105,12 +105,18 @@ details." | |||
| 105 | :group 'message | 105 | :group 'message |
| 106 | :type 'boolean) | 106 | :type 'boolean) |
| 107 | 107 | ||
| 108 | (defcustom mml-secure-cache-passphrase password-cache | 108 | (defcustom mml-secure-cache-passphrase |
| 109 | (if (boundp 'password-cache) | ||
| 110 | password-cache | ||
| 111 | t) | ||
| 109 | "If t, cache passphrase." | 112 | "If t, cache passphrase." |
| 110 | :group 'message | 113 | :group 'message |
| 111 | :type 'boolean) | 114 | :type 'boolean) |
| 112 | 115 | ||
| 113 | (defcustom mml-secure-passphrase-cache-expiry password-cache-expiry | 116 | (defcustom mml-secure-passphrase-cache-expiry |
| 117 | (if (boundp 'password-cache-expiry) | ||
| 118 | password-cache-expiry | ||
| 119 | 16) | ||
| 114 | "How many seconds the passphrase is cached. | 120 | "How many seconds the passphrase is cached. |
| 115 | Whether the passphrase is cached at all is controlled by | 121 | Whether the passphrase is cached at all is controlled by |
| 116 | `mml-secure-cache-passphrase'." | 122 | `mml-secure-cache-passphrase'." |
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index b939f50e0fc..c76169cb2b7 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el | |||
| @@ -501,6 +501,20 @@ See also `nnimap-log'." | |||
| 501 | 501 | ||
| 502 | ;; Utility functions: | 502 | ;; Utility functions: |
| 503 | 503 | ||
| 504 | (defsubst nnimap-decode-group-name (group) | ||
| 505 | (and group | ||
| 506 | (gnus-group-decoded-name group))) | ||
| 507 | |||
| 508 | (defsubst nnimap-encode-group-name (group) | ||
| 509 | (and group | ||
| 510 | (mm-encode-coding-string group (gnus-group-name-charset nil group)))) | ||
| 511 | |||
| 512 | (defun nnimap-group-prefixed-name (group &optional server) | ||
| 513 | (gnus-group-prefixed-name group | ||
| 514 | (gnus-server-to-method | ||
| 515 | (format "nnimap:%s" | ||
| 516 | (or server nnimap-current-server))))) | ||
| 517 | |||
| 504 | (defsubst nnimap-get-server-buffer (server) | 518 | (defsubst nnimap-get-server-buffer (server) |
| 505 | "Return buffer for SERVER, if nil use current server." | 519 | "Return buffer for SERVER, if nil use current server." |
| 506 | (cadr (assoc (or server nnimap-current-server) nnimap-server-buffer-alist))) | 520 | (cadr (assoc (or server nnimap-current-server) nnimap-server-buffer-alist))) |
| @@ -521,9 +535,7 @@ If SERVER is nil, uses the current server." | |||
| 521 | 535 | ||
| 522 | (defun nnimap-verify-uidvalidity (group server) | 536 | (defun nnimap-verify-uidvalidity (group server) |
| 523 | "Verify stored uidvalidity match current one in GROUP on SERVER." | 537 | "Verify stored uidvalidity match current one in GROUP on SERVER." |
| 524 | (let* ((gnusgroup (gnus-group-prefixed-name | 538 | (let* ((gnusgroup (nnimap-group-prefixed-name group server)) |
| 525 | group (gnus-server-to-method | ||
| 526 | (format "nnimap:%s" server)))) | ||
| 527 | (new-uidvalidity (imap-mailbox-get 'uidvalidity)) | 539 | (new-uidvalidity (imap-mailbox-get 'uidvalidity)) |
| 528 | (old-uidvalidity (gnus-group-get-parameter gnusgroup 'uidvalidity)) | 540 | (old-uidvalidity (gnus-group-get-parameter gnusgroup 'uidvalidity)) |
| 529 | (dir (file-name-as-directory (expand-file-name nnimap-directory))) | 541 | (dir (file-name-as-directory (expand-file-name nnimap-directory))) |
| @@ -544,10 +556,18 @@ If SERVER is nil, uses the current server." | |||
| 544 | (if old-uidvalidity | 556 | (if old-uidvalidity |
| 545 | (if (not (equal old-uidvalidity new-uidvalidity)) | 557 | (if (not (equal old-uidvalidity new-uidvalidity)) |
| 546 | ;; uidvalidity clash | 558 | ;; uidvalidity clash |
| 547 | (gnus-delete-file file) | 559 | (progn |
| 548 | (gnus-group-set-parameter gnusgroup 'uidvalidity new-uidvalidity) | 560 | (gnus-group-set-parameter gnusgroup 'uidvalidity new-uidvalidity) |
| 561 | (gnus-group-remove-parameter gnusgroup 'imap-status) | ||
| 562 | (gnus-sethash (gnus-group-prefixed-name group server) | ||
| 563 | nil nnimap-mailbox-info) | ||
| 564 | (gnus-delete-file file)) | ||
| 549 | t) | 565 | t) |
| 550 | (gnus-group-add-parameter gnusgroup (cons 'uidvalidity new-uidvalidity)) | 566 | (gnus-group-add-parameter gnusgroup (cons 'uidvalidity new-uidvalidity)) |
| 567 | (gnus-group-remove-parameter gnusgroup 'imap-status) | ||
| 568 | (gnus-sethash ; Maybe not necessary here. | ||
| 569 | (gnus-group-prefixed-name group server) | ||
| 570 | nil nnimap-mailbox-info) | ||
| 551 | t))) | 571 | t))) |
| 552 | 572 | ||
| 553 | (defun nnimap-before-find-minmax-bugworkaround () | 573 | (defun nnimap-before-find-minmax-bugworkaround () |
| @@ -563,36 +583,39 @@ If SERVER is nil, uses the current server." | |||
| 563 | "Find lowest and highest active article number in GROUP. | 583 | "Find lowest and highest active article number in GROUP. |
| 564 | If EXAMINE is non-nil the group is selected read-only." | 584 | If EXAMINE is non-nil the group is selected read-only." |
| 565 | (with-current-buffer nnimap-server-buffer | 585 | (with-current-buffer nnimap-server-buffer |
| 566 | (when (or (string= group (imap-current-mailbox)) | 586 | (let ((decoded-group (nnimap-decode-group-name group))) |
| 567 | (imap-mailbox-select group examine)) | 587 | (when (or (string= decoded-group (imap-current-mailbox)) |
| 568 | (let (minuid maxuid) | 588 | (imap-mailbox-select decoded-group examine)) |
| 569 | (when (> (imap-mailbox-get 'exists) 0) | 589 | (let (minuid maxuid) |
| 570 | (imap-fetch-safe '("1,*" . "1,*:*") "UID" nil 'nouidfetch) | 590 | (when (> (imap-mailbox-get 'exists) 0) |
| 571 | (imap-message-map (lambda (uid Uid) | 591 | (imap-fetch-safe '("1,*" . "1,*:*") "UID" nil 'nouidfetch) |
| 572 | (setq minuid (if minuid (min minuid uid) uid) | 592 | (imap-message-map (lambda (uid Uid) |
| 573 | maxuid (if maxuid (max maxuid uid) uid))) | 593 | (setq minuid (if minuid (min minuid uid) uid) |
| 574 | 'UID)) | 594 | maxuid (if maxuid (max maxuid uid) uid))) |
| 575 | (list (imap-mailbox-get 'exists) minuid maxuid))))) | 595 | 'UID)) |
| 596 | (list (imap-mailbox-get 'exists) minuid maxuid)))))) | ||
| 576 | 597 | ||
| 577 | (defun nnimap-possibly-change-group (group &optional server) | 598 | (defun nnimap-possibly-change-group (group &optional server) |
| 578 | "Make GROUP the current group, and SERVER the current server." | 599 | "Make GROUP the current group, and SERVER the current server." |
| 579 | (when (nnimap-possibly-change-server server) | 600 | (when (nnimap-possibly-change-server server) |
| 580 | (with-current-buffer nnimap-server-buffer | 601 | (let ((decoded-group (nnimap-decode-group-name group))) |
| 581 | (if (or (null group) (imap-current-mailbox-p group)) | 602 | (with-current-buffer nnimap-server-buffer |
| 582 | imap-current-mailbox | 603 | (if (or (null group) (imap-current-mailbox-p decoded-group)) |
| 583 | (if (imap-mailbox-select group) | 604 | imap-current-mailbox ; Note: utf-7 encoded. |
| 584 | (if (or (nnimap-verify-uidvalidity | 605 | (if (imap-mailbox-select decoded-group) |
| 585 | group (or server nnimap-current-server)) | 606 | (if (or (nnimap-verify-uidvalidity |
| 586 | (zerop (imap-mailbox-get 'exists group)) | 607 | group (or server nnimap-current-server)) |
| 587 | t ;; for OGnus to see if ignoring uidvalidity | 608 | (zerop (imap-mailbox-get 'exists decoded-group)) |
| 588 | ;; changes has any bad effects. | 609 | t ;; for OGnus to see if ignoring uidvalidity |
| 589 | (yes-or-no-p | 610 | ;; changes has any bad effects. |
| 590 | (format | 611 | (yes-or-no-p |
| 591 | "nnimap: Group %s is not uidvalid. Continue? " group))) | 612 | (format |
| 592 | imap-current-mailbox | 613 | "nnimap: Group %s is not uidvalid. Continue? " |
| 593 | (imap-mailbox-unselect) | 614 | decoded-group))) |
| 594 | (error "nnimap: Group %s is not uid-valid" group)) | 615 | imap-current-mailbox ; Note: utf-7 encoded. |
| 595 | (nnheader-report 'nnimap (imap-error-text))))))) | 616 | (imap-mailbox-unselect) |
| 617 | (error "nnimap: Group %s is not uid-valid" decoded-group)) | ||
| 618 | (nnheader-report 'nnimap (imap-error-text)))))))) | ||
| 596 | 619 | ||
| 597 | (defun nnimap-replace-whitespace (string) | 620 | (defun nnimap-replace-whitespace (string) |
| 598 | "Return STRING with all whitespace replaced with space." | 621 | "Return STRING with all whitespace replaced with space." |
| @@ -618,7 +641,7 @@ If EXAMINE is non-nil the group is selected read-only." | |||
| 618 | (let (headers lines chars uid mbx) | 641 | (let (headers lines chars uid mbx) |
| 619 | (with-current-buffer nnimap-server-buffer | 642 | (with-current-buffer nnimap-server-buffer |
| 620 | (setq uid imap-current-message | 643 | (setq uid imap-current-message |
| 621 | mbx imap-current-mailbox | 644 | mbx (nnimap-encode-group-name (imap-current-mailbox)) |
| 622 | headers (if (imap-capability 'IMAP4rev1) | 645 | headers (if (imap-capability 'IMAP4rev1) |
| 623 | ;; xxx don't just use car? alist doesn't contain | 646 | ;; xxx don't just use car? alist doesn't contain |
| 624 | ;; anything else now, but it might... | 647 | ;; anything else now, but it might... |
| @@ -665,9 +688,7 @@ If EXAMINE is non-nil the group is selected read-only." | |||
| 665 | "Make file name for GROUP on SERVER." | 688 | "Make file name for GROUP on SERVER." |
| 666 | (let* ((dir (file-name-as-directory (expand-file-name nnimap-directory))) | 689 | (let* ((dir (file-name-as-directory (expand-file-name nnimap-directory))) |
| 667 | (uidvalidity (gnus-group-get-parameter | 690 | (uidvalidity (gnus-group-get-parameter |
| 668 | (gnus-group-prefixed-name | 691 | (nnimap-group-prefixed-name group server) |
| 669 | group (gnus-server-to-method | ||
| 670 | (format "nnimap:%s" server))) | ||
| 671 | 'uidvalidity)) | 692 | 'uidvalidity)) |
| 672 | (name (nnheader-translate-file-chars | 693 | (name (nnheader-translate-file-chars |
| 673 | (concat nnimap-nov-file-name | 694 | (concat nnimap-nov-file-name |
| @@ -964,8 +985,10 @@ function is generally only called when Gnus is shutting down." | |||
| 964 | article))) | 985 | article))) |
| 965 | (when article | 986 | (when article |
| 966 | (gnus-message 10 "nnimap: Fetching (part of) article %d from %s..." | 987 | (gnus-message 10 "nnimap: Fetching (part of) article %d from %s..." |
| 967 | article (or group imap-current-mailbox | 988 | article (or (nnimap-decode-group-name group) |
| 968 | gnus-newsgroup-name)) | 989 | (imap-current-mailbox) |
| 990 | (nnimap-decode-group-name | ||
| 991 | gnus-newsgroup-name))) | ||
| 969 | (if (not nnheader-callback-function) | 992 | (if (not nnheader-callback-function) |
| 970 | (with-current-buffer (or to-buffer nntp-server-buffer) | 993 | (with-current-buffer (or to-buffer nntp-server-buffer) |
| 971 | (erase-buffer) | 994 | (erase-buffer) |
| @@ -979,11 +1002,15 @@ function is generally only called when Gnus is shutting down." | |||
| 979 | (nnheader-ms-strip-cr) | 1002 | (nnheader-ms-strip-cr) |
| 980 | (gnus-message | 1003 | (gnus-message |
| 981 | 10 "nnimap: Fetching (part of) article %d from %s...done" | 1004 | 10 "nnimap: Fetching (part of) article %d from %s...done" |
| 982 | article (or group imap-current-mailbox gnus-newsgroup-name)) | 1005 | article (or (nnimap-decode-group-name group) |
| 1006 | (imap-current-mailbox) | ||
| 1007 | (nnimap-decode-group-name gnus-newsgroup-name))) | ||
| 983 | (if (bobp) | 1008 | (if (bobp) |
| 984 | (nnheader-report 'nnimap "No such article %d in %s: %s" | 1009 | (nnheader-report 'nnimap "No such article %d in %s: %s" |
| 985 | article (or group imap-current-mailbox | 1010 | article (or (nnimap-decode-group-name group) |
| 986 | gnus-newsgroup-name) | 1011 | (imap-current-mailbox) |
| 1012 | (nnimap-decode-group-name | ||
| 1013 | gnus-newsgroup-name)) | ||
| 987 | (imap-error-text nnimap-server-buffer)) | 1014 | (imap-error-text nnimap-server-buffer)) |
| 988 | (cons group article))) | 1015 | (cons group article))) |
| 989 | (add-hook 'imap-fetch-data-hook | 1016 | (add-hook 'imap-fetch-data-hook |
| @@ -1020,8 +1047,7 @@ function is generally only called when Gnus is shutting down." | |||
| 1020 | (deffoo nnimap-request-group (group &optional server fast) | 1047 | (deffoo nnimap-request-group (group &optional server fast) |
| 1021 | (nnimap-request-update-info-internal | 1048 | (nnimap-request-update-info-internal |
| 1022 | group | 1049 | group |
| 1023 | (gnus-get-info (gnus-group-prefixed-name | 1050 | (gnus-get-info (nnimap-group-prefixed-name group server)) |
| 1024 | group (gnus-server-to-method (format "nnimap:%s" server)))) | ||
| 1025 | server) | 1051 | server) |
| 1026 | (when (nnimap-possibly-change-group group server) | 1052 | (when (nnimap-possibly-change-group group server) |
| 1027 | (nnimap-before-find-minmax-bugworkaround) | 1053 | (nnimap-before-find-minmax-bugworkaround) |
| @@ -1044,8 +1070,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1044 | (let ((old (gnus-gethash-safe (gnus-group-prefixed-name group server) | 1070 | (let ((old (gnus-gethash-safe (gnus-group-prefixed-name group server) |
| 1045 | nnimap-mailbox-info))) | 1071 | nnimap-mailbox-info))) |
| 1046 | (list (nth 0 old) (nth 1 old) | 1072 | (list (nth 0 old) (nth 1 old) |
| 1047 | (imap-mailbox-status group 'unseen nnimap-server-buffer) | 1073 | (imap-mailbox-status (nnimap-decode-group-name group) |
| 1048 | (nth 3 old))) | 1074 | 'unseen nnimap-server-buffer))) |
| 1049 | nnimap-mailbox-info)) | 1075 | nnimap-mailbox-info)) |
| 1050 | 1076 | ||
| 1051 | (defun nnimap-close-group (group &optional server) | 1077 | (defun nnimap-close-group (group &optional server) |
| @@ -1060,7 +1086,7 @@ function is generally only called when Gnus is shutting down." | |||
| 1060 | (imap-mailbox-close nnimap-close-asynchronous)))) | 1086 | (imap-mailbox-close nnimap-close-asynchronous)))) |
| 1061 | (ask (if (and (imap-search "DELETED") | 1087 | (ask (if (and (imap-search "DELETED") |
| 1062 | (gnus-y-or-n-p (format "Expunge articles in group `%s'? " | 1088 | (gnus-y-or-n-p (format "Expunge articles in group `%s'? " |
| 1063 | imap-current-mailbox))) | 1089 | (imap-current-mailbox)))) |
| 1064 | (progn | 1090 | (progn |
| 1065 | (imap-mailbox-expunge nnimap-close-asynchronous) | 1091 | (imap-mailbox-expunge nnimap-close-asynchronous) |
| 1066 | (unless nnimap-dont-close | 1092 | (unless nnimap-dont-close |
| @@ -1089,11 +1115,12 @@ function is generally only called when Gnus is shutting down." | |||
| 1089 | (dolist (mbx (funcall nnimap-request-list-method | 1115 | (dolist (mbx (funcall nnimap-request-list-method |
| 1090 | (cdr pattern) (car pattern))) | 1116 | (cdr pattern) (car pattern))) |
| 1091 | (or (member "\\NoSelect" (imap-mailbox-get 'list-flags mbx)) | 1117 | (or (member "\\NoSelect" (imap-mailbox-get 'list-flags mbx)) |
| 1092 | (let ((info (nnimap-find-minmax-uid mbx 'examine))) | 1118 | (let* ((encoded-mbx (nnimap-encode-group-name mbx)) |
| 1119 | (info (nnimap-find-minmax-uid encoded-mbx 'examine))) | ||
| 1093 | (when info | 1120 | (when info |
| 1094 | (with-current-buffer nntp-server-buffer | 1121 | (with-current-buffer nntp-server-buffer |
| 1095 | (insert (format "\"%s\" %d %d y\n" | 1122 | (insert (format "\"%s\" %d %d y\n" |
| 1096 | mbx (or (nth 2 info) 0) | 1123 | encoded-mbx (or (nth 2 info) 0) |
| 1097 | (max 1 (or (nth 1 info) 1))))))))))) | 1124 | (max 1 (or (nth 1 info) 1))))))))))) |
| 1098 | (gnus-message 5 "nnimap: Generating active list%s...done" | 1125 | (gnus-message 5 "nnimap: Generating active list%s...done" |
| 1099 | (if (> (length server) 0) (concat " for " server) "")) | 1126 | (if (> (length server) 0) (concat " for " server) "")) |
| @@ -1143,73 +1170,88 @@ function is generally only called when Gnus is shutting down." | |||
| 1143 | (with-current-buffer nntp-server-buffer | 1170 | (with-current-buffer nntp-server-buffer |
| 1144 | (erase-buffer) | 1171 | (erase-buffer) |
| 1145 | (nnimap-before-find-minmax-bugworkaround) | 1172 | (nnimap-before-find-minmax-bugworkaround) |
| 1146 | (let (asyncgroups slowgroups) | 1173 | (let (asyncgroups slowgroups decoded-group) |
| 1147 | (if (null nnimap-retrieve-groups-asynchronous) | 1174 | (if (null nnimap-retrieve-groups-asynchronous) |
| 1148 | (setq slowgroups groups) | 1175 | (setq slowgroups groups) |
| 1149 | (dolist (group groups) | 1176 | (dolist (group groups) |
| 1150 | (gnus-message 9 "nnimap: Quickly checking mailbox %s" group) | 1177 | (setq decoded-group (nnimap-decode-group-name group)) |
| 1151 | (add-to-list (if (gnus-gethash-safe | 1178 | (gnus-message 9 "nnimap: Quickly checking mailbox %s" |
| 1152 | (gnus-group-prefixed-name group server) | 1179 | decoded-group) |
| 1153 | nnimap-mailbox-info) | 1180 | (add-to-list (if (gnus-group-get-parameter |
| 1181 | (nnimap-group-prefixed-name group) | ||
| 1182 | 'imap-status) | ||
| 1154 | 'asyncgroups | 1183 | 'asyncgroups |
| 1155 | 'slowgroups) | 1184 | 'slowgroups) |
| 1156 | (list group (imap-mailbox-status-asynch | 1185 | (list group (imap-mailbox-status-asynch |
| 1157 | group '(uidvalidity uidnext unseen) | 1186 | decoded-group |
| 1187 | '(uidvalidity uidnext unseen) | ||
| 1158 | nnimap-server-buffer)))) | 1188 | nnimap-server-buffer)))) |
| 1159 | (dolist (asyncgroup asyncgroups) | 1189 | (dolist (asyncgroup asyncgroups) |
| 1160 | (let ((group (nth 0 asyncgroup)) | 1190 | (let* ((group (nth 0 asyncgroup)) |
| 1161 | (tag (nth 1 asyncgroup)) | 1191 | (tag (nth 1 asyncgroup)) |
| 1162 | new old) | 1192 | (gnusgroup (nnimap-group-prefixed-name group)) |
| 1193 | (saved-uidvalidity (gnus-group-get-parameter gnusgroup | ||
| 1194 | 'uidvalidity)) | ||
| 1195 | (saved-imap-status (gnus-group-get-parameter gnusgroup | ||
| 1196 | 'imap-status)) | ||
| 1197 | (saved-info (and saved-imap-status | ||
| 1198 | (split-string saved-imap-status " ")))) | ||
| 1199 | (setq decoded-group (nnimap-decode-group-name group)) | ||
| 1163 | (when (imap-ok-p (imap-wait-for-tag tag nnimap-server-buffer)) | 1200 | (when (imap-ok-p (imap-wait-for-tag tag nnimap-server-buffer)) |
| 1164 | (if (or (not (string= | 1201 | (if (or (not (equal |
| 1165 | (nth 0 (gnus-gethash (gnus-group-prefixed-name | 1202 | saved-uidvalidity |
| 1166 | group server) | 1203 | (imap-mailbox-get 'uidvalidity decoded-group |
| 1167 | nnimap-mailbox-info)) | ||
| 1168 | (imap-mailbox-get 'uidvalidity group | ||
| 1169 | nnimap-server-buffer))) | 1204 | nnimap-server-buffer))) |
| 1170 | (not (string= | 1205 | (not (equal |
| 1171 | (nth 1 (gnus-gethash (gnus-group-prefixed-name | 1206 | (nth 0 saved-info) |
| 1172 | group server) | 1207 | (imap-mailbox-get 'uidnext decoded-group |
| 1173 | nnimap-mailbox-info)) | ||
| 1174 | (imap-mailbox-get 'uidnext group | ||
| 1175 | nnimap-server-buffer)))) | 1208 | nnimap-server-buffer)))) |
| 1176 | (push (list group) slowgroups) | 1209 | (push (list group) slowgroups) |
| 1177 | (insert (nth 3 (gnus-gethash (gnus-group-prefixed-name | 1210 | (gnus-sethash |
| 1178 | group server) | 1211 | (gnus-group-prefixed-name group server) |
| 1179 | nnimap-mailbox-info)))))))) | 1212 | (list (imap-mailbox-get 'uidvalidity |
| 1213 | decoded-group nnimap-server-buffer) | ||
| 1214 | (imap-mailbox-get 'uidnext | ||
| 1215 | decoded-group nnimap-server-buffer) | ||
| 1216 | (imap-mailbox-get 'unseen | ||
| 1217 | decoded-group nnimap-server-buffer)) | ||
| 1218 | nnimap-mailbox-info) | ||
| 1219 | (insert (format "\"%s\" %s %s y\n" group | ||
| 1220 | (nth 2 saved-info) | ||
| 1221 | (nth 1 saved-info)))))))) | ||
| 1180 | (dolist (group slowgroups) | 1222 | (dolist (group slowgroups) |
| 1181 | (if nnimap-retrieve-groups-asynchronous | 1223 | (if nnimap-retrieve-groups-asynchronous |
| 1182 | (setq group (car group))) | 1224 | (setq group (car group))) |
| 1183 | (gnus-message 7 "nnimap: Mailbox %s modified" group) | 1225 | (setq decoded-group (nnimap-decode-group-name group)) |
| 1184 | (imap-mailbox-put 'uidnext nil group nnimap-server-buffer) | 1226 | (gnus-message 7 "nnimap: Mailbox %s modified" decoded-group) |
| 1185 | (or (member "\\NoSelect" (imap-mailbox-get 'list-flags group | 1227 | (or (member "\\NoSelect" (imap-mailbox-get 'list-flags decoded-group |
| 1186 | nnimap-server-buffer)) | 1228 | nnimap-server-buffer)) |
| 1187 | (let* ((info (nnimap-find-minmax-uid group 'examine)) | 1229 | (let* ((gnusgroup (nnimap-group-prefixed-name group)) |
| 1188 | (str (format "\"%s\" %d %d y\n" group | 1230 | (status (imap-mailbox-status |
| 1189 | (or (nth 2 info) 0) | 1231 | decoded-group '(uidvalidity uidnext unseen) |
| 1190 | (max 1 (or (nth 1 info) 1))))) | 1232 | nnimap-server-buffer)) |
| 1191 | (when (> (or (imap-mailbox-get 'recent group | 1233 | (info (nnimap-find-minmax-uid group 'examine)) |
| 1234 | (min-uid (max 1 (or (nth 1 info) 1))) | ||
| 1235 | (max-uid (or (nth 2 info) 0))) | ||
| 1236 | (when (> (or (imap-mailbox-get 'recent decoded-group | ||
| 1192 | nnimap-server-buffer) 0) | 1237 | nnimap-server-buffer) 0) |
| 1193 | 0) | 1238 | 0) |
| 1194 | (push (list (cons group 0)) nnmail-split-history)) | 1239 | (push (list (cons decoded-group 0)) nnmail-split-history)) |
| 1195 | (insert str) | 1240 | (insert (format "\"%s\" %d %d y\n" group max-uid min-uid)) |
| 1196 | (when nnimap-retrieve-groups-asynchronous | 1241 | (gnus-sethash |
| 1197 | (gnus-sethash | 1242 | (gnus-group-prefixed-name group server) |
| 1198 | (gnus-group-prefixed-name group server) | 1243 | status |
| 1199 | (list (or (imap-mailbox-get | 1244 | nnimap-mailbox-info) |
| 1200 | 'uidvalidity group nnimap-server-buffer) | 1245 | (if (not (equal (nth 0 status) |
| 1201 | (imap-mailbox-status | 1246 | (gnus-group-get-parameter gnusgroup |
| 1202 | group 'uidvalidity nnimap-server-buffer)) | 1247 | 'uidvalidity))) |
| 1203 | (or (imap-mailbox-get | 1248 | (nnimap-verify-uidvalidity group nnimap-current-server)) |
| 1204 | 'uidnext group nnimap-server-buffer) | 1249 | ;; The imap-status parameter is a string on the form |
| 1205 | (imap-mailbox-status | 1250 | ;; "<uidnext> <min-uid> <max-uid>". |
| 1206 | group 'uidnext nnimap-server-buffer)) | 1251 | (gnus-group-add-parameter |
| 1207 | (or (imap-mailbox-get | 1252 | gnusgroup |
| 1208 | 'unseen group nnimap-server-buffer) | 1253 | (cons 'imap-status |
| 1209 | (imap-mailbox-status | 1254 | (format "%s %s %s" (nth 1 status) min-uid max-uid)))))))) |
| 1210 | group 'unseen nnimap-server-buffer)) | ||
| 1211 | str) | ||
| 1212 | nnimap-mailbox-info))))))) | ||
| 1213 | (gnus-message 5 "nnimap: Checking mailboxes...done") | 1255 | (gnus-message 5 "nnimap: Checking mailboxes...done") |
| 1214 | 'active)) | 1256 | 'active)) |
| 1215 | 1257 | ||
| @@ -1218,7 +1260,7 @@ function is generally only called when Gnus is shutting down." | |||
| 1218 | (when info ;; xxx what does this mean? should we create a info? | 1260 | (when info ;; xxx what does this mean? should we create a info? |
| 1219 | (with-current-buffer nnimap-server-buffer | 1261 | (with-current-buffer nnimap-server-buffer |
| 1220 | (gnus-message 5 "nnimap: Updating info for %s..." | 1262 | (gnus-message 5 "nnimap: Updating info for %s..." |
| 1221 | (gnus-info-group info)) | 1263 | (nnimap-decode-group-name (gnus-info-group info))) |
| 1222 | 1264 | ||
| 1223 | (when (nnimap-mark-permanent-p 'read) | 1265 | (when (nnimap-mark-permanent-p 'read) |
| 1224 | (let (seen unseen) | 1266 | (let (seen unseen) |
| @@ -1264,7 +1306,7 @@ function is generally only called when Gnus is shutting down." | |||
| 1264 | t)) | 1306 | t)) |
| 1265 | 1307 | ||
| 1266 | (gnus-message 5 "nnimap: Updating info for %s...done" | 1308 | (gnus-message 5 "nnimap: Updating info for %s...done" |
| 1267 | (gnus-info-group info)) | 1309 | (nnimap-decode-group-name (gnus-info-group info))) |
| 1268 | 1310 | ||
| 1269 | info)))) | 1311 | info)))) |
| 1270 | 1312 | ||
| @@ -1277,7 +1319,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1277 | (when (nnimap-possibly-change-group group server) | 1319 | (when (nnimap-possibly-change-group group server) |
| 1278 | (with-current-buffer nnimap-server-buffer | 1320 | (with-current-buffer nnimap-server-buffer |
| 1279 | (let (action) | 1321 | (let (action) |
| 1280 | (gnus-message 7 "nnimap: Setting marks in %s..." group) | 1322 | (gnus-message 7 "nnimap: Setting marks in %s..." |
| 1323 | (nnimap-decode-group-name group)) | ||
| 1281 | (while (setq action (pop actions)) | 1324 | (while (setq action (pop actions)) |
| 1282 | (let ((range (nth 0 action)) | 1325 | (let ((range (nth 0 action)) |
| 1283 | (what (nth 1 action)) | 1326 | (what (nth 1 action)) |
| @@ -1318,7 +1361,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1318 | (imap-message-flags-set | 1361 | (imap-message-flags-set |
| 1319 | (imap-range-to-message-set range) | 1362 | (imap-range-to-message-set range) |
| 1320 | (nnimap-mark-to-flag marks nil t))))))) | 1363 | (nnimap-mark-to-flag marks nil t))))))) |
| 1321 | (gnus-message 7 "nnimap: Setting marks in %s...done" group)))) | 1364 | (gnus-message 7 "nnimap: Setting marks in %s...done" |
| 1365 | (nnimap-decode-group-name group))))) | ||
| 1322 | nil) | 1366 | nil) |
| 1323 | 1367 | ||
| 1324 | (defun nnimap-split-fancy () | 1368 | (defun nnimap-split-fancy () |
| @@ -1329,6 +1373,7 @@ function is generally only called when Gnus is shutting down." | |||
| 1329 | (defun nnimap-split-to-groups (rules) | 1373 | (defun nnimap-split-to-groups (rules) |
| 1330 | ;; tries to match all rules in nnimap-split-rule against content of | 1374 | ;; tries to match all rules in nnimap-split-rule against content of |
| 1331 | ;; nntp-server-buffer, returns a list of groups that matched. | 1375 | ;; nntp-server-buffer, returns a list of groups that matched. |
| 1376 | ;; Note: This function takes and returns decoded group names. | ||
| 1332 | (with-current-buffer nntp-server-buffer | 1377 | (with-current-buffer nntp-server-buffer |
| 1333 | ;; Fold continuation lines. | 1378 | ;; Fold continuation lines. |
| 1334 | (goto-char (point-min)) | 1379 | (goto-char (point-min)) |
| @@ -1381,12 +1426,16 @@ function is generally only called when Gnus is shutting down." | |||
| 1381 | (list nnimap-split-inbox))) | 1426 | (list nnimap-split-inbox))) |
| 1382 | 1427 | ||
| 1383 | (defun nnimap-split-articles (&optional group server) | 1428 | (defun nnimap-split-articles (&optional group server) |
| 1429 | ;; Note: Assumes decoded group names in nnimap-split-inbox, | ||
| 1430 | ;; nnimap-split-rule, nnimap-split-fancy, and nnmail-split-history. | ||
| 1384 | (when (nnimap-possibly-change-server server) | 1431 | (when (nnimap-possibly-change-server server) |
| 1385 | (with-current-buffer nnimap-server-buffer | 1432 | (with-current-buffer nnimap-server-buffer |
| 1386 | (let (rule inbox removeorig (inboxes (nnimap-split-find-inbox server))) | 1433 | (let (rule inbox removeorig |
| 1434 | (inboxes (nnimap-split-find-inbox server))) | ||
| 1387 | ;; iterate over inboxes | 1435 | ;; iterate over inboxes |
| 1388 | (while (and (setq inbox (pop inboxes)) | 1436 | (while (and (setq inbox (pop inboxes)) |
| 1389 | (nnimap-possibly-change-group inbox)) ;; SELECT | 1437 | (nnimap-possibly-change-group |
| 1438 | (nnimap-encode-group-name inbox))) ;; SELECT | ||
| 1390 | ;; find split rule for this server / inbox | 1439 | ;; find split rule for this server / inbox |
| 1391 | (when (setq rule (nnimap-split-find-rule server inbox)) | 1440 | (when (setq rule (nnimap-split-find-rule server inbox)) |
| 1392 | ;; iterate over articles | 1441 | ;; iterate over articles |
| @@ -1415,7 +1464,7 @@ function is generally only called when Gnus is shutting down." | |||
| 1415 | (and (setq msgid | 1464 | (and (setq msgid |
| 1416 | (nnmail-fetch-field "message-id")) | 1465 | (nnmail-fetch-field "message-id")) |
| 1417 | (nnmail-cache-insert msgid | 1466 | (nnmail-cache-insert msgid |
| 1418 | to-group | 1467 | (nnimap-encode-group-name to-group) |
| 1419 | (nnmail-fetch-field "subject")))))) | 1468 | (nnmail-fetch-field "subject")))))) |
| 1420 | ;; Add the group-art list to the history list. | 1469 | ;; Add the group-art list to the history list. |
| 1421 | (push (list (cons to-group 0)) nnmail-split-history)) | 1470 | (push (list (cons to-group 0)) nnmail-split-history)) |
| @@ -1458,10 +1507,11 @@ function is generally only called when Gnus is shutting down." | |||
| 1458 | (if (string= (downcase mailbox) "\\noselect") | 1507 | (if (string= (downcase mailbox) "\\noselect") |
| 1459 | (throw 'found t))) | 1508 | (throw 'found t))) |
| 1460 | nil) | 1509 | nil) |
| 1461 | (let ((info (nnimap-find-minmax-uid mbx 'examine))) | 1510 | (let* ((encoded-mbx (nnimap-encode-group-name mbx)) |
| 1511 | (info (nnimap-find-minmax-uid encoded-mbx 'examine))) | ||
| 1462 | (when info | 1512 | (when info |
| 1463 | (insert (format "\"%s\" %d %d y\n" | 1513 | (insert (format "\"%s\" %d %d y\n" |
| 1464 | mbx (or (nth 2 info) 0) | 1514 | encoded-mbx (or (nth 2 info) 0) |
| 1465 | (max 1 (or (nth 1 info) 1))))))))) | 1515 | (max 1 (or (nth 1 info) 1))))))))) |
| 1466 | (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s...done" | 1516 | (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s...done" |
| 1467 | (if (> (length server) 0) " on " "") server)) | 1517 | (if (> (length server) 0) " on " "") server)) |
| @@ -1469,10 +1519,11 @@ function is generally only called when Gnus is shutting down." | |||
| 1469 | 1519 | ||
| 1470 | (deffoo nnimap-request-create-group (group &optional server args) | 1520 | (deffoo nnimap-request-create-group (group &optional server args) |
| 1471 | (when (nnimap-possibly-change-server server) | 1521 | (when (nnimap-possibly-change-server server) |
| 1472 | (or (imap-mailbox-status group 'uidvalidity nnimap-server-buffer) | 1522 | (let ((decoded-group (nnimap-decode-group-name group))) |
| 1473 | (imap-mailbox-create group nnimap-server-buffer) | 1523 | (or (imap-mailbox-status decoded-group 'uidvalidity nnimap-server-buffer) |
| 1474 | (nnheader-report 'nnimap "%S" | 1524 | (imap-mailbox-create decoded-group nnimap-server-buffer) |
| 1475 | (imap-error-text nnimap-server-buffer))))) | 1525 | (nnheader-report 'nnimap "%S" |
| 1526 | (imap-error-text nnimap-server-buffer)))))) | ||
| 1476 | 1527 | ||
| 1477 | (defun nnimap-time-substract (time1 time2) | 1528 | (defun nnimap-time-substract (time1 time2) |
| 1478 | "Return TIME for TIME1 - TIME2." | 1529 | "Return TIME for TIME1 - TIME2." |
| @@ -1603,7 +1654,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1603 | nnimap-current-move-group) | 1654 | nnimap-current-move-group) |
| 1604 | (imap-message-copy (number-to-string | 1655 | (imap-message-copy (number-to-string |
| 1605 | nnimap-current-move-article) | 1656 | nnimap-current-move-article) |
| 1606 | group 'dontcreate nil | 1657 | (nnimap-decode-group-name group) |
| 1658 | 'dontcreate nil | ||
| 1607 | nnimap-server-buffer)) | 1659 | nnimap-server-buffer)) |
| 1608 | (with-current-buffer (current-buffer) | 1660 | (with-current-buffer (current-buffer) |
| 1609 | (goto-char (point-min)) | 1661 | (goto-char (point-min)) |
| @@ -1623,13 +1675,15 @@ function is generally only called when Gnus is shutting down." | |||
| 1623 | ;; this 'or' is for Cyrus server bug | 1675 | ;; this 'or' is for Cyrus server bug |
| 1624 | (or (null (imap-current-mailbox nnimap-server-buffer)) | 1676 | (or (null (imap-current-mailbox nnimap-server-buffer)) |
| 1625 | (imap-mailbox-unselect nnimap-server-buffer)) | 1677 | (imap-mailbox-unselect nnimap-server-buffer)) |
| 1626 | (imap-message-append group (current-buffer) nil nil | 1678 | (imap-message-append (nnimap-decode-group-name group) |
| 1679 | (current-buffer) nil nil | ||
| 1627 | nnimap-server-buffer))) | 1680 | nnimap-server-buffer))) |
| 1628 | (cons group (nth 1 uid)) | 1681 | (cons group (nth 1 uid)) |
| 1629 | (nnheader-report 'nnimap (imap-error-text nnimap-server-buffer)))))) | 1682 | (nnheader-report 'nnimap (imap-error-text nnimap-server-buffer)))))) |
| 1630 | 1683 | ||
| 1631 | (deffoo nnimap-request-delete-group (group force &optional server) | 1684 | (deffoo nnimap-request-delete-group (group force &optional server) |
| 1632 | (when (nnimap-possibly-change-server server) | 1685 | (when (nnimap-possibly-change-server server) |
| 1686 | (setq group (nnimap-decode-group-name group)) | ||
| 1633 | (when (string= group (imap-current-mailbox nnimap-server-buffer)) | 1687 | (when (string= group (imap-current-mailbox nnimap-server-buffer)) |
| 1634 | (imap-mailbox-unselect nnimap-server-buffer)) | 1688 | (imap-mailbox-unselect nnimap-server-buffer)) |
| 1635 | (with-current-buffer nnimap-server-buffer | 1689 | (with-current-buffer nnimap-server-buffer |
| @@ -1641,7 +1695,9 @@ function is generally only called when Gnus is shutting down." | |||
| 1641 | 1695 | ||
| 1642 | (deffoo nnimap-request-rename-group (group new-name &optional server) | 1696 | (deffoo nnimap-request-rename-group (group new-name &optional server) |
| 1643 | (when (nnimap-possibly-change-server server) | 1697 | (when (nnimap-possibly-change-server server) |
| 1644 | (imap-mailbox-rename group new-name nnimap-server-buffer))) | 1698 | (imap-mailbox-rename (nnimap-decode-group-name group) |
| 1699 | (nnimap-decode-group-name new-name) | ||
| 1700 | nnimap-server-buffer))) | ||
| 1645 | 1701 | ||
| 1646 | (defun nnimap-expunge (mailbox server) | 1702 | (defun nnimap-expunge (mailbox server) |
| 1647 | (when (nnimap-possibly-change-group mailbox server) | 1703 | (when (nnimap-possibly-change-group mailbox server) |
| @@ -1650,7 +1706,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1650 | (defun nnimap-acl-get (mailbox server) | 1706 | (defun nnimap-acl-get (mailbox server) |
| 1651 | (when (nnimap-possibly-change-server server) | 1707 | (when (nnimap-possibly-change-server server) |
| 1652 | (and (imap-capability 'ACL nnimap-server-buffer) | 1708 | (and (imap-capability 'ACL nnimap-server-buffer) |
| 1653 | (imap-mailbox-acl-get mailbox nnimap-server-buffer)))) | 1709 | (imap-mailbox-acl-get (nnimap-decode-group-name mailbox) |
| 1710 | nnimap-server-buffer)))) | ||
| 1654 | 1711 | ||
| 1655 | (defun nnimap-acl-edit (mailbox method old-acls new-acls) | 1712 | (defun nnimap-acl-edit (mailbox method old-acls new-acls) |
| 1656 | (when (nnimap-possibly-change-server (cadr method)) | 1713 | (when (nnimap-possibly-change-server (cadr method)) |
| @@ -1660,7 +1717,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1660 | ;; delete all removed identifiers | 1717 | ;; delete all removed identifiers |
| 1661 | (mapc (lambda (old-acl) | 1718 | (mapc (lambda (old-acl) |
| 1662 | (unless (assoc (car old-acl) new-acls) | 1719 | (unless (assoc (car old-acl) new-acls) |
| 1663 | (or (imap-mailbox-acl-delete (car old-acl) mailbox) | 1720 | (or (imap-mailbox-acl-delete (car old-acl) |
| 1721 | (nnimap-decode-group-name mailbox)) | ||
| 1664 | (error "Can't delete ACL for %s" (car old-acl))))) | 1722 | (error "Can't delete ACL for %s" (car old-acl))))) |
| 1665 | old-acls) | 1723 | old-acls) |
| 1666 | ;; set all changed acl's | 1724 | ;; set all changed acl's |
| @@ -1669,7 +1727,8 @@ function is generally only called when Gnus is shutting down." | |||
| 1669 | (old-rights (cdr (assoc (car new-acl) old-acls)))) | 1727 | (old-rights (cdr (assoc (car new-acl) old-acls)))) |
| 1670 | (unless (and old-rights new-rights | 1728 | (unless (and old-rights new-rights |
| 1671 | (string= old-rights new-rights)) | 1729 | (string= old-rights new-rights)) |
| 1672 | (or (imap-mailbox-acl-set (car new-acl) new-rights mailbox) | 1730 | (or (imap-mailbox-acl-set (car new-acl) new-rights |
| 1731 | (nnimap-decode-group-name mailbox)) | ||
| 1673 | (error "Can't set ACL for %s to %s" (car new-acl) | 1732 | (error "Can't set ACL for %s to %s" (car new-acl) |
| 1674 | new-rights))))) | 1733 | new-rights))))) |
| 1675 | new-acls) | 1734 | new-acls) |
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 02685c7594c..5475506746a 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -358,6 +358,14 @@ | |||
| 358 | (defvar nnir-imap-search-argument-history () | 358 | (defvar nnir-imap-search-argument-history () |
| 359 | "The history for querying search options in nnir") | 359 | "The history for querying search options in nnir") |
| 360 | 360 | ||
| 361 | (defvar nnir-get-article-nov-override-function nil | ||
| 362 | "If non-nil, a function that will be passed each search result. This | ||
| 363 | should return a message's headers in NOV format. | ||
| 364 | |||
| 365 | If this variable is nil, or if the provided function returns nil for a search | ||
| 366 | result, `gnus-retrieve-headers' will be called instead.") | ||
| 367 | |||
| 368 | |||
| 361 | ;;; Developer Extension Variable: | 369 | ;;; Developer Extension Variable: |
| 362 | 370 | ||
| 363 | (defvar nnir-engines | 371 | (defvar nnir-engines |
| @@ -779,25 +787,31 @@ and show thread that contains this article." | |||
| 779 | (nnir-possibly-change-server server) | 787 | (nnir-possibly-change-server server) |
| 780 | (let ((gnus-override-method | 788 | (let ((gnus-override-method |
| 781 | (gnus-server-to-method server))) | 789 | (gnus-server-to-method server))) |
| 782 | (case (setq foo (gnus-retrieve-headers (list artno) artfullgroup nil)) | 790 | ;; if nnir-get-article-nov-override-function is set, use it |
| 783 | (nov | 791 | (if nnir-get-article-nov-override-function |
| 784 | (goto-char (point-min)) | 792 | (setq novitem (funcall nnir-get-article-nov-override-function |
| 785 | (setq novitem (nnheader-parse-nov)) | 793 | artitem)) |
| 786 | (unless novitem | 794 | ;; else, set novitem through nnheader-parse-nov/nnheader-parse-head |
| 787 | (pop-to-buffer nntp-server-buffer) | 795 | (case (setq foo (gnus-retrieve-headers (list artno) |
| 788 | (error | 796 | artfullgroup nil)) |
| 789 | "nnheader-parse-nov returned nil for article %s in group %s" | 797 | (nov |
| 790 | artno artfullgroup))) | 798 | (goto-char (point-min)) |
| 791 | (headers | 799 | (setq novitem (nnheader-parse-nov)) |
| 792 | (goto-char (point-min)) | 800 | (unless novitem |
| 793 | (setq novitem (nnheader-parse-head)) | 801 | (pop-to-buffer nntp-server-buffer) |
| 794 | (unless novitem | 802 | (error |
| 795 | (pop-to-buffer nntp-server-buffer) | 803 | "nnheader-parse-nov returned nil for article %s in group %s" |
| 796 | (error | 804 | artno artfullgroup))) |
| 797 | "nnheader-parse-head returned nil for article %s in group %s" | 805 | (headers |
| 798 | artno artfullgroup))) | 806 | (goto-char (point-min)) |
| 799 | (t (error "Unknown header type %s while requesting article %s of group %s" | 807 | (setq novitem (nnheader-parse-head)) |
| 800 | foo artno artfullgroup)))) | 808 | (unless novitem |
| 809 | (pop-to-buffer nntp-server-buffer) | ||
| 810 | (error | ||
| 811 | "nnheader-parse-head returned nil for article %s in group %s" | ||
| 812 | artno artfullgroup))) | ||
| 813 | (t (error "Unknown header type %s while requesting article %s of group %s" | ||
| 814 | foo artno artfullgroup))))) | ||
| 801 | ;; replace article number in original group with article number | 815 | ;; replace article number in original group with article number |
| 802 | ;; in nnir group | 816 | ;; in nnir group |
| 803 | (mail-header-set-number novitem art) | 817 | (mail-header-set-number novitem art) |
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el index b3012b4b198..20f7ba34b3c 100644 --- a/lisp/gnus/pop3.el +++ b/lisp/gnus/pop3.el | |||
| @@ -98,6 +98,12 @@ thing can fall apart and leave you with a corrupt mailbox." | |||
| 98 | :type 'boolean | 98 | :type 'boolean |
| 99 | :group 'pop3) | 99 | :group 'pop3) |
| 100 | 100 | ||
| 101 | (defcustom pop3-display-message-size-flag t | ||
| 102 | "*If non-nil, display the size of the message that is being fetched." | ||
| 103 | :version "22.1" ;; Oort Gnus | ||
| 104 | :type 'boolean | ||
| 105 | :group 'pop3) | ||
| 106 | |||
| 101 | (defvar pop3-timestamp nil | 107 | (defvar pop3-timestamp nil |
| 102 | "Timestamp returned when initially connected to the POP server. | 108 | "Timestamp returned when initially connected to the POP server. |
| 103 | Used for APOP authentication.") | 109 | Used for APOP authentication.") |
| @@ -135,6 +141,7 @@ Shorter values mean quicker response, but are more CPU intensive.") | |||
| 135 | (crashbuf (get-buffer-create " *pop3-retr*")) | 141 | (crashbuf (get-buffer-create " *pop3-retr*")) |
| 136 | (n 1) | 142 | (n 1) |
| 137 | message-count | 143 | message-count |
| 144 | message-sizes | ||
| 138 | (pop3-password pop3-password)) | 145 | (pop3-password pop3-password)) |
| 139 | ;; for debugging only | 146 | ;; for debugging only |
| 140 | (if pop3-debug (switch-to-buffer (process-buffer process))) | 147 | (if pop3-debug (switch-to-buffer (process-buffer process))) |
| @@ -149,10 +156,18 @@ Shorter values mean quicker response, but are more CPU intensive.") | |||
| 149 | (pop3-pass process)) | 156 | (pop3-pass process)) |
| 150 | (t (error "Invalid POP3 authentication scheme"))) | 157 | (t (error "Invalid POP3 authentication scheme"))) |
| 151 | (setq message-count (car (pop3-stat process))) | 158 | (setq message-count (car (pop3-stat process))) |
| 159 | (when (and pop3-display-message-size-flag | ||
| 160 | (> message-count 0)) | ||
| 161 | (setq message-sizes (pop3-list process))) | ||
| 152 | (unwind-protect | 162 | (unwind-protect |
| 153 | (while (<= n message-count) | 163 | (while (<= n message-count) |
| 154 | (message "Retrieving message %d of %d from %s..." | 164 | (if pop3-display-message-size-flag |
| 155 | n message-count pop3-mailhost) | 165 | (message "Retrieving message %d of %d from %s... (%.1fk)" |
| 166 | n message-count pop3-mailhost | ||
| 167 | (/ (cdr (assoc n message-sizes)) | ||
| 168 | 1024.0)) | ||
| 169 | (message "Retrieving message %d of %d from %s..." | ||
| 170 | n message-count pop3-mailhost)) | ||
| 156 | (pop3-retr process n crashbuf) | 171 | (pop3-retr process n crashbuf) |
| 157 | (save-excursion | 172 | (save-excursion |
| 158 | (set-buffer crashbuf) | 173 | (set-buffer crashbuf) |
| @@ -451,8 +466,28 @@ If NOW, use that time instead." | |||
| 451 | )) | 466 | )) |
| 452 | 467 | ||
| 453 | (defun pop3-list (process &optional msg) | 468 | (defun pop3-list (process &optional msg) |
| 454 | "Scan listing of available messages. | 469 | "If MSG is nil, return an alist of (MESSAGE-ID . SIZE) pairs. |
| 455 | This function currently does nothing.") | 470 | Otherwise, return the size of the message-id MSG" |
| 471 | (pop3-send-command process (if msg | ||
| 472 | (format "LIST %d" msg) | ||
| 473 | "LIST")) | ||
| 474 | (let ((response (pop3-read-response process t))) | ||
| 475 | (if msg | ||
| 476 | (string-to-number (nth 2 (split-string response " "))) | ||
| 477 | (let ((start pop3-read-point) end) | ||
| 478 | (save-excursion | ||
| 479 | (set-buffer (process-buffer process)) | ||
| 480 | (while (not (re-search-forward "^\\.\r\n" nil t)) | ||
| 481 | (pop3-accept-process-output process) | ||
| 482 | (goto-char start)) | ||
| 483 | (setq pop3-read-point (point-marker)) | ||
| 484 | (goto-char (match-beginning 0)) | ||
| 485 | (setq end (point-marker)) | ||
| 486 | (mapcar #'(lambda (s) (let ((split (split-string s " "))) | ||
| 487 | (cons (string-to-number (nth 0 split)) | ||
| 488 | (string-to-number (nth 1 split))))) | ||
| 489 | (delete "" (split-string (buffer-substring start end) | ||
| 490 | "\r\n")))))))) | ||
| 456 | 491 | ||
| 457 | (defun pop3-retr (process msg crashbuf) | 492 | (defun pop3-retr (process msg crashbuf) |
| 458 | "Retrieve message-id MSG to buffer CRASHBUF." | 493 | "Retrieve message-id MSG to buffer CRASHBUF." |