From: Katsumi Yamaoka <yamaoka@jpl.org>
To: emacs-devel@gnu.org
Subject: Re: put input focus on active minibuffer
Date: Tue, 23 Feb 2016 08:43:06 +0900 [thread overview]
Message-ID: <b4mwppw5n1x.fsf@jpl.org> (raw)
In-Reply-To: m2povsnmlf.fsf@newartisans.com
On Fri, 19 Feb 2016 18:26:36 -0800, John Wiegley wrote:
> Since Emacs allows the use of other buffers while the minibuffer is waiting
> for input, it's not uncommon to click on the window you want to interact with,
> regardless of whether a question is being asked. So I don't think we can
> change the default behavior to switch window focus based on such a question in
> the minibuffer.
Agreed. To tell the truth, I'm not necessarily sure if the feature
is really useful for me because I've never experienced it so far.
> However, it does sound like an interesting configuration option, as I've
> indeed been in that scenario many times before. My recommendation would be to
> try out the code Alexis offered, and come back after some time has passed if
> you feel the change improves your experience well enough that it should become
> a standard option.
Thanks for following it up, and sorry for my no response (as my
circuit design work is piled up these days). I tried Alexis'
solution below but it changed nothing in at least Cygwin.
#+BEGIN_SRC emacs-lisp
(defun focus-to-active-minibuffer ()
(if (minibuffer-window-active-p (minibuffer-window))
(select-window (minibuffer-window))))
(add-hook 'focus-in-hook #'focus-to-active-minibuffer)
#+END_SRC
When I eval'd (read-file-name "What? ") in the *scratch* buffer,
selected another frame of the desktop, and clicked the *scratch*
window to re-select the Emacs frame in question, I could verify
`focus-to-active-minibuffer' was called and it selected the
minibuffer window (using edebug). However, the cursor moved to
the *scratch* window after the hook function exited. I guess
whether this does work might depend on the windowing system. If
so, I can imagine it's not an easy matter to solve.
Anyway I think it's good if such an option were available. It
has not to be turned on by default of course.
Regards,
next prev parent reply other threads:[~2016-02-22 23:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-12 10:19 put input focus on active minibuffer Katsumi Yamaoka
2016-02-12 14:53 ` Drew Adams
2016-02-14 4:52 ` Alexis
2016-02-14 16:54 ` Drew Adams
2016-02-15 2:43 ` Alexis
2016-02-15 3:01 ` Drew Adams
2016-02-15 4:34 ` Yuri Khan
2016-02-20 2:26 ` John Wiegley
2016-02-22 23:43 ` Katsumi Yamaoka [this message]
2016-02-24 2:22 ` Elias Mårtenson
-- strict thread matches above, loose matches on Subject: below --
2016-02-15 6:37 Alexis
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=b4mwppw5n1x.fsf@jpl.org \
--to=yamaoka@jpl.org \
--cc=emacs-devel@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).