diff options
| author | Teodor Zlatanov | 2011-10-17 22:51:37 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-10-17 22:51:37 +0000 |
| commit | aa22bff2be02d0b3f1264276afc04e47d53cd421 (patch) | |
| tree | 9aad3d16b033d03a854c0d4b3ef405daa76096fc | |
| parent | 67e729a5f78cf54a608297b1be201ed12a676737 (diff) | |
| download | emacs-aa22bff2be02d0b3f1264276afc04e47d53cd421.tar.gz emacs-aa22bff2be02d0b3f1264276afc04e47d53cd421.zip | |
Merge changes made in Gnus trunk.
From Dave Abrahams <dave@boostpro.com>.
gnus-registry.el (gnus-registry-enabled): Add new variable.
(gnus-registry-install-shortcuts): Set `gnus-registry-install' to 'ask only while we need to find out if it should be t or nil.
(gnus-registry-initialize): Don't set `gnus-registry-install' to t.
(gnus-registry-install-hooks): Set `gnus-registry-enabled' to t when the registry is installed. Set it to nil when it's unloaded.
(gnus-registry-install-p): Provide user guidance for the initial value of `gnus-registry-install' when it's 'ask, otherwise return its value.
nnregistry.el (nnregistry-open-server, nnregistry-server-opened): Use `gnus-registry-enabled' instead of `gnus-registry-install'.
nnmairix.el (nnmairix-determine-original-group-from-registry): Use `gnus-registry-enabled' instead of `gnus-registry-install'.
nnir.el (nnir-mode): Use `gnus-registry-enabled' instead of `gnus-registry-install'.
| -rw-r--r-- | lisp/gnus/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/gnus/gnus-registry.el | 33 | ||||
| -rw-r--r-- | lisp/gnus/nnir.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/nnmairix.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/nnregistry.el | 7 |
5 files changed, 45 insertions, 23 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index cc2568a3647..d55f235f1ba 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2011-10-17 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 2 | |||
| 3 | * gnus-registry.el (gnus-registry-enabled): Add new variable. | ||
| 4 | (gnus-registry-install-shortcuts): Set `gnus-registry-install' to 'ask | ||
| 5 | only while we need to find out if it should be t or nil. | ||
| 6 | (gnus-registry-initialize): Don't set `gnus-registry-install' to t. | ||
| 7 | (gnus-registry-install-hooks): Set `gnus-registry-enabled' to t when | ||
| 8 | the registry is installed. Set it to nil when it's unloaded. | ||
| 9 | (gnus-registry-install-p): Provide user guidance for the initial value | ||
| 10 | of `gnus-registry-install' when it's 'ask, otherwise return its value. | ||
| 11 | * nnregistry.el (nnregistry-open-server, nnregistry-server-opened): | ||
| 12 | Use `gnus-registry-enabled' instead of `gnus-registry-install'. | ||
| 13 | * nnmairix.el (nnmairix-determine-original-group-from-registry): | ||
| 14 | Use `gnus-registry-enabled' instead of `gnus-registry-install'. | ||
| 15 | * nnir.el (nnir-mode): Use `gnus-registry-enabled' instead of | ||
| 16 | `gnus-registry-install'. | ||
| 17 | From Dave Abrahams <dave@boostpro.com>. | ||
| 18 | |||
| 1 | 2011-10-17 Daiki Ueno <ueno@unixuser.org> | 19 | 2011-10-17 Daiki Ueno <ueno@unixuser.org> |
| 2 | 20 | ||
| 3 | * mml2015.el (mml2015-epg-find-usable-key): Skip the whole key if the | 21 | * mml2015.el (mml2015-epg-find-usable-key): Skip the whole key if the |
diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index f8ff52f128f..652e816e56a 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el | |||
| @@ -164,6 +164,8 @@ nnmairix groups are specifically excluded because they are ephemeral." | |||
| 164 | (const :tag "Always Install" t) | 164 | (const :tag "Always Install" t) |
| 165 | (const :tag "Ask Me" ask))) | 165 | (const :tag "Ask Me" ask))) |
| 166 | 166 | ||
| 167 | (defvar gnus-registry-enabled) | ||
| 168 | |||
| 167 | (defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning. | 169 | (defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning. |
| 168 | 170 | ||
| 169 | (defvar gnus-registry-misc-menus nil) ; ugly way to keep the menus | 171 | (defvar gnus-registry-misc-menus nil) ; ugly way to keep the menus |
| @@ -873,8 +875,9 @@ Uses `gnus-registry-marks' to find what shortcuts to install." | |||
| 873 | 875 | ||
| 874 | ;; if this is called and the user doesn't want the | 876 | ;; if this is called and the user doesn't want the |
| 875 | ;; registry enabled, we'll ask anyhow | 877 | ;; registry enabled, we'll ask anyhow |
| 876 | (when (eq gnus-registry-install nil) | 878 | (unless gnus-registry-install |
| 877 | (setq gnus-registry-install 'ask)) | 879 | (let ((gnus-registry-install 'ask)) |
| 880 | (gnus-registry-install-p))) | ||
| 878 | 881 | ||
| 879 | ;; now the user is asked if gnus-registry-install is 'ask | 882 | ;; now the user is asked if gnus-registry-install is 'ask |
| 880 | (when (gnus-registry-install-p) | 883 | (when (gnus-registry-install-p) |
| @@ -1151,7 +1154,6 @@ only the last one's marks are returned." | |||
| 1151 | "Initialize the Gnus registry." | 1154 | "Initialize the Gnus registry." |
| 1152 | (interactive) | 1155 | (interactive) |
| 1153 | (gnus-message 5 "Initializing the registry") | 1156 | (gnus-message 5 "Initializing the registry") |
| 1154 | (setq gnus-registry-install t) ; in case it was 'ask or nil | ||
| 1155 | (gnus-registry-install-hooks) | 1157 | (gnus-registry-install-hooks) |
| 1156 | (gnus-registry-install-shortcuts) | 1158 | (gnus-registry-install-shortcuts) |
| 1157 | (gnus-registry-read)) | 1159 | (gnus-registry-read)) |
| @@ -1160,6 +1162,7 @@ only the last one's marks are returned." | |||
| 1160 | (defun gnus-registry-install-hooks () | 1162 | (defun gnus-registry-install-hooks () |
| 1161 | "Install the registry hooks." | 1163 | "Install the registry hooks." |
| 1162 | (interactive) | 1164 | (interactive) |
| 1165 | (setq gnus-registry-enabled t) | ||
| 1163 | (add-hook 'gnus-summary-article-move-hook 'gnus-registry-action) | 1166 | (add-hook 'gnus-summary-article-move-hook 'gnus-registry-action) |
| 1164 | (add-hook 'gnus-summary-article-delete-hook 'gnus-registry-action) | 1167 | (add-hook 'gnus-summary-article-delete-hook 'gnus-registry-action) |
| 1165 | (add-hook 'gnus-summary-article-expire-hook 'gnus-registry-action) | 1168 | (add-hook 'gnus-summary-article-expire-hook 'gnus-registry-action) |
| @@ -1181,23 +1184,25 @@ only the last one's marks are returned." | |||
| 1181 | (remove-hook 'gnus-save-newsrc-hook 'gnus-registry-save) | 1184 | (remove-hook 'gnus-save-newsrc-hook 'gnus-registry-save) |
| 1182 | (remove-hook 'gnus-read-newsrc-el-hook 'gnus-registry-read) | 1185 | (remove-hook 'gnus-read-newsrc-el-hook 'gnus-registry-read) |
| 1183 | 1186 | ||
| 1184 | (remove-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids)) | 1187 | (remove-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids) |
| 1188 | (setq gnus-registry-enabled nil)) | ||
| 1185 | 1189 | ||
| 1186 | (add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook) | 1190 | (add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook) |
| 1187 | 1191 | ||
| 1188 | (defun gnus-registry-install-p () | 1192 | (defun gnus-registry-install-p () |
| 1193 | "If the registry is not already enabled, and `gnus-registry-install' is t, | ||
| 1194 | the registry is enabled. If `gnus-registry-install' is `ask', | ||
| 1195 | the user is asked first. Returns non-nil iff the registry is enabled." | ||
| 1189 | (interactive) | 1196 | (interactive) |
| 1190 | (when (eq gnus-registry-install 'ask) | 1197 | (unless gnus-registry-enabled |
| 1191 | (setq gnus-registry-install | 1198 | (when (if (eq gnus-registry-install 'ask) |
| 1192 | (gnus-y-or-n-p | 1199 | (gnus-y-or-n-p |
| 1193 | (concat "Enable the Gnus registry? " | 1200 | (concat "Enable the Gnus registry? " |
| 1194 | "See the variable `gnus-registry-install' " | 1201 | "See the variable `gnus-registry-install' " |
| 1195 | "to get rid of this query permanently. "))) | 1202 | "to get rid of this query permanently. ")) |
| 1196 | (when gnus-registry-install | 1203 | gnus-registry-install) |
| 1197 | ;; we just set gnus-registry-install to t, so initialize the registry! | ||
| 1198 | (gnus-registry-initialize))) | 1204 | (gnus-registry-initialize))) |
| 1199 | ;;; we could call it here: (customize-variable 'gnus-registry-install) | 1205 | gnus-registry-enabled) |
| 1200 | gnus-registry-install) | ||
| 1201 | 1206 | ||
| 1202 | ;; TODO: a few things | 1207 | ;; TODO: a few things |
| 1203 | 1208 | ||
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 0be6a17d50e..cbd3f743b3a 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el | |||
| @@ -290,8 +290,7 @@ is `(valuefunc member)'." | |||
| 290 | (autoload 'nnimap-command "nnimap") | 290 | (autoload 'nnimap-command "nnimap") |
| 291 | (autoload 'nnimap-possibly-change-group "nnimap") | 291 | (autoload 'nnimap-possibly-change-group "nnimap") |
| 292 | (autoload 'nnimap-make-thread-query "nnimap") | 292 | (autoload 'nnimap-make-thread-query "nnimap") |
| 293 | (autoload 'gnus-registry-action "gnus-registry") | 293 | (autoload 'gnus-registry-action "gnus-registry")) |
| 294 | (defvar gnus-registry-install)) | ||
| 295 | 294 | ||
| 296 | 295 | ||
| 297 | (nnoo-declare nnir) | 296 | (nnoo-declare nnir) |
| @@ -1741,8 +1740,7 @@ environment unless `not-global' is non-nil." | |||
| 1741 | (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir) | 1740 | (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir) |
| 1742 | (setq gnus-summary-line-format | 1741 | (setq gnus-summary-line-format |
| 1743 | (or nnir-summary-line-format gnus-summary-line-format)) | 1742 | (or nnir-summary-line-format gnus-summary-line-format)) |
| 1744 | (when (and (boundp 'gnus-registry-install) | 1743 | (when (bound-and-true-p gnus-registry-enabled) |
| 1745 | (eq gnus-registry-install t)) | ||
| 1746 | (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t) | 1744 | (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t) |
| 1747 | (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t) | 1745 | (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t) |
| 1748 | (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t) | 1746 | (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t) |
diff --git a/lisp/gnus/nnmairix.el b/lisp/gnus/nnmairix.el index 3d1ac02b6aa..f81aa03c269 100644 --- a/lisp/gnus/nnmairix.el +++ b/lisp/gnus/nnmairix.el | |||
| @@ -603,7 +603,6 @@ Other back ends might or might not work.") | |||
| 603 | nil)) | 603 | nil)) |
| 604 | 604 | ||
| 605 | ;; Silence byte-compiler. | 605 | ;; Silence byte-compiler. |
| 606 | (defvar gnus-registry-install) | ||
| 607 | (autoload 'gnus-registry-get-id-key "gnus-registry") | 606 | (autoload 'gnus-registry-get-id-key "gnus-registry") |
| 608 | 607 | ||
| 609 | (deffoo nnmairix-request-set-mark (group actions &optional server) | 608 | (deffoo nnmairix-request-set-mark (group actions &optional server) |
| @@ -1636,8 +1635,7 @@ search in raw mode." | |||
| 1636 | 1635 | ||
| 1637 | (defun nnmairix-determine-original-group-from-registry (mid) | 1636 | (defun nnmairix-determine-original-group-from-registry (mid) |
| 1638 | "Try to determinale original group for message-id MID from the registry." | 1637 | "Try to determinale original group for message-id MID from the registry." |
| 1639 | (when (and (boundp 'gnus-registry-install) | 1638 | (when (bound-and-true-p gnus-registry-enabled) |
| 1640 | gnus-registry-install) | ||
| 1641 | (unless (string-match "^<" mid) | 1639 | (unless (string-match "^<" mid) |
| 1642 | (set mid (concat "<" mid))) | 1640 | (set mid (concat "<" mid))) |
| 1643 | (unless (string-match ">$" mid) | 1641 | (unless (string-match ">$" mid) |
diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el index 359050c356c..75a640a428a 100644 --- a/lisp/gnus/nnregistry.el +++ b/lisp/gnus/nnregistry.el | |||
| @@ -36,8 +36,11 @@ | |||
| 36 | 36 | ||
| 37 | (nnoo-declare nnregistry) | 37 | (nnoo-declare nnregistry) |
| 38 | 38 | ||
| 39 | ;; Suppress byte-compiler warning `reference to free variable' | ||
| 40 | (defvar gnus-registry-enabled) | ||
| 41 | |||
| 39 | (deffoo nnregistry-server-opened (server) | 42 | (deffoo nnregistry-server-opened (server) |
| 40 | (eq gnus-registry-install t)) | 43 | gnus-registry-enabled) |
| 41 | 44 | ||
| 42 | (deffoo nnregistry-close-server (server) | 45 | (deffoo nnregistry-close-server (server) |
| 43 | t) | 46 | t) |
| @@ -46,7 +49,7 @@ | |||
| 46 | nil) | 49 | nil) |
| 47 | 50 | ||
| 48 | (deffoo nnregistry-open-server (server &optional defs) | 51 | (deffoo nnregistry-open-server (server &optional defs) |
| 49 | (eq gnus-registry-install t)) | 52 | gnus-registry-enabled) |
| 50 | 53 | ||
| 51 | (defvar nnregistry-within-nnregistry nil) | 54 | (defvar nnregistry-within-nnregistry nil) |
| 52 | 55 | ||