From: Konrad Podczeck <konrad.podczeck@univie.ac.at>
To: martin rudalics <rudalics@gmx.at>
Cc: 37840@debbugs.gnu.org
Subject: bug#37840: Missing in the Emacs manuals:
Date: Sat, 2 Nov 2019 22:47:40 +0100 [thread overview]
Message-ID: <BAE6B5BD-E338-483B-91B9-C19935935C18@univie.ac.at> (raw)
In-Reply-To: <b368cf1c-e846-5abe-e201-ebe30b39ad95@gmx.at>
I don't find anything in the manual related to the following:
Suppose, without any display-buffer-alist customization, I have just
(setq display-buffer-base-action
(quote (
(display-buffer-reuse-window display-buffer-pop-up-frame)
(reusable-frames . x)
)))
in my init file, where x can be any of 0,1, nil, visible, all these choices don’t matter for this: If I open Emacs, the initial frame shows up, and any file loaded via recent-files, or by dragging on the Emacs icon, or by clicking on the file icon, shows up in the initial frame, contrary to what is advertised in the manual. However, once a file is loaded, then re-selecting it via Menu->Buffers, pops it up in a new frame (with properties as specified in defaults-frame-alist). So, what is the relation between "display-buffer-base-action” and “default-frame-alist”?
Thanks,
Konrad
> Am 31.10.2019 um 08:59 schrieb martin rudalics <rudalics@gmx.at>:
>
> > Suppose I have buffer A open in frame A. Issuing occur->some word,
> > the occur buffer pops up in its own frame, say frame B, as intended
> > with the above customization. Moreover, frame B has input
> > focus. Returning to frame A, without closing frame B, and issuing
> > another time occur-> some word, frame B now shows the new occur
> > buffer, as intended, but this time frame B lacks input focus. What
> > goes wrong the second time?
>
> Nothing, I suppose. 'occur' (I suppose that's the function you
> invoke) calls 'occur-1' and that one simply does
>
> (display-buffer occur-buf)
>
> which according to its doc-string does
>
> Display BUFFER-OR-NAME in some window, without selecting it.
>
> IIUC the philosophy of 'occur' is given in its doc-string as
>
> The lines are shown in a buffer named `*Occur*'.
> It serves as a menu to find any of the occurrences in this buffer.
>
> and programs usually don't preselect menus either. The user has to
> reach for the mouse or type some key to go there first ...
>
> So the question is rather "what goes wrong the first time?". The
> answer to that is that, when 'display-buffer' creates a new frame, the
> window manager usually also gives that new frame input focus. Some
> window managers allow to change that for all applications. If you add
> a non-nil 'no-focus-on-map' entry to your 'pop-up-frame-parameters',
> Emacs will ask the window manager to not focus the new frame and
> channces are that your window manager complies.
>
> > Let me mention that if, in window.el, I add
> >
> > (x-focus-frame (window-frame window))
> >
> > at the very end of the defun "display-buffer-reuse-window", the
> > problem goes away, i.e., in the above example, frame B gets input
> > focus after every invocation of occur in frame A. How can I get this
> > with a suitable customization on the "display-buffer-alist" level?
>
> You can't. I think the most simple way to achieve what you want is to
> add a function to 'occur-hook' that does search for a window that
> shows the current buffer and, if it finds such a window, invokes
> 'select-frame-set-input-focus' for that window's frame.
>
> martin
next prev parent reply other threads:[~2019-11-02 21:47 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 0:39 bug#37840: Missing in the Emacs manuals: Konrad Podczeck
2019-10-22 8:43 ` martin rudalics
2019-10-23 7:25 ` Konrad Podczeck
2019-10-23 7:46 ` martin rudalics
2019-10-28 17:37 ` Konrad Podczeck
2019-10-28 18:13 ` martin rudalics
2019-10-28 19:04 ` Konrad Podczeck
2019-10-29 9:28 ` martin rudalics
2019-10-30 0:56 ` Konrad Podczeck
2019-10-30 8:14 ` martin rudalics
2019-10-30 20:37 ` Konrad Podczeck
2019-10-31 7:59 ` martin rudalics
2019-11-02 21:47 ` Konrad Podczeck [this message]
2019-11-04 9:06 ` martin rudalics
2019-11-04 11:20 ` Konrad Podczeck
2019-11-04 18:27 ` martin rudalics
[not found] ` <A8BBF7A4-BFE0-44BB-BCB3-B26477FFC946@univie.ac.at>
2019-11-04 19:10 ` martin rudalics
2019-11-06 22:41 ` Juri Linkov
2019-11-07 8:39 ` martin rudalics
2019-11-07 21:58 ` Juri Linkov
2019-11-08 9:20 ` martin rudalics
2019-11-08 11:04 ` Konrad Podczeck
2019-11-08 18:27 ` martin rudalics
2019-11-08 21:12 ` Konrad Podczeck
2019-11-09 9:01 ` martin rudalics
2019-11-10 16:44 ` Konrad Podczeck
2019-11-10 18:33 ` martin rudalics
2019-11-14 10:03 ` Eli Zaretskii
2019-11-14 18:18 ` martin rudalics
2019-11-14 18:35 ` Eli Zaretskii
2019-11-15 8:50 ` martin rudalics
2019-11-22 13:09 ` Konrad Podczeck
2019-11-22 17:49 ` martin rudalics
2019-11-22 19:22 ` Eli Zaretskii
2019-11-23 1:42 ` Konrad Podczeck
2019-11-23 8:16 ` martin rudalics
2019-11-25 23:47 ` Konrad Podczeck
2019-11-26 9:32 ` martin rudalics
2019-12-02 1:35 ` Konrad Podczeck
2019-12-02 9:41 ` martin rudalics
2019-11-23 8:15 ` martin rudalics
2019-11-23 9:49 ` Eli Zaretskii
2019-11-26 9:31 ` martin rudalics
2019-11-26 9:42 ` martin rudalics
2020-09-20 11:12 ` Lars Ingebrigtsen
2019-11-10 20:11 ` Juri Linkov
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=BAE6B5BD-E338-483B-91B9-C19935935C18@univie.ac.at \
--to=konrad.podczeck@univie.ac.at \
--cc=37840@debbugs.gnu.org \
--cc=rudalics@gmx.at \
/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.