From d40d098218af0ec9276e27632ac04a08983e1859 Mon Sep 17 00:00:00 2001 From: morioka Date: Sun, 4 Oct 1998 14:42:41 +0000 Subject: [PATCH] (mime-echo-window-is-shared-with-bbdb): Check bbdb is install or not to define default value. (mime-show-echo-buffer): New implementation about `mime-echo-window-is-shared-with-bbdb'. --- mime-play.el | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mime-play.el b/mime-play.el index 25610c0..3fd36f0 100644 --- a/mime-play.el +++ b/mime-play.el @@ -352,7 +352,8 @@ specified, play as it. Default MODE is \"play\"." (remove-alist 'mime-mailcap-method-filename-alist process) (message (format "%s %s" process event))) -(defvar mime-echo-window-is-shared-with-bbdb t +(defvar mime-echo-window-is-shared-with-bbdb + (module-installed-p 'bbdb) "*If non-nil, mime-echo window is shared with BBDB window.") (defvar mime-echo-window-height @@ -370,23 +371,22 @@ window.") "Show mime-echo buffer to display MIME-playing information." (get-buffer-create mime-echo-buffer-name) (let ((the-win (selected-window)) - (win (get-buffer-window mime-echo-buffer-name)) + (win (get-buffer-window mime-echo-buffer-name))) + (unless win + (unless (and mime-echo-window-is-shared-with-bbdb + (condition-case nil + (setq win (get-buffer-window bbdb-buffer-name)) + (error nil))) + (select-window (get-buffer-window mime-preview-buffer)) + (setq win (split-window-vertically + (- (window-height) + (if (functionp mime-echo-window-height) + (funcall mime-echo-window-height) + mime-echo-window-height) + ))) ) - (or win - (if (and mime-echo-window-is-shared-with-bbdb - (boundp 'bbdb-buffer-name) - (setq win (get-buffer-window bbdb-buffer-name)) - ) - (set-window-buffer win mime-echo-buffer-name) - (select-window (get-buffer-window mime-preview-buffer)) - (setq win (split-window-vertically - (- (window-height) - (if (functionp mime-echo-window-height) - (funcall mime-echo-window-height) - mime-echo-window-height) - ))) - (set-window-buffer win mime-echo-buffer-name) - )) + (set-window-buffer win mime-echo-buffer-name) + ) (select-window win) (goto-char (point-max)) (if forms -- 1.7.10.4