all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'martin rudalics'" <rudalics@gmx.at>,
	"'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 'Tassilo Horn' <tassilo@member.fsf.org>, emacs-devel@gnu.org
Subject: RE: Usage examples of dedicated windows and popup frames?
Date: Sat, 9 Jul 2011 08:03:31 -0700	[thread overview]
Message-ID: <D2372B52AC294892B7D1E4E89FC083D9@us.oracle.com> (raw)
In-Reply-To: <4E185100.2050100@gmx.at>

>  >> 1. Goto *scratch* and eval the form above.
>  >> 2. (def<TAB> ==> a comletion frame pops up *and gets input focus*
>  >
>  > This input focus issue is a problem, indeed, but AFAIK 
>  > it's one that's difficult to fix.
> 
> Drew uses `redirect-frame-focus' and from what I can tell after
> experimenting a bit with his code it seems to work.

Yes, but I do that explicitly as part of my setup, and only for the
`*Completions*' frame.  I know ahead of time that Emacs will use buffer
`*Completions*', and I know that its input focus should be redirected to the
minibuffer frame (by default).

But as I mentioned, there are occasionally some other frames that pop up in a
context where the focus should remain in the minibuffer.  In my case, buffers
named `*...*' are special-display (dedicated), so they pop up in separate
frames.  Only rarely is such a buffer used as part of a dialog, but it can
happen, breaking the necessary input focus.

Some such pop-up frames are in fact for completion.  Some vanilla and 3rd-party
Emacs code uses completion with a buffer other than `*Completions*'.  Nothing
inherently wrong with that, but it thus steps outside my workaround of
redirecting the `*Completions*' frame focus to the minibuffer frame.

For instance, after `M-e' in Isearch, `M-TAB' completes, and if there is more
than one candidate then it pops up buffer `*Isearch completions*' (not
`*Completions*').

Since that buffer name matches my `special-display-regexps', it gets a separate,
dedicated frame.  And when the new frame is created Windows gives it the focus,
taking the focus away from the minibuffer frame.  Without some extra, workaround
coding for such a case the user needs to click the minibuffer frame to get the
focus back where it belongs.

And obviously a user cannot really special-code or customize to deal with each
such pop-up frame that might arise.  Nothing prevents a library (vanilla or
otherwise) from popping up a buffer whose name matches
`special-display-regexps', including for completion or another context where the
focus should not move to another frame.

And then there's the problem of removing that popped-up frame when the dialog is
finished.  Similarly, there I can foresee the problem in the case of
`*Completions*' and handle it specially (knowing the completion dialog).  Not so
in the general case (unknown).

Again, in practice there are only very few such pop-up dialog frames, other than
`*Completions*'.  But there is still a general problem, even if it is rare
because I've taken care of it for the main case (`*Completions*').

I know that you know all of this already.  Just mentioning it to complete the
thread info a bit.


Perhaps we could add a way for code to indicate that it is displaying a given
buffer only for the purpose and duration of a user dialog, and thus:

a. For that duration the buffer's frame (if separate) would have its input focus
redirected to the minibuffer's frame.

b. After the dialog finishes, the buffer's frame (if separate) would be deleted.

E.g., something like: (with-dialog-buffer BUF ...)

Perhaps something like that could be a way to handle the general case (providing
that coders actually used it).




  reply	other threads:[~2011-07-09 15:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08 14:19 Usage examples of dedicated windows and popup frames? Tassilo Horn
2011-07-08 14:47 ` Richard Riley
2011-07-08 14:49 ` John Yates
2011-07-08 16:11 ` Stefan Monnier
2011-07-08 16:34   ` Drew Adams
2011-07-08 16:51     ` Stefan Monnier
2011-07-08 17:38       ` Drew Adams
2011-07-08 17:54   ` Tassilo Horn
2011-07-08 18:55     ` Stefan Monnier
2011-07-09 13:00       ` martin rudalics
2011-07-09 15:03         ` Drew Adams [this message]
2011-07-10  0:43           ` chad
2011-07-10  9:00             ` martin rudalics
2011-07-10  9:43             ` Drew Adams
2011-07-12 17:47               ` chad
2011-07-12 18:55                 ` Drew Adams
2011-07-13  6:24                 ` martin rudalics
2011-07-13 23:09                   ` chad
2011-07-10 23:45           ` undisplay temporary dialog buffers when done [was: ... dedicated windows and popup frames] Drew Adams
2011-07-09 17:22         ` Usage examples of dedicated windows and popup frames? Tassilo Horn
2011-07-10  9:00           ` martin rudalics
2011-07-10  9:39             ` Tassilo Horn
2011-07-10 15:30               ` martin rudalics
2011-07-10 16:00                 ` Tassilo Horn
2011-07-10 21:13                   ` Drew Adams
2011-07-08 16:11 ` Drew Adams

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

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

  git send-email \
    --in-reply-to=D2372B52AC294892B7D1E4E89FC083D9@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    --cc=tassilo@member.fsf.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.