-;; gnus-bbdb.el --- Interface to Nana-gnus version 6.10.2.
+;; gnus-bbdb.el --- Interface to Semi-gnus
;; Copyright (c) 1991,1992,1993 Jamie Zawinski <jwz@netscape.com>.
;; Copyright (C) 1995,1996,1997 Shuhei KOBAYASHI
;; Author: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
;; Keywords: BBDB, MIME, multimedia, multilingual, mail, news
-;; This file is part of Nana-gnus.
+;; This file is part of Semi-gnus.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
(eval-when-compile
(require 'gnus-win))
-(defvar gnus-bbeb/decode-field-body-function 'nnheader-decode-field-body
+(defvar gnus-bbdb/decode-field-body-function 'nnheader-decode-field-body
"*Field body decoder.")
(defmacro gnus-bbdb/decode-field-body (field-body field-name)
- `(or (and (functionp gnus-bbeb/decode-field-body-function)
- (funcall gnus-bbeb/decode-field-body-function
+ `(or (and (functionp gnus-bbdb/decode-field-body-function)
+ (funcall gnus-bbdb/decode-field-body-function
,field-body ,field-name))
,field-body))
the user confirms the creation."
(if bbdb-use-pop-up
(gnus-bbdb/pop-up-bbdb-buffer offer-to-create)
- (let (from)
+ (save-excursion
(save-restriction
- (set-buffer gnus-original-article-buffer)
- (widen)
- (narrow-to-region (point-min)
- (progn (goto-char (point-min))
- (or (search-forward "\n\n" nil t)
- (error "message unexists"))
- (- (point) 2)))
- (when (setq from (mail-fetch-field "from"))
- (setq from (gnus-bbdb/extract-address-components
- (gnus-bbdb/decode-field-body from 'From))))
- (when (or (null from)
- (string-match (bbdb-user-mail-names)
- (car (cdr from))))
- ;; if logged-in user sent this, use recipients.
- (let ((to (mail-fetch-field "to")))
- (when to
- (setq from
- (gnus-bbdb/extract-address-components
- (gnus-bbdb/decode-field-body to 'To)))))))
- (when from
- (bbdb-annotate-message-sender from t
- (or (bbdb-invoke-hook-for-value
- bbdb/news-auto-create-p)
- offer-to-create)
- offer-to-create)))))
+ (let (from)
+ (set-buffer gnus-original-article-buffer)
+ (widen)
+ (narrow-to-region (point-min)
+ (progn (goto-char (point-min))
+ (or (search-forward "\n\n" nil t)
+ (error "message unexists"))
+ (- (point) 2)))
+ (when (setq from (mail-fetch-field "from"))
+ (setq from (gnus-bbdb/extract-address-components
+ (gnus-bbdb/decode-field-body from 'From))))
+ (when (and (car (cdr from))
+ (string-match (bbdb-user-mail-names)
+ (car (cdr from))))
+ ;; if logged-in user sent this, use recipients.
+ (let ((to (mail-fetch-field "to")))
+ (when to
+ (setq from
+ (gnus-bbdb/extract-address-components
+ (gnus-bbdb/decode-field-body to 'To))))))
+ (when from
+ (bbdb-annotate-message-sender from t
+ (or (bbdb-invoke-hook-for-value
+ bbdb/news-auto-create-p)
+ offer-to-create)
+ offer-to-create)))))))
;;;###autoload
(defun gnus-bbdb/annotate-sender (string &optional replace)
(bbdb-display-records (list record))
(error "unperson"))))
+;; Avoid byte-compile warning.
+(defvar bbdb-pop-up-elided-display)
(defun gnus-bbdb/pop-up-bbdb-buffer (&optional offer-to-create)
"Make the *BBDB* buffer be displayed along with the GNUS windows,
methods (cdr methods)))
(if (string= address "") (setq address nil))
(if (string= phrase "") (setq phrase nil))
- (list phrase address)
+ (when (or phrase address)
+ (list phrase address))
))
;;; @ full-name canonicalization methods