all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [RFC] Adding threads to Eshell
Date: Fri, 16 Dec 2022 21:19:18 -0800	[thread overview]
Message-ID: <b29435cc-e915-e5bd-4279-625446a4eed5@gmail.com> (raw)
In-Reply-To: <jwvr0wy1z9w.fsf-monnier+emacs@gnu.org>

On 12/16/2022 7:40 PM, Stefan Monnier wrote:
>> I suppose I mean *local* bindings, really.
> 
> I must admit that I don't know what is "a local binding".

I guess just let-bindings (and anything else that works like 'let'). 
Maybe the manual section on threads should be updated, since "local 
variable bindings" *could* mean buffer-local variables, but I think it's 
*supposed* to mean let-bindings. (Threads have their own current buffer, 
so I'd expect that buffer-local bindings take effect for the thread's 
current buffer as usual. I haven't actually tried it out though.)

> For dynamically scoped vars, then you'll need to do something like what
> the `lml-closure` does, but that shouldn't be hard.

To preserve the existing behavior, I think all we'd need is to copy any 
let-bindings for dynamically-scoped vars. Eshell already ignores 
statically-scoped bindings (though changing that would present some 
interesting possibilities...)

>> The only bit I'm still unsure about is if there's a good (and performant)
>> way to ask, "What are all the local bindings of dynamic variables?" Then,
> 
> We could potentially add such a thing (except for the "performant" part,
> but I think it would be fast enough anyway), but there isn't one, no,
> and it's not very easy to add one (e.g. because some of the currently
> active dynamic bindings can be local to specific buffers).

Well, hopefully it wouldn't cost too much performance, or else we'd 
probably want to have users opt into it. But we can cross that bridge 
later. The lml-closure example you posted gave me enough to get a 
somewhat-clumsy solution working for the regression tests at least, so I 
can keep hacking away.



  reply	other threads:[~2022-12-17  5:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  2:37 [RFC] Adding threads to Eshell Jim Porter
2022-12-16 14:05 ` Stefan Monnier
2022-12-16 20:11   ` Jim Porter
2022-12-17  3:40     ` Stefan Monnier
2022-12-17  5:19       ` Jim Porter [this message]
2022-12-16 19:51 ` Eli Zaretskii
2022-12-16 20:25   ` Jim Porter

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=b29435cc-e915-e5bd-4279-625446a4eed5@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.