* wl.el (wl-exit): If wl-delete-startup-frame-function is non-nil,
authorteranisi <teranisi>
Fri, 25 Jan 2002 02:10:04 +0000 (02:10 +0000)
committerteranisi <teranisi>
Fri, 25 Jan 2002 02:10:04 +0000 (02:10 +0000)
call it.
(wl-delete-startup-frame-function): New variable.
(wl-other-frame): New function
(Original was written by Yamaoka san [wl: 09239]).

* wl-folder.el (wl-folder): Set up `wl-delete-startup-frame-function'
if `wl-folder-use-frame'.

wl/ChangeLog
wl/wl-folder.el
wl/wl.el

index 9aa1796..e2faa83 100644 (file)
@@ -1,3 +1,14 @@
+2002-01-25  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * wl.el (wl-exit): If wl-delete-startup-frame-function is non-nil,
+       call it.
+       (wl-delete-startup-frame-function): New variable.
+       (wl-other-frame): New function
+       (Original was written by Yamaoka san [wl: 09239]).
+
+       * wl-folder.el (wl-folder): Set up `wl-delete-startup-frame-function'
+       if `wl-folder-use-frame'.
+
 2002-01-24  Kenichi OKADA  <okada@opaopa.org>
 
        * wl-message.el (wl-message-buffer-prefetch-p): Check plugged.
index 99f2445..e54b311 100644 (file)
@@ -1462,8 +1462,16 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'."
                (switch-to-buffer folder-buf)))
          (switch-to-buffer folder-buf))
       (if wl-folder-use-frame
-         (switch-to-buffer-other-frame
-          (get-buffer-create wl-folder-buffer-name))
+         (progn
+           (switch-to-buffer-other-frame
+            (get-buffer-create wl-folder-buffer-name))
+           (let ((frame (selected-frame)))
+             (setq wl-delete-startup-frame-function
+                   `(lambda ()
+                      (setq wl-delete-startup-frame-function nil)
+                      (let ((frame ,frame))
+                        (if (eq (selected-frame) frame)
+                            (delete-frame frame)))))))
        (switch-to-buffer (get-buffer-create wl-folder-buffer-name)))
       (set-buffer wl-folder-buffer-name)
       (wl-folder-mode)
index b952989..8a970b9 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -666,9 +666,11 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
                        (list wl-folder-buffer-name
                              wl-plugged-buf-name)
                        "\\|")))
-    (if (and wl-folder-use-frame
-            (> (length (visible-frame-list)) 1))
-       (delete-frame))
+    (when wl-delete-startup-frame-function
+      (funcall wl-delete-startup-frame-function))
+;;    (if (and wl-folder-use-frame
+;;          (> (length (visible-frame-list)) 1))
+;;     (delete-frame))
     (setq wl-init nil)
     (remove-hook 'kill-emacs-hook 'wl-save-status)
     t)
@@ -836,6 +838,52 @@ If ARG (prefix argument) is specified, folder checkings are skipped."
        (kill-buffer demo-buf)))
   (run-hooks 'wl-hook))
 
+(defvar wl-delete-startup-frame-function nil)
+
+;;;###autoload
+(defun wl-other-frame (&optional arg)
+  "Pop up a frame to read messages via Wanderlust."
+  (interactive)
+  (let ((focusing-functions (append '(raise-frame select-frame)
+                                   (if (fboundp 'x-focus-frame)
+                                       '(x-focus-frame)
+                                     '(focus-frame))))
+       (folder (get-buffer wl-folder-buffer-name))
+       window frame wl-folder-use-frame)
+    (if (and folder
+            (setq window (get-buffer-window folder t))
+            (window-live-p window)
+            (setq frame (window-frame window)))
+       (progn
+         (while focusing-functions
+           (funcall (car focusing-functions) frame)
+           (setq focusing-functions (cdr focusing-functions)))
+         (wl arg))
+      (setq frame (make-frame))
+      (while focusing-functions
+       (funcall (car focusing-functions) frame)
+       (setq focusing-functions (cdr focusing-functions)))
+      (setq wl-delete-startup-frame-function
+           `(lambda ()
+              (setq wl-delete-startup-frame-function nil)
+              (let ((frame ,frame))
+                (if (eq (selected-frame) frame)
+                    (delete-frame frame)))))
+      (let ((demo-buf (if (and (not wl-init)
+                              wl-demo)
+                         (wl-demo)))
+           wl-demo)
+       (unless wl-init
+         (wl-load-profile)
+         (wl-folder-init)
+         (elmo-init))
+       (wl-init)       
+       (sit-for 0)
+       (prog1
+           (wl arg)
+         (if (buffer-live-p demo-buf)
+             (kill-buffer demo-buf)))))))
+
 ;; Define some autoload functions WL might use.
 (eval-and-compile
   ;; This little mapcar goes through the list below and marks the