[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: menu-bar: disable items when no frame visible

From: David Reitter
Subject: Re: menu-bar: disable items when no frame visible
Date: Sun, 25 Dec 2005 10:54:07 +0100

On 25 Dec 2005, at 03:51, Richard M. Stallman wrote:

But I would suggest improving find-file to catch the error in switch-
    to-buffer and show the buffer in another window in that case, at
    least when called interactively.

Why do you find it so often useful to invoke Find File
while you're in a minibuffer?

Usually I have started something else which reads an argument in the minibuffer, either in error or because I'd like to look up something in another file in order to supply the right input. This applies to invoking switch-to-buffer with the same reasoning -- you'd like to look up something else.

WIthout having counted these cases, I'd say the majority of cases is erroneous invoking of the first command that gets me to the minibuffer. (Of course, I should do C-g, but that doesn't happen.) That's why I've been looking for a way to enable "sequential" instead of "recursive" minibuffers (see my recent message below).

Either method (switch-to-buffer using a different window if in minibuffer and interactive, and: sequential minibuffers) address similar situations and would be of benefit at least to the inexperienced user.

Begin forwarded message:

From:     address@hidden
Subject:        Sequential instead of recursive minibuffers?
Date:   15 December 2005 20:02:28 GMT+01:00
To:       address@hidden

Is it possible to automatically signal a `quit' to the current minibuffer prompt function when another minibuffer is set up?

We've had a discussion back in summer:


To explain this a little further: I can currently choose between normal (simple) minibuffers and recursive minibuffers. The difference is in the behavior if a user presses a key sequence bound to an interactive command, sees the prompt and decides that it was the wrong command. Now (without a C-g in between) he remembers the correct command and enters that one.

The first option will always signal an error ("Command attempted to use minibuffer while in minibuffer"), which is somewhat confusing and certainly annoying to me. A couple of months ago, when I didn't know anything about this minibuffer business, I was confused big time! The "recursive minibuffer" setting will do just what it says - which means that the old prompt will reappear as soon as the new command is finished. This is equally confusing, in particular to new users. I often get caught in situations where several minibuffers stack up and I have to C-g several times to get out of the situation.

In the previously mentioned discussion, some UI-based workarounds have been proposed (e.g. different colors depending on minibuffer state). What I'd like to configure in my Emacs is a sequential minibuffer: As soon as I enter another interactive command, the currently running one is quit. My first attempt at doing that was

(setq enable-recursive-minibuffers nil)
(add-hook 'minibuffer-setup-hook

which fails because `keyboard-quit' is, of course, executed in the wrong context.

Again, the logic could be:

- if we're in an interactive command (call-interactively) that uses the minibuffer (A) - and another interactive is called (but not via a minibuffer- specific keymap) which prompts for some input in the minibuffer (B)

then signal 'quit'  to A and continue with B.

That way I can do M-x M-x ...., or something like C-x C-f di C-h f ding RET (where I confused C-h f with C-x C-f) without any error messages, without remaining minibuffers that I don't want and with exactly the desired result.

I have no idea how to accomplish this -- any suggestions would be appreciated.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]