((dummy
(set
(make-local-variable 'bbdb/gnus-update-records-mode)
'searching)))
(defun bbdb/gnus-update-records (&optional offer-to-create)
"Return the records corresponding to the current GNUS message, creating
or modifying it as necessary. A record will be created if
bbdb/news-auto-create-p is non-nil or if OFFER-TO-CREATE is true
and the user confirms the creation.
The variable `bbdb/gnus-update-records-mode' controls what actions
are performed and it might override `bbdb-update-records-mode'.
When hitting C-g once you will not be asked anymore for new people listed
in this message, but it will search only for existing records. When hitting
C-g again it will stop scanning."
(let ((bbdb-update-records-mode
(when (and (boundp 'gnus-summary-buffer) gnus-summary-buffer)
(with-current-buffer gnus-summary-buffer
bbdb/gnus-update-records-mode)))
(bbdb/gnus-offer-to-create offer-to-create)
(msg-id (bbdb/gnus-get-message-id))
records cache)
(save-excursion
(set-buffer gnus-article-buffer)
(if (and msg-id (not bbdb/gnus-offer-to-create))
(setq cache (bbdb-message-cache-lookup msg-id)))
(if cache
(setq records (if bbdb-get-only-first-address-p
(list (car cache))
cache))
(setq records (bbdb-update-records
(bbdb-get-addresses
bbdb-get-only-first-address-p
(or (if (boundp 'gnus-ignored-from-addresses)
gnus-ignored-from-addresses)
bbdb-user-mail-names)
'gnus-fetch-field)
bbdb/news-auto-create-p
offer-to-create))
(if (and bbdb-message-caching-enabled msg-id)
(bbdb-encache-message msg-id records))))
records))
(defun bbdb/gnus-update-records (&optional offer-to-create)
"Return the records corresponding to the current GNUS message, creating
or modifying it as necessary. A record will be created if
bbdb/news-auto-create-p is non-nil or if OFFER-TO-CREATE is true
and the user confirms the creation.
The variable `bbdb/gnus-update-records-mode' controls what actions
are performed and it might override `bbdb-update-records-mode'.
When hitting C-g once you will not be asked anymore for new people listed
in this message, but it will search only for existing records. When hitting
C-g again it will stop scanning."
(let ((bbdb-update-records-mode
(when (and (boundp 'gnus-summary-buffer)
(buffer-live-p gnus-summary-buffer))
(with-current-buffer gnus-summary-buffer
bbdb/gnus-update-records-mode)))
(bbdb/gnus-offer-to-create offer-to-create)
(msg-id (bbdb/gnus-get-message-id))
records cache)
(save-excursion
(set-buffer gnus-article-buffer)
(if (and msg-id (not bbdb/gnus-offer-to-create))
(setq cache (bbdb-message-cache-lookup msg-id)))
(if cache
(setq records (if bbdb-get-only-first-address-p
(list (car cache))
cache))
(setq records (bbdb-update-records
(bbdb-get-addresses
bbdb-get-only-first-address-p
(or (if (boundp 'gnus-ignored-from-addresses)
gnus-ignored-from-addresses)
bbdb-user-mail-names)
'gnus-fetch-field)
bbdb/news-auto-create-p
offer-to-create))
(if (and bbdb-message-caching-enabled msg-id)
(bbdb-encache-message msg-id records))))
records))