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.bugs Subject: bug#66706: [PATCH] Automatic elisp dialect insertion Date: Wed, 25 Oct 2023 18:19:20 -0700 Message-ID: References: <17C83052-7946-45DE-B660-DA7EB82001B0@gmail.com> <83sf61mb54.fsf@gnu.org> <98CD592C-0E82-4795-8168-2B5E597FF7A7@gmail.com> <8334xzlvy9.fsf@gnu.org> <87pm131pq6.fsf@yahoo.com> <83o7gmkiyn.fsf@gnu.org> <438d1186-3759-4462-06d8-b41c69134eda@gutov.dev> <878r7q25zh.fsf@yahoo.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="20419"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66706@debbugs.gnu.org, mattias.engdegard@gmail.com, Po Lu , Dmitry Gutov , stefankangas@gmail.com, Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 26 03:21:02 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qvp3V-00059L-UK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Oct 2023 03:21:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvp33-0003aC-Hj; Wed, 25 Oct 2023 21:20:33 -0400 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 1qvp32-0003Z6-5e for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2023 21:20:32 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvp31-0005Sp-Te for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2023 21:20:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvp3W-0004vq-43 for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2023 21:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Oct 2023 01:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66706 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66706-submit@debbugs.gnu.org id=B66706.169828320318874 (code B ref 66706); Thu, 26 Oct 2023 01:21:02 +0000 Original-Received: (at 66706) by debbugs.gnu.org; 26 Oct 2023 01:20:03 +0000 Original-Received: from localhost ([127.0.0.1]:60310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvp2Y-0004uM-FI for submit@debbugs.gnu.org; Wed, 25 Oct 2023 21:20:02 -0400 Original-Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:45500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvp2U-0004tj-BP for 66706@debbugs.gnu.org; Wed, 25 Oct 2023 21:20:01 -0400 Original-Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6b36e1fcee9so315833b3a.3 for <66706@debbugs.gnu.org>; Wed, 25 Oct 2023 18:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698283162; x=1698887962; darn=debbugs.gnu.org; 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=XT2GWLtr83cZM+Lt2/0I9/PMyDEYw96+OiLmrOKMx1c=; b=dYGJxHa6TCK+BOKuDlCa/oOuVInBDHJRQkFOIX9HBLTQV0PXpWoWsz+6NeUy6KkVMR 17xfTKsifkqKuNgAvVcm4RTd6JZcmdfE3b7dKkSZm++flx7kuVazzzZllfvHdziwFpYd 4NydUR5fkiBBLDHTxCM1iNK8VFxqJSameb2ej2nkPqkljPdG5tOQIkFmwjBlAx/848d4 kZ7FAyvAc3/CS1E0ssowAaF1+3zHzigIwIhHNJ3YugqL2t+IPxNWLSY5CVaEdy/Yl9f1 VKBLCSr6XRdYeTXB9pLeqaGYZcRx8KZ7p8YGQj5ZaFQXaWxHzj2cE1M8phsVA44Pxjpm hmGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698283162; x=1698887962; 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=XT2GWLtr83cZM+Lt2/0I9/PMyDEYw96+OiLmrOKMx1c=; b=ibCuZuKm14xsE0SCbYNuxFrBnEKc0NYQcXrTsQuaHWnhqqXHrBLueR5+eK/9Qknztx CieCsNvcVqvP/pjdYL6JEtA5OOF30wHhFM59+NFOQg1uLipA++qtAlgxtqRHMiBoXCgD vpGcmALjJ5J6EI7dx0MCg1RSdEhD2kIX/TwYwujS/9FHoU+3cQkipBTPFiKSNO02ChYM nKanB3+6ftKr4/OvfZmt49y7JI2MzI2d8K/SJhmpOpQ3XF1uvfHDgNMovrVBuUwOaet6 kVoZh/jiv1z0WwkoNLpbQ/kGlUVkSyh5qPEdR35gs6F55xj87Sv/0eCf2I2mtxYjj3ix 0GGw== X-Gm-Message-State: AOJu0Yw8fQlegTkXlXc/lw+Oyk1g3AG0JZhxpLRW0kBD+GKRcG5R1it6 pcqEX8QQlSeqMOX29+GNjr0= X-Google-Smtp-Source: AGHT+IH7MhMYyLTMRz83b+O4M0Ast4/3u2d+ivEVdcFHC1HO0g0VeXcwr7NetSIztPOrCf+63kesSA== X-Received: by 2002:a05:6a00:b47:b0:68f:f650:3035 with SMTP id p7-20020a056a000b4700b0068ff6503035mr16767910pfo.12.1698283161892; Wed, 25 Oct 2023 18:19:21 -0700 (PDT) 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 w14-20020aa7954e000000b006b287c0ed63sm9949112pfq.137.2023.10.25.18.19.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 18:19:21 -0700 (PDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273229 Archived-At: On 10/25/2023 5:51 PM, Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: >> In particular, what's missing from the following paragraph[1]? >> >>> Another way to think about let is that it is like a setq that is temporary >>> and local. The values set by let are automatically undone when the let is >>> finished. The setting only affects expressions that are inside the bounds >>> of the let expression. In computer science jargon, we would say the >>> binding of a symbol is visible only in functions called in the let form; >>> in Emacs Lisp, the default scoping is dynamic, not lexical. (The >>> non-default lexical binding is not discussed in this manual.) > > Nothing is "missing" but the above describes dynamic binding, static > binding has a different behavior which is not like "a setq at the > beginning which is undone at the end". So this paragraph needs to be > fully rewritten. This is helpful. The bit about 'setq' seemed a bit roundabout (to say the least), and while I can see how it might help explain 'let' to a novice, it's probably more likely to mislead them instead. I'll start with a patch here then. I think this is also a prime spot to add an example or two that would actually show lexical binding in action (i.e. a sample where the code would do something different under dynamic binding). - Jim