all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Jim Porter <jporterbugs@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: [RFC] Adding threads to Eshell
Date: Fri, 16 Dec 2022 22:40:02 -0500	[thread overview]
Message-ID: <jwvr0wy1z9w.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <fe86032d-773d-29f2-350a-d6ddf1e72cc7@gmail.com> (Jim Porter's message of "Fri, 16 Dec 2022 12:11:05 -0800")

> I suppose I mean *local* bindings, really.

I must admit that I don't know what is "a local binding".
More specifically, I believe it is a term that can mean many different
things in many different contexts.

>   (let ((some-defvar t))
>     (eshell-command "echo $some-defvar"))

If `eshell-command` is a macro which turns "echo $some-defvar" into
a chunk of ELisp with a reference to a `some-defvar` variable, then
this var could be statically scoped and this code could work as-is
simple by virtual of `lambda` capturing that statically scoped var.
If `eshell-command` is a function then the above *cannot* work with
statically scoped `some-defvar`.

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

> 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).


        Stefan




  reply	other threads:[~2022-12-17  3:40 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 [this message]
2022-12-17  5:19       ` Jim Porter
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=jwvr0wy1z9w.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=jporterbugs@gmail.com \
    /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.