From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Recommend lexical-binding in Coding Conventions Date: Tue, 20 Oct 2020 21:32:03 -0700 (PDT) Message-ID: <22583ae4-5224-4ad0-9378-8015acb4c38f@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15918"; mail-complaints-to="usenet@ciao.gmane.io" To: Stefan Kangas , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 21 06:33:24 2020 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 1kV5oR-00041u-VZ for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Oct 2020 06:33:23 +0200 Original-Received: from localhost ([::1]:41978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV5oR-000125-1E for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Oct 2020 00:33:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV5nM-0000aF-TD for emacs-devel@gnu.org; Wed, 21 Oct 2020 00:32:21 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:58824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kV5nK-0005aw-F6 for emacs-devel@gnu.org; Wed, 21 Oct 2020 00:32:16 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09L4OurA010310; Wed, 21 Oct 2020 04:32:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=zFMm1T8QvCgVL2UYIcZjC2AtYjpTtb6Gs/1uMPuWEa0=; b=ls/GnR5h8+8II0VE2g3eLP60ehJL9w/XQH0rGw3MgrhJAWIaxh3bUPzCO1E4/1FTyN61 HmZYM5DVwXEO/r1cgJi5Gmn+i9ifL2qm3kF3hxwABp0sUguuGnhURYL+hKggtVJBc1ew 8Q1Zt4tzyJ4CsSv20Es7uX17rFCKpJ6EjFN8Yqlxo0yrFeI/AoGhv9WkDQWl/OIkEu7a +uIMkCl1MPfX9VdBqg5ILHzcRgGNQ8ExNL5ovv5o5/KQP+BddT4gV0zXwPG0I3fB9PJL Dx4zCZK9+dNGax+gb0xnfhNklozPL/pbOoy29sz853SKIKxiARg8OMgxYzi9E/VGExyh Vw== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 347p4axg8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 21 Oct 2020 04:32:07 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09L4Q46v101480; Wed, 21 Oct 2020 04:32:07 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 348a6nxrbs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Oct 2020 04:32:07 +0000 Original-Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09L4W4mM021809; Wed, 21 Oct 2020 04:32:05 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5056.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9780 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010210035 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9780 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 mlxlogscore=999 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010210035 Received-SPF: pass client-ip=141.146.126.79; envelope-from=drew.adams@oracle.com; helo=aserp2130.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 00:32:10 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-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.23 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" Xref: news.gmane.io gmane.emacs.devel:258203 Archived-At: > I would suggest to add it, and have attached a first draft for what it > could look like. Thoughts? Mine: tl;dr: Just recommend setting var `lexical-binding' to non-nil. ___ 1. The recommendation to set variable `lexical-binding' to non-nil is good. 2. The recommendation to "convert existing Emacs Lisp code to use lexical binding" is unclear or ambiguous. Setting the variable to non-nil just makes lexical binding the default (e.g. for a file), which is what we should encourage. #2 can easily be misinterpreted to mean that code should not use dynamic binding, which would be misguided, IMO. There's a reason that Common Lisp and Emacs Lisp have both kinds of binding. Both are useful for Lisp, and dynamic binding has particular usefulness for Emacs users. I see no reason for adding #2. It doesn't mean anything good, clear, or important, IMO. #1 suffices, and is the message to send, I think. On the other hand, if what you meant by #2 was just an elaboration of #1, i.e., convert existing code to work with `lexical-binding' non-nil, then that's OK. But it's not necessary, as it follows from #1: if you set `lexical-binding' to non-nil in existing code then you'll find out what changes you might need to make, to get it to continue to work well.