unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: C-x C-f in two frames -> "user minibuffer while in minibuffer": Bug?
Date: Thu, 9 Jun 2005 09:22:44 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICEEAMCJAA.drew.adams@oracle.com> (raw)
In-Reply-To: <C2376256-4AAC-4FCF-B71B-65FEAF2AB9FF@gmail.com>

    If I open a second frame, then do C-x C-f in one of them and press
    tab so that the window is split and I get a *Completions* buffer in
    one frame, and when I then select the second frame and do a C-x C-f
    there, I don't get another *Completions* buffer there, but an error
    message that appears in the first frame:

    "Command attempted to use minibuffer while in minibuffer"

    This happens with standard settings, on the GNU/Linux port as well as
    on Carbon, no matter what display-buffer-reuse-frames is.
    Is that a bug?

Others have explained what's happening wrt minibuffer input. Here's some
more info that might help:

The *Completions* buffer is a bit special, in that its input is directed to
the minibuffer. When it is in a separate frame, the frame focus needs to be
redirected to the minibuffer explicitly, I've found. I do this:

;; Use `my-display-*Completions*-frame' to display *Completions* buffer
(add-to-list
  'special-display-buffer-names
  (list "*Completions*" 'my-display-*Completions*-frame))

(defun my-display-*Completions*-frame (buf &optional args)
  "Display *Completions* buffer in its own frame.
`special-display-function' is used to do the actual displaying.
Completion input events are redirected to `my-minibuffer-frame'."
  (let (return-window)
    (setq return-window
          (select-window (funcall special-display-function buf args)))
    (raise-frame)
    (redirect-frame-focus (selected-frame) my-minibuffer-frame)
    return-window))

The key line is the second-to-last: redirect-frame-focus.

The value of variable `my-minibuffer-frame' is a standalone minibuffer
(only) frame. (For the complete code, see
http://www.emacswiki.org/elisp/oneonone.el. See also
http://www.emacswiki.org/elisp/elect-mbuf.el for code that removes the
*Completions* frame when you are done with it.)

HTH,

  Drew

  parent reply	other threads:[~2005-06-09 16:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-08 13:18 C-x C-f in two frames -> "user minibuffer while in minibuffer": Bug? David Reitter
2005-06-08 14:08 ` Peter Dyballa
     [not found] ` <mailman.3863.1118240186.25862.help-gnu-emacs@gnu.org>
2005-06-08 14:55   ` C-x C-f in two frames -> "user minibuffer while in Toto
2005-07-03 21:47     ` David Combs
2005-07-04  0:15       ` Miles Bader
     [not found]       ` <mailman.2058.1120436940.2857.help-gnu-emacs@gnu.org>
2005-07-04  7:52         ` don provan
2005-07-05 22:27           ` Miles Bader
     [not found]           ` <mailman.2259.1120602813.2857.help-gnu-emacs@gnu.org>
2005-07-07  7:21             ` don provan
2005-07-07  8:57               ` Thien-Thi Nguyen
2005-07-07 15:10                 ` Drew Adams
2005-07-04  8:23         ` David Kastrup
2005-06-09 16:22 ` Drew Adams [this message]
     [not found] <mailman.3850.1118237772.25862.help-gnu-emacs@gnu.org>
2005-06-09  8:56 ` C-x C-f in two frames -> "user minibuffer while in minibuffer": Bug? Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICEEAMCJAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).