From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Gillespie Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] hack-one-local-variable use lexical-binding Date: Sun, 29 Nov 2020 14:50:35 -0500 Message-ID: References: <8E2B73D4-1269-4D0A-B572-7B6B47C46924@gnu.org> <83blfkqisb.fsf@gnu.org> <83wny4kw4b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11354"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Stefan Kangas , Stefan Monnier To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 29 20:54:14 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 1kjSly-0002qn-Dj for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 20:54:14 +0100 Original-Received: from localhost ([::1]:53762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjSlx-0003IF-Cs for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 14:54:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjSih-00067F-M7 for emacs-devel@gnu.org; Sun, 29 Nov 2020 14:50:52 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjSie-0001N0-C0; Sun, 29 Nov 2020 14:50:51 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id g14so12393319wrm.13; Sun, 29 Nov 2020 11:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iJFkFtcEQ2OPDx6O9BZkaMGyTxzL+MsUKS/OO53nfLA=; b=pZN0sa15SHqCS93WOK5s2yuXr6tfR3pscVs/WNwih+SDmVqeGdDXy7oyGpdFDyT3Lr AVby6YLqcQbrjnJRLfpaCKiMdWdeXnfwzw205/2C6Z5VOFfGbnirpunsGH7C5qP4yDq2 kZJTtAeF1iqnc0pdo5bPd8wnq6jWNqfGI5hNXefhnJ3gBQj7RddBC9fZiEm63007m7Jf Jck5br5rnLwWCW1OoS9pi4cRjPX3sLtstT+JAyY+FD2K9+pfvWwfAUS2oaXJeBJqXcK3 349CDdaeQWWA+1hq9KRT1xNsmkpqG45UbZ5NzZAwKQzTE0/MAt1niiXwPzWy9x1yLp7F eeXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iJFkFtcEQ2OPDx6O9BZkaMGyTxzL+MsUKS/OO53nfLA=; b=USuhj/A3JQLPKNn+4kpHx3g16+t6AJ+72XuGBwmF+lML6tytkRGTLad4P2lh+pwurV jvwRw6yARY/OH0xswe0zoBEkWayFAokPF7KMcwDSklEeGd1UjrGCS+FHu63+Ve5khHK/ TAyXnxsAuZDLZ4tdvtEcfFhXO5sBd1DSfjmhVPGHP2SBX0JKefhWuEfkQkJ/dZ1AvpwD X5X/kd4ahP8G/l8OXpAttzcZ1FT5rlB0IQYwPXU8Mx6mq/7qAm7X9LF0Q0M3sEtIBm6C Mqzg01FocrCDEG2fVlEEus//9wKKIuMVAdXTsp3eUwiOrokCBo9e5yRqDX4eakCithUn 5FCw== X-Gm-Message-State: AOAM532dskM8ruEsBPJukMjaIkTuMFWRR4TyYgAA0Gy+L17eICmccnHg eaJLG0WBgRvCaIL2/BBOh9Ma5jZOzE+XFJZJO4jsyOqK49Y= X-Google-Smtp-Source: ABdhPJxmthAk/lhz5mlHcfW5zmY7Nmh707HdeML+eU9HVlKrxAWLGGkkrWAhSbUKmde1A3Q0K2dX0xb4/lOt4Tq/yfI= X-Received: by 2002:adf:f783:: with SMTP id q3mr23739801wrp.88.1606679446190; Sun, 29 Nov 2020 11:50:46 -0800 (PST) In-Reply-To: <83wny4kw4b.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x42d.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.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:260033 Archived-At: > Once lexical-binding becomes t by default, 'eval' will use > lexical-binding. So ultimately better not to rely on the default value of lexical-binding at all. Is there a way to pass LEXICAL t unless a file local variable explicitly sets lexical-binding to nil? This would be equivalent to fast forwarding this particular part of the implementation in time as if it were already in the future where lexical-binding was true by default. Almost certainly not worth the complexity. > IOW, this change will be a backward-incompatible one no matter what we > do. IMO, it makes much more sense to make such a change when we > switch to lexical-binding by default rather than now. This makes sense. I don't think there is a particular hurry on this, but if there were a simple way to make this subsystem behave as if lexical-binding were t by default (sounds like the answer there will be no) then the change could be made now and the breaking of the default behavior would still happen only once. If the additional changes needed to do that are too extensive, then it is probably better just to wait. The only outstanding question to me is whether users would be able to control whether the eval local variable uses lexical binding at all even in the future. I can imagine that when the switch to lexical-binding being t by default happens there will be a need for an escape hatch > can use a special construct. It crosses my mind that one potential solution would be lexical-eval: and dynamic-eval: local variables, but this seems like it might not be worth the added complexity. On the other hand, it would make it completely unambiguous to a user inspecting a file what behavior will be and make that behavior independent of any differences in local settings or future changes to defaults. In the few cases where an author knows lexical vs dynamic matters, it would definitely be simpler for the author of the local variables to say "this always needs to be dynamically evaluated" and then not have to worry about it in the future. Best, Tom