Subject: Re: bug#61954: 30.0.50; [PATCH] Simplify structured commands in Eshell

From: Jim Porter <[email-masked]>
Date: Sun, 5 Mar 2023 18:11:44 -0800

On 3/5/2023 5:15 PM, Sean Whitton wrote:
> I think you have typo'd the bug number?

Sorry, bug#57635.

> I would like to read about what the advantages of moving to CPS in
> particular will be.  My understanding was that CPS is only rarely a good
> idea.

Well, that's what 'eshell-do-eval' is already; it's just incomplete 
(doesn't understand all of Elisp) and has a number of bugs. Migrating to 
generator.el's CPS machinery would mean we get the benefits of a 
more-complete implementation, with (hopefully) fewer bugs.

Whether CPS is a good idea in general is above my pay grade, but short 
of some major improvements to threads in Emacs, I don't see an 
alternative. Eshell needs *some* mechanism for deferring execution of 
its command forms. (As I recall, threads have issues around prompting 
the user, which is why Tramp doesn't yet use threads, and Eshell would 
have the same issues. Not only that, but if Eshell used threads, it 
would cause problems when Eshell code calls Tramp code.)