| •1 |
;;; mew-toolbar-frame.el -*-Emacs-Lisp-*- |
| 2 |
;;; |
| 3 |
;;; Commentary: |
| 4 |
;;; Run Mew from toolbar in a separate frame. |
| 5 |
;;; |
| 6 |
;;; Keywords: |
| 7 |
;;; Mew Xemacs ToolBar Frame |
| 8 |
;;; |
| 9 |
;;; Time-stamp: <99/07/02 16:37:17 jado@sophia> |
| 10 |
|
| 11 |
;;; How to use: |
| 12 |
;;; Require it when initialize. |
| 13 |
|
| 14 |
;;; Code: |
| 15 |
|
| 16 |
(provide 'mew-toolbar-frame) |
| 17 |
|
| 18 |
;;; |
| 19 |
|
| 20 |
(setq toolbar-mail-reader 'Mew) |
| 21 |
(setq toolbar-mail-commands-alist |
| 22 |
(cons '(Mew . toolbar-mew) toolbar-mail-commands-alist)) |
| 23 |
|
| 24 |
(defvar toolbar-mail-use-separate-frame t |
| 25 |
"*Whether Mew is invoked in a separate frame.") |
| 26 |
(defvar toolbar-mail-frame nil |
| 27 |
"The frame in which Mew is displayed.") |
| 28 |
(defvar toolbar-mail-frame-plist nil |
| 29 |
"*The properties of the frame in which mail is displayed.") |
| 30 |
(define-obsolete-variable-alias 'toolbar-mail-frame-properties |
| 31 |
'toolbar-mail-frame-plist) |
| 32 |
|
| 33 |
(defun toolbar-mew () |
| 34 |
"Run Mew in a separate frame." |
| 35 |
(interactive) |
| 36 |
(if (not toolbar-mail-use-separate-frame) |
| 37 |
(mew) |
| 38 |
(unless (frame-live-p toolbar-mail-frame) |
| 39 |
(setq toolbar-mail-frame (make-frame toolbar-mail-frame-plist)) |
| 40 |
(add-hook 'mew-suspend-hook |
| 41 |
(lambda () |
| 42 |
(when (frame-live-p toolbar-mail-frame) |
| 43 |
(if (cdr (frame-list)) |
| 44 |
(delete-frame toolbar-mail-frame)) |
| 45 |
(setq toolbar-mail-frame nil)))) |
| 46 |
(add-hook 'mew-quit-hook |
| 47 |
(lambda () |
| 48 |
(when (frame-live-p toolbar-mail-frame) |
| 49 |
(if (cdr (frame-list)) |
| 50 |
(delete-frame toolbar-mail-frame)) |
| 51 |
(setq toolbar-mail-frame nil)))) |
| 52 |
(select-frame toolbar-mail-frame) |
| 53 |
(mew)) |
| 54 |
(when (framep toolbar-mail-frame) |
| 55 |
(when (frame-iconified-p toolbar-mail-frame) |
| 56 |
(deiconify-frame toolbar-mail-frame)) |
| 57 |
(select-frame toolbar-mail-frame) |
| 58 |
(raise-frame toolbar-mail-frame)))) |
| 59 |
|
| 60 |
;;; Copyright Notice: |
| 61 |
|
| 62 |
;; Copyright (C) 1999 Mew developing team. |
| 63 |
;; All rights reserved. |
| 64 |
|
| 65 |
;; Redistribution and use in source and binary forms, with or without |
| 66 |
;; modification, are permitted provided that the following conditions |
| 67 |
;; are met: |
| 68 |
;; |
| 69 |
;; 1. Redistributions of source code must retain the above copyright |
| 70 |
;; notice, this list of conditions and the following disclaimer. |
| 71 |
;; 2. Redistributions in binary form must reproduce the above copyright |
| 72 |
;; notice, this list of conditions and the following disclaimer in the |
| 73 |
;; documentation and/or other materials provided with the distribution. |
| 74 |
;; 3. Neither the name of the team nor the names of its contributors |
| 75 |
;; may be used to endorse or promote products derived from this software |
| 76 |
;; without specific prior written permission. |
| 77 |
;; |
| 78 |
;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND |
| 79 |
;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 80 |
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 81 |
;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE |
| 82 |
;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 83 |
;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 84 |
;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 85 |
;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 86 |
;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 87 |
;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 88 |
;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 89 |
|
| 90 |
;;; mew-toolbar-frame.el ends here |