From 81dc6c820133247fb5acd029d42dda9e9ebed538 Mon Sep 17 00:00:00 2001 From: keiichi Date: Thu, 26 Sep 2002 14:23:07 +0000 Subject: [PATCH] (gnus-bbdb/update-record): Don't refer group parameter here. (gnus-bbdb/article-prepare-hook): New function. (gnus-bbdb-insinuate): Add hook `gnus-bbdb/article-prepare-hook' to `gnus-article-prepare-hook' instead of `gnus-bbdb/update-record'. --- lisp/gnus-bbdb.el | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lisp/gnus-bbdb.el b/lisp/gnus-bbdb.el index 5beeabc..11a6924 100644 --- a/lisp/gnus-bbdb.el +++ b/lisp/gnus-bbdb.el @@ -37,10 +37,11 @@ (require 'gnus-win) (require 'cl)) -(add-to-list 'gnus-user-group-parameters - '(bbdb-auto-create-p - (const :tag "Auto register address to BBDB" t) - "Create new bbdb records people you receive mail from.")) +(eval-after-load "gnus-cus" + '(add-to-list 'gnus-user-group-parameters + '(bbdb-auto-create-p + (const :tag "Auto register address to BBDB" t) + "Create new bbdb records people you receive mail from."))) (defvar gnus-bbdb/decode-field-body-function 'nnheader-decode-field-body "*Field body decoder.") @@ -76,11 +77,6 @@ the user confirms the creation." (bbdb-annotate-message-sender from t (or (bbdb-invoke-hook-for-value bbdb/news-auto-create-p) - (gnus-group-find-parameter - (with-current-buffer - gnus-article-current-summary - gnus-newsgroup-name) - 'bbdb-auto-create-p t) offer-to-create) offer-to-create)))))) @@ -604,6 +600,14 @@ beginning of the message headers." (setq dest (nreverse dest)) (mapconcat 'identity dest " "))) +(defun gnus-bbdb/article-prepare-hook () + (let ((bbdb/news-auto-create-p (gnus-group-find-parameter + (with-current-buffer + gnus-article-current-summary + gnus-newsgroup-name) + 'bbdb-auto-create-p))) + (gnus-bbdb/update-record))) + ;; ;; Insinuation ;; @@ -615,7 +619,7 @@ beginning of the message headers." (when (boundp 'bbdb-extract-field-value-function-list) (add-to-list 'bbdb-extract-field-value-function-list 'gnus-bbdb/extract-field-value-init)) - (add-hook 'gnus-article-prepare-hook 'gnus-bbdb/update-record) + (add-hook 'gnus-article-prepare-hook 'gnus-bbdb/article-prepare-hook) (add-hook 'gnus-save-newsrc-hook 'bbdb-offer-save) (define-key gnus-summary-mode-map ":" 'gnus-bbdb/show-sender) (define-key gnus-summary-mode-map ";" 'gnus-bbdb/edit-notes) -- 1.7.10.4