From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: [RFC] Adding threads to Eshell Date: Fri, 16 Dec 2022 21:19:18 -0800 Message-ID: References: <7f4e3357-2c6a-a0d2-cab5-fb641b52877a@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21991"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 17 06:19:58 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 1p6Pc3-0005MD-1i for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Dec 2022 06:19:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Pba-0002HV-MT; Sat, 17 Dec 2022 00:19:26 -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 1p6PbX-0002H7-FP for emacs-devel@gnu.org; Sat, 17 Dec 2022 00:19:23 -0500 Original-Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6PbV-0004ls-Uq for emacs-devel@gnu.org; Sat, 17 Dec 2022 00:19:23 -0500 Original-Received: by mail-pj1-x102c.google.com with SMTP id u15-20020a17090a3fcf00b002191825cf02so4318663pjm.2 for ; Fri, 16 Dec 2022 21:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=j2wYirJxJwKMEeYzFskBliRG+YLvfAG12d+cRn/am6g=; b=pz8e7MWWk9JmG5n0Yf1fnTHolosUq38BlbChqaGURpSAnrPM1jjid3lqzAeZL/Ut6o gDSnzGLe7Q160IAhj/8vDez+UOUgsCv5RPtP+NBmKti6reKW9uHQ7tQM87KjNFAFKqdS vwzHRQN3xd3zuNBhZXyIsv2GNnO7j9hMvZyZPjsM4axfe7Hpenf8iCqPb6qxU7YTkgCF mQvJkaJhZtC8cqpbFKsgJLVDZUWFUL3ymksXrx2PIYWMFDuQKYkJ/+83jJXtjgVdKenO 1TyBRn8ZWYMI21OsSNe/S+NJtHIa8ccIwMsk8oGxmy+pJ6mGZIHCwFRIWywpSkvl7VBp MCZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j2wYirJxJwKMEeYzFskBliRG+YLvfAG12d+cRn/am6g=; b=ZH+buofreu2fNr16XBAEFj65I36ub7flaYiH3QyA52/txY/75sF1G+BeBSxjgbbzV0 I5f+nZQ77DYH8WQCJYXGh3NDhfkyK4Y+BmP1s5CKIh7fw2tWbKVi1/O2myWRcYpkM0Lg jZ9P3CEhZhUO/mE2nKbEV84rxRykPSu62aL3UGzu/FNEEx9u9SP0EcmRDhVRM1r3CWCU jZ0Zdw1AffS48lfGCNHgp4tes6uKQXyN+L9EmCUtfdDvgB2kQd6Tk74ecw1NQ6nAkZVz cAhM1rq/7YXyc0AZILEwztH0kWmVOxu+gn3wLppfgosyDMyG/03kvs8M/eXU+cICT/K3 tUUA== X-Gm-Message-State: AFqh2ko4OcqBC2sT4whD4e7xNUZXi1RETBiVd7wtRQ4mdXacD4kueaw3 Yy+n067lowuj3GBvtBu68G8= X-Google-Smtp-Source: AMrXdXty0WOHwel8ML3JPOalUG/DkFjmjIDBI5BfW/CmAZTc7yJxOLjUcoeGCtCyJNcYLEOhUgHIgw== X-Received: by 2002:a05:6a20:45e:b0:a4:7132:ab5b with SMTP id b30-20020a056a20045e00b000a47132ab5bmr1114013pzb.58.1671254358889; Fri, 16 Dec 2022 21:19:18 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id o9-20020a170903210900b0018853dd8832sm2520786ple.4.2022.12.16.21.19.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Dec 2022 21:19:18 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:301543 Archived-At: 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.