;;; detached-minibuf.el -- Support a detached minibuffer for XEmacs.
;; Copyright (C) 2001 Vin Shelton
;; Author: Vin Shelton <firstname.lastname@example.org>
;; Keywords: extensions
;; This file is part of XEmacs.
;; XEmacs is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your
;; option) any later version.
;; XEmacs is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with XEmacs; if not, write to the Free Software Foundation,
;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
;;; Synched up with: not in FSF.
;; WARNING. DANGER. This file reportedly crashes 19.14, use it only with a
;; recent XEmacs.
;; Version: 1.1
;; Variable definitions
(defgroup detached-minibuf nil
"Support a detached minibuffer in XEmacs"
(defcustom add-minibuf-options t
"*If nil, prevent minibuffer options from being added to the Options menu.\
This must be set before detached-minibuf is loaded."
(defcustom minibuf-frame-height 1
"*The height in lines of the minibuffer frame created by make-detached-minibuf"
(defcustom minibuf-frame-width (frame-width (selected-frame))
"*The width in chars of the minibuffer frame created by make-detached-minibuf"
(defcustom minibuf-frame-pos-y -2
"*The y position of the minibuffer frame as created by make-detached-minibuf"
(defcustom minibuf-frame-pos-x -2
"*The x position of the minibuffer frame as created by make-detached-minibuf"
;; Add minibuffer options to the Options menu
(defun toggle-minibuf ()
(if (equal (frame-property (selected-frame) 'minibuffer) t)
;; This frame already has a minibuffer, so remove the minibuffer.
;; Unfortunately, we must delete and redraw the frame
(let ((fp (frame-properties (selected-frame)))
;; Create and select the new frame;
;; we have to do this before we delete the old frame.
(setq fp (plist-remprop fp 'window-id)
fp (plist-remprop fp 'minibuffer))
(make-frame (plist-put fp 'minibuffer nil)))
orig (list 'minibuffer default-minibuffer-frame))
(delete-frame orig t))
;; This frame does not have a minibuffer, so add one
(set-frame-property (selected-frame) 'minibuffer t)))
;; The menu structure is different before XEmacs 21.2.
;; Under 21.1 and previous, add menu items to
;; Options/Frame Appearance. Under 21.2+, add the
;; menu items to Options/Display.
(let ((entry-name (if (fboundp 'purecopy-menubar)
'("Options" "Frame Appearance")
:active (not (equal (selected-frame)
(frame-property (selected-frame) 'minibuffer)
["Default minibuffer here"
(setq default-minibuffer-frame (selected-frame))
:active (let ((mbf (frame-property
(or (equal mbf (selected-frame))
(equal mbf t)))
:selected (equal (selected-frame)
["Make a detached minibuffer"
;; Create a minibuffer-only frame.
;; This function creates a frame named "minibuffer".
;; You will likely want this frame not to have a titlebar.
;; In order to do this for gwm, uncomment the following line
;; and add it to your .profile.gwm:
;; (set-window Emacs.minibuffer no-frame)
(defun make-detached-minibuf ()
"Create a standalone minibuffer"
(list 'minibuffer nil
'width (frame-width (selected-frame))
'height (frame-height (selected-frame))))
(list 'minibuffer 'only
;; Bogus! But it avoids annoying screen flash at startup
(if (not command-line-args-left)
;;; detached-minibuf.el ends here