This commit was generated by cvs2svn to compensate for changes in r485,
[elisp/tm.git] / tm-bbdb.el
index 2a8af28..e07e816 100644 (file)
@@ -6,7 +6,7 @@
 ;; Author: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
 ;;         Artur Pioro <artur@flugor.if.uj.edu.pl>
 ;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
-;; Version: $Id: tm-bbdb.el,v 7.19 1996/10/22 05:28:23 shuhei-k Exp $
+;; Version: $Id: tm-bbdb.el,v 7.22 1996/11/30 18:40:09 shuhei-k Exp $
 ;; Keywords: mail, news, MIME, multimedia, multilingual, BBDB
 
 ;; This file is part of tm (Tools for MIME).
 
 ;;; Code:
 
-(require 'bbdb)
-(require 'bbdb-com)
 (require 'std11)
 (require 'tm-ew-d)
 (require 'tm-view)
-
+(require 'bbdb-com) ; (require 'bbdb) implicitly
 
 ;;; @ mail-extr
 ;;;
@@ -148,7 +146,7 @@ the user confirms the creation."
         ))))
 
 (defun tm-bbdb/annotate-sender (string)
-  "Add a line to the end of the Notes field of the BBDB record 
+  "Add a line to the end of the Notes field of the BBDB record
 corresponding to the sender of this message."
   (interactive
    (list (if bbdb-readonly-p
@@ -179,24 +177,28 @@ This buffer will be in bbdb-mode, with associated keybindings."
 (defun tm-bbdb/pop-up-bbdb-buffer (&optional offer-to-create)
   "Make the *BBDB* buffer be displayed along with the MIME preview window(s),
 displaying the record corresponding to the sender of the current message."
-  (bbdb-pop-up-bbdb-buffer
-   (function
-    (lambda (w)
-      (let ((b (current-buffer)))
-        (set-buffer (window-buffer w))
-        (prog1 (eq major-mode 'mime/viewer-mode)
-          (set-buffer b))))))
-  (let ((bbdb-gag-messages t)
-        (bbdb-use-pop-up nil)
-        (bbdb-electric-p nil))
-    (let ((record (tm-bbdb/update-record offer-to-create))
-          (bbdb-elided-display (bbdb-pop-up-elided-display))
-          (b (current-buffer)))
-      (bbdb-display-records (if record (list record) nil))
-      (or record
-          (delete-windows-on (get-buffer "*BBDB*")))
-      (set-buffer b)
-      record)))
+  (let ((framepop (eq temp-buffer-show-function 'framepop-display-buffer)))
+    (or framepop
+        (bbdb-pop-up-bbdb-buffer
+         (function
+          (lambda (w)
+            (let ((b (current-buffer)))
+              (set-buffer (window-buffer w))
+              (prog1 (eq major-mode 'mime/viewer-mode)
+                (set-buffer b)))))))
+    (let ((bbdb-gag-messages t)
+          (bbdb-use-pop-up nil)
+          (bbdb-electric-p nil))
+      (let ((record (tm-bbdb/update-record offer-to-create))
+            (bbdb-elided-display (bbdb-pop-up-elided-display))
+            (b (current-buffer)))
+        (if framepop
+            (if record
+                (bbdb-display-records (list record))
+              (framepop-banish))
+          (bbdb-display-records (if record (list record) nil)))
+        (set-buffer b)
+        record))))
 
 (defun tm-bbdb/define-keys ()
   (let ((mime/viewer-mode-map (current-local-map)))
@@ -220,9 +222,9 @@ displaying the record corresponding to the sender of the current message."
 (defun signature/set-bbdb-sigtype (sigtype addr)
   "Add sigtype information to BBDB."
   (let* ((bbdb-notice-hook nil)
-         (record (bbdb-annotate-message-sender 
+         (record (bbdb-annotate-message-sender
                   addr t
-                  (bbdb-invoke-hook-for-value 
+                  (bbdb-invoke-hook-for-value
                    bbdb/mail-auto-create-p)
                   t)))
     (if record
@@ -236,7 +238,7 @@ displaying the record corresponding to the sender of the current message."
          (addr (and to
                     (car (cdr (mail-extract-address-components to)))))
          (sigtype (signature/get-bbdb-sigtype addr))
-         return  
+         return
          )
     (if addr
         (if verbose