From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Adding threads to Eshell Date: Fri, 16 Dec 2022 22:40:02 -0500 Message-ID: References: <7f4e3357-2c6a-a0d2-cab5-fb641b52877a@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18962"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Jim Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 17 04:41:09 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p6O4T-0004mw-10 for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Dec 2022 04:41:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6O3b-00039i-Ic; Fri, 16 Dec 2022 22:40:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6O3Z-00039Z-Tn for emacs-devel@gnu.org; Fri, 16 Dec 2022 22:40:13 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6O3X-00059k-F9 for emacs-devel@gnu.org; Fri, 16 Dec 2022 22:40:13 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4BE7F811AA; Fri, 16 Dec 2022 22:40:06 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7CB988116E; Fri, 16 Dec 2022 22:40:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671248404; bh=4CcswNZcwkDgG0jqfbk8SJ1w2dYRXtrNrzZS2qtSbv0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CTeIiQOjf12PBR+6xXveGEmLpkMRJ4IDpVVnwn4EVElsarQMP7rFxFQW8MPl/s+6A a+lEhq8N0Ijk7BeNAWc9dMwwacxC8VDCtb6t/5Jpj1jQ7fuVtK8h+U8I1AGnUMmoSy /OquNnwit5a/dtVf6oLm3qvngz4qlI5dyA2ebEDMF7eLojxWir9JUwa5YedUABucDm wajLqmmXUX5s7e5KCMpNk/SyNF+x6FR+rIRceSuXmTX4HFhehRUV1C6zouXLdg6Hr6 mUcGZwlFBrgA87qz9CkKCgPWEzHy6l4wkwELLFHqvW0rAyHUaf6WLL8rBlPMMj0AJK y6MIMv9esQDEA== Original-Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5A7A41202EE; Fri, 16 Dec 2022 22:40:04 -0500 (EST) In-Reply-To: (Jim Porter's message of "Fri, 16 Dec 2022 12:11:05 -0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301539 Archived-At: > 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