all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juri Linkov <juri@linkov.net>, Ergus <spacibba@aol.com>
Cc: 49057@debbugs.gnu.org
Subject: bug#49057: 28.0.50; windmove-display-in-direction ignores windmove-display-no-select
Date: Thu, 17 Jun 2021 10:33:16 +0200	[thread overview]
Message-ID: <f0479c0b-db03-fde6-18e1-3a1f5e8608c5@gmx.at> (raw)
In-Reply-To: <87mtrpjtkm.fsf@mail.linkov.net>

 > 1. switch-to-buffer calls pop-to-buffer-same-window
 > 2. pop-to-buffer-same-window calls pop-to-buffer
 > 3. pop-to-buffer calls display-buffer
 > 4. display-buffer calls display-buffer-override-next-command
 >     that calls post-function from windmove-display-in-direction
 >     that selects the old window
 >
 > 5. but later pop-to-buffer selects the new window,
 >     thus overriding the specified selection of the old window.

Conceptually, `pop-to-buffer' has to

   Display buffer specified by BUFFER-OR-NAME and select its window.

so I cannot see anything wrong here.  Step 5 must be allowed to override
any selection made in step 4 and any expectation derived from having set
`windmove-display-no-select' to t is moot here.

[BTW, `windmove-display-in-direction' is not a command but its doc-string
talks about

   If ‘windmove-display-no-select’ is non-nil, this command doesn’t
   select the window with a displayed buffer, and the meaning of
   the prefix argument is reversed.

This should be fixed.]

Now we all know that `display-buffer' may or may not select the chosen
window.  We cannot disallow it when the window shall appear on a new
frame because most WMs will "select" the new frame.  Even trying to
disallow it in such case might be a bad idea because this instance of
`display-buffer' might have been triggered by a `pop-to-buffer' like
function and we will confuse the hell out of the WM - do not select the
new frame as `display-buffer' says, do select it as `pop-to-buffer' or
`switch-to-buffer' say ...

So maybe we should relax that basic statement of `display-buffer'

      This command makes BUFFER-OR-NAME appear in some window, without
      selecting the window or making the buffer current.

because it is wrong anyway.  Then we could add an additional action
alist entry, say 'select' with values like

- t (try to select)

- nil (avoid to select)

and maybe `never' or 'on-new-frame-only' to emphasize whether
`display-buffer' is allowed to select the window and make its buffer
current.  This has the advantage of freeing `display-buffer' from the
responsibility to decide whether it may select the chosen window.

Then we could also try to use frame parameters like 'no-focus-on-map'
and 'no-accept-focus' right away and users do not have to specify them
explicitly via `pop-up-frame-parameters'.

martin






  reply	other threads:[~2021-06-17  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210616064248.mqqzlt7qyxwqrcfy.ref@Ergus>
2021-06-16  6:42 ` bug#49057: 28.0.50; windmove-display-in-direction ignores windmove-display-no-select Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-16  7:59   ` Juri Linkov
2021-06-16 12:16     ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-16 23:08       ` Juri Linkov
2021-06-17  8:33         ` martin rudalics [this message]
2021-06-17 19:54           ` Juri Linkov
2021-06-18  7:33             ` martin rudalics
2021-06-18 19:10               ` Juri Linkov
2021-06-20  9:21                 ` martin rudalics

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=f0479c0b-db03-fde6-18e1-3a1f5e8608c5@gmx.at \
    --to=rudalics@gmx.at \
    --cc=49057@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=spacibba@aol.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.
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.