X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-bbdb.el;h=06ea9efe94ea9105c1baeed6d9faec531162817e;hb=e2aa14e5654094e9e8dc4434192bab7f8974e0f7;hp=e07e816f80e08a57e6daa475db1875704a82e8d1;hpb=0a13bbcec55dfa171236508297136905c782ad56;p=elisp%2Ftm.git diff --git a/tm-bbdb.el b/tm-bbdb.el index e07e816..06ea9ef 100644 --- a/tm-bbdb.el +++ b/tm-bbdb.el @@ -6,7 +6,7 @@ ;; Author: Shuhei KOBAYASHI ;; Artur Pioro ;; Maintainer: Shuhei KOBAYASHI -;; Version: $Id: tm-bbdb.el,v 7.22 1996/11/30 18:40:09 shuhei-k Exp $ +;; Version: $Id: tm-bbdb.el,v 7.27 1996/12/10 14:24:23 morioka Exp $ ;; Keywords: mail, news, MIME, multimedia, multilingual, BBDB ;; This file is part of tm (Tools for MIME). @@ -31,12 +31,46 @@ (require 'std11) (require 'tm-ew-d) (require 'tm-view) -(require 'bbdb-com) ; (require 'bbdb) implicitly +(if (module-installed-p 'bbdb-com) + (require 'bbdb-com) + (eval-when-compile + ;; imported from bbdb-1.51 + (defmacro bbdb-pop-up-elided-display () + '(if (boundp 'bbdb-pop-up-elided-display) + bbdb-pop-up-elided-display + bbdb-elided-display)) + (defmacro bbdb-user-mail-names () + "Returns a regexp matching the address of the logged-in user" + '(or bbdb-user-mail-names + (setq bbdb-user-mail-names + (concat "\\b" (regexp-quote (user-login-name)) "\\b")))) + )) -;;; @ mail-extr + +;;; @ User Variables ;;; -(defvar tm-bbdb/use-mail-extr t) +(defvar tm-bbdb/use-mail-extr t + "*If non-nil, `mail-extract-address-components' is used. +Otherwise `tm-bbdb/extract-address-components' overrides it.") + +(defvar tm-bbdb/auto-create-p nil + "*If t, create new BBDB records automatically. +If function, then it is called with no arguments to decide whether an +entry should be automatically creaded. + +tm-bbdb uses this variable instead of `bbdb/mail-auto-create-p' or +`bbdb/news-auto-create-p' unless other tm-MUA overrides it.") + +(defvar tm-bbdb/delete-empty-window nil + "*If non-nil, delete empty BBDB window. +All bbdb-MUAs but bbdb-gnus display BBDB window even if it is empty. +If you prefer behavior of bbdb-gnus, set this variable to t. + +For framepop users: If empty, `framepop-banish' is used instead.") + +;;; @ mail-extr +;;; (defun tm-bbdb/extract-address-components (str) (let* ((ret (std11-extract-address-components str)) @@ -116,8 +150,6 @@ ;;; @ BBDB functions for mime/viewer-mode ;;; -(defvar tm-bbdb/auto-create-p nil) - (defun tm-bbdb/update-record (&optional offer-to-create) "Return the record corresponding to the current MIME previewing message. Creating or modifying it as necessary. A record will be created if @@ -196,7 +228,10 @@ displaying the record corresponding to the sender of the current message." (if record (bbdb-display-records (list record)) (framepop-banish)) - (bbdb-display-records (if record (list record) nil))) + (bbdb-display-records (if record (list record) nil)) + (if (and (null record) + tm-bbdb/delete-empty-window) + (delete-windows-on (get-buffer "*BBDB*")))) (set-buffer b) record))))