From 27625a584c4571c3d505945103b27539d08a6ccb Mon Sep 17 00:00:00 2001 From: Andrew Cohen Date: Tue, 14 Dec 2010 12:52:30 +0000 Subject: [PATCH] nnir.el (nnir-mode): Don't install registry hooks if user hasn't installed the registry. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/nnir.el | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 52ef531e3a8..e7f084ba518 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-12-14 Andrew Cohen + + * nnir.el (nnir-mode): Don't install registry hooks if user hasn't + installed the registry. + 2010-12-13 Andrew Cohen * nnir.el (nnir-run-gmane): Better check for gmane groups: error out if diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 6c97f7279fc..0f07bb14062 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -289,7 +289,9 @@ is `(valuefunc member)'." (autoload 'nnimap-buffer "nnimap") (autoload 'nnimap-command "nnimap") (autoload 'nnimap-possibly-change-group "nnimap") - (autoload 'gnus-registry-action "gnus-registry")) + (autoload 'gnus-registry-action "gnus-registry") + (defvar gnus-registry-install)) + (nnoo-declare nnir) (nnoo-define-basics nnir) @@ -1581,12 +1583,13 @@ server is of form 'backend:name'." (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir) (setq gnus-summary-line-format (or nnir-summary-line-format gnus-summary-line-format)) - (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t) - (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t) - (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t) - (add-hook 'gnus-summary-article-delete-hook 'nnir-registry-action t t) - (add-hook 'gnus-summary-article-move-hook 'nnir-registry-action t t) - (add-hook 'gnus-summary-article-expire-hook 'nnir-registry-action t t))) + (when (eq gnus-registry-install t) + (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t) + (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t) + (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t) + (add-hook 'gnus-summary-article-delete-hook 'nnir-registry-action t t) + (add-hook 'gnus-summary-article-move-hook 'nnir-registry-action t t) + (add-hook 'gnus-summary-article-expire-hook 'nnir-registry-action t t)))) -- 2.39.5