all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 67993@debbugs.gnu.org
Subject: bug#67993: Selecting buffer automatically
Date: Sun, 07 Jan 2024 18:51:04 +0200	[thread overview]
Message-ID: <86cyudjdmb.fsf@mail.linkov.net> (raw)
In-Reply-To: <c729e98c-a27e-48c1-9f57-9733b9435a4a@gmx.at> (martin rudalics's message of "Sun, 7 Jan 2024 15:56:45 +0100")

>> Could you suggest an alternative to 'old-selected-window'
>> to select the original window that was selected before
>> the current command?
>
> In 'display-buffer' first save the selected window as
> old-selected-window, display the buffer and in your code select
> old-selected-window instead of (old-selected-window).

Unfortunately, this is not so easy to do.  'old-selected-window'
should be reinitialized before the next command is executed.

So by definition 'old-selected-window' should contain
the window that was selected before the current command
was executed.  I have no idea how to do this without hooks.

> Better, rename "select-window" to "window-to-select" so grepping won't
> confuse it with a 'select-window' call and allow for an arbitrary window
> (or even buffer, but there could be two windows showing the same buffer)
> to use as the finally selected window in 'display-buffer'.  And maybe
> have 'pop-to-buffer' and friends pass (select-window . t) instead of
> calling 'select-window' themselves

'pop-to-buffer' can't be changed because (select-window . t)
should be handled only at the end of the current command.

> and think of what has to happen when the window made or used by
> 'display-buffer' is on another frame that should be (de-)selected.

So this also need to run 'select-frame' in post-command-hook.





  reply	other threads:[~2024-01-07 16:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-23 17:51 bug#67993: Selecting buffer automatically Juri Linkov
2024-01-04 17:12 ` Juri Linkov
2024-01-05  9:23   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06 17:40     ` Juri Linkov
2024-01-07 14:56       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-07 16:51         ` Juri Linkov [this message]
2024-01-08  8:55           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-09 17:20             ` Juri Linkov
2024-01-10  8:37               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10 17:12                 ` Juri Linkov
2024-01-11  9:15                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-12  7:46                     ` Juri Linkov
2024-01-13 10:39                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-14 18:48                         ` Juri Linkov
2024-01-15 10:23                           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-15 17:56                             ` Juri Linkov
2024-01-16 10:18                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-16 16:54                                 ` 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=86cyudjdmb.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=67993@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.