unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Madhu <enometh@meer.net>, emacs-devel@gnu.org
Subject: Re: Adding transient to Emacs core
Date: Mon, 26 Apr 2021 15:27:45 +0200	[thread overview]
Message-ID: <87pmyhdvla.fsf@bernoul.li> (raw)
In-Reply-To: <m3mttlbwvm.fsf@leonis4.robolove.meer.net>

Madhu <enometh@meer.net> writes:

> I think transient.el has serious design problems with respect to emacs.
>
> I had sent the following to jonas back in 2019, and got a response
> asking me to open a github account - which I did not have at that
> time.

What bothered me more than the fact that you contacted my privately, is
the wording of your communication, the highlight being:

> Effectively transient-mdoe destroys the value of any packages written
> on top of it.

I have replied to your mail by asking you to refrain from remarks like
this and that you communicate publicly.  I requested the latter in the
hope that that would help with the former.

It is disappointing that you ignore that request to refrain from such
hyperbole and instead copy your original message verbatim.  (Except for
the weird preface "[private mail please do not respool on google/public
servers]").

Just re-sending a mail from two years ago also means that it ignores
all technical improvements since than.

> Besides the new window is not scrollable or searchable, it doesnt
> support any standard emacs operations.

No longer true, but you have to explicitly enable it with:

  (setq transient-enable-popup-navigation t)

> with-demoted-errors does not always work in killing off the new frame,
> and emacs gets into a generally irrecoverable state (unless you have
> taken precautions after having studied the transient.el's failure
> modes before)

This no longer happens. I have figured out the last remaining heisenbug
that could put Emacs in an inconsistent state months ago and there have
been zero new reports since then.  The error handling also has improved
substantially, so even if something does go spectacularly wrong, this
should no longer put Emacs in an inconsistent state.

> This design leads to spectacular failure modes with emacs and does not
> really close issue #44.  The assumption in transient's code is that
> display-buffer-in-side-window will always succeed but that is not how
> display-buffer is specified to work:
>
> If a window cannot be popped up in the current frame display-buffer
> will create a new frame.

There is room for improvement, but the current worst case scenario is
the following.  Note that this can only happen if the current frame is
(1) less than ~5 lines high, (2) no other frame already exists, and (3)
the window manager selects the newly created frame.  In that case a new
frame briefly flashes and disappears again.  I.e. it is impossible to
invoke the suffixes of that transient prefix command, but Emacs does not
enter any "spectacular failure modes" (no transient keymaps and/or hooks
get stuck).  You can simply increase the frame size and then invoke the
transient prefix again.

Fixing this remaining issue might be as easy as:

  (define-key transient-predicate-map
    [handle-switch-frame] 'transient--do-stay)

This is not the default yet but I might do this or something similar in
the near future.  This also makes it possible to:

  (setq transient-display-buffer-action
        '(display-buffer-pop-up-frame))

And even without that there were several alternative display actions
available that work just fine, e.g.:

  (setq transient-display-buffer-action
        '(display-buffer-in-child-frame))

  (setq transient-display-buffer-action
        '(display-buffer-below-selected))

> (since you are using display-buffer to display this pop-up window you
> are effectively supporting user customization of display-buffer. In
> which case you should not use display-buffer at all since you cannot
> support legitimate use of display-buffer)

Yes, transient does not support every conceivable display action, but
neither does anything else.  What you are saying here is "you don't
support all possible customizations, therefore you should offer none".


     Jonas



  parent reply	other threads:[~2021-04-26 13:27 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 [this message]
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
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=87pmyhdvla.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=emacs-devel@gnu.org \
    --cc=enometh@meer.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).