unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Gregory Heytings <gregory@heytings.org>, Madhu <enometh@meer.net>,
	emacs-devel@gnu.org
Subject: Re: Adding transient to Emacs core
Date: Tue, 27 Apr 2021 23:11:27 +0200	[thread overview]
Message-ID: <87czufcu0w.fsf@bernoul.li> (raw)
In-Reply-To: <87bl9z3g95.fsf@posteo.net>

Philip Kaludercic <philipk@posteo.net> writes:

> At the same time it does not seem obvious why, especially with transient
> menus that may contain a lot of options (say a ffmpeg interface)
> shouldn't be able to use the entire frame. Especially from a user
> perspective.

It is of course possible that a certain transient menu only features
suffix commands that do not care which buffer/window/frame is current.
And in the future I might add a feature that would allow the author of
such a menu to indicate that that is the case and that the entire frame
should be used to display that particular menu. But that a potential new
feature and not what we are currently discussing.

>> If the selected window were repurposed to display transient's buffer,
>> then that would change what buffer is the current buffer and it would
>> become impossible to act on the buffer that was previously the current
>> buffer or on "the thing under the cursor" in that buffer.
>
> What do you mean by "what buffer is the current buffer"? I am somewhat
> confused by what you are trying to say here.

Would it be less confusing if instead I had said "WHICH buffer is the
current buffer"?  I don't think I can describe this any better; maybe
someone else can.  I'm having problems understanding what you find
confusing about that paragraph.

>> Re-purposing the selected window would massively reduce the usefulness
>> of a huge number of commands or even make them completely useless.
>
> Again, I do not see how this follows? My verison of Magit has
> magit-display-buffer-function, that allows me to display the buffer in
> the selected window, with no loss of functionality.  What does
> transient do or need that prevents this?

As I have tried (and apparently failed) to explain earlier, it is
important to some suffix commands that the same thing is current at the
time they are invoked as was current when the menu was entered using the
prefix command.

This is true regardless of whether Magit-Popup or Transient is used,
but these two implementation differ in how they ensure this:

- Magit-Popup does it by (1) remembering what buffer is current by
  recording the current window configuration when the prefix is invoked
  but before actually displaying the menu in a buffer.  Later when the
  user invokes a suffix, it (2) intercepts that action in order to (3)
  restore the saved window configuration before (4) actually invoking
  the suffix command using `call-interactively'.

- Transient ensures that the buffer that was current before the menu was
  displayed, simply by not messing that up in the first place.

So yes, Magit-Popup can make the menu buffer the current buffer "with no
loss of functionality", but that is only the case because it explicitly
makes sure the old window-configuration is restored before it matters.

Ultimately it does not matter: everything that is possible with one
approach is also possible with the other, but having implemented both,
I do have a favorite.

It would be useful if users would describe the concrete behaviors that
they find undesirable, instead of criticizing implementation details
they might not fully understand.  There has been a lot of concrete,
actionable feedback in the past and I have listened to that and made
improvements in response.



  reply	other threads:[~2021-04-27 21:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 15:51 Adding transient to Emacs core Jonas Bernoulli
2021-04-19 16:07 ` Eli Zaretskii
2021-04-20 12:39   ` Jonas Bernoulli
2021-04-20 13:01     ` Eli Zaretskii
2021-04-20 16:53       ` Jonas Bernoulli
2021-04-20 17:22         ` Kévin Le Gouguec
2021-04-20 18:05           ` Stefan Kangas
2021-04-20 13:19 ` Dmitry Gutov
2021-04-20 16:59   ` Jonas Bernoulli
2021-04-20 17:07     ` Dmitry Gutov
2021-04-26  2:30 ` Madhu
2021-04-26 11:51   ` Eli Zaretskii
2021-04-26 12:54     ` Philip Kaludercic
2021-04-26 13:07       ` Eli Zaretskii
2021-04-26 17:56     ` Madhu
2021-04-26 18:12       ` Eli Zaretskii
     [not found]         ` <20210427.073903.1397547038526168961.enometh@meer.net>
2021-04-27  2:36           ` Eli Zaretskii
2021-04-26 13:27   ` Jonas Bernoulli
2021-04-26 17:33     ` Madhu
2021-04-26 17:44       ` Eli Zaretskii
2021-04-26 17:52       ` Stefan Monnier
2021-04-27  2:03         ` Madhu
2021-04-27  3:29           ` Stefan Monnier
2021-04-27  9:00       ` Jonas Bernoulli
2021-04-27 10:51         ` Philip Kaludercic
2021-04-27 11:01         ` Gregory Heytings
2021-04-27 12:05           ` Jonas Bernoulli
2021-04-27 12:26             ` Gregory Heytings
2021-04-27 15:24               ` Jonas Bernoulli
2021-04-27 15:21             ` Philip Kaludercic
2021-04-27 21:11               ` Jonas Bernoulli [this message]
2021-04-27 12:08         ` martin rudalics
2021-04-27 15:03           ` Jonas Bernoulli

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=87czufcu0w.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=emacs-devel@gnu.org \
    --cc=enometh@meer.net \
    --cc=gregory@heytings.org \
    --cc=philipk@posteo.net \
    /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).