all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
Subject: Re: missing lexical-binding cookie warning when loading .el files
Date: Sat, 04 May 2024 18:01:06 +0800	[thread overview]
Message-ID: <87le4p99r1.fsf@yahoo.com> (raw)
In-Reply-To: <2EAAC2FC-5709-4671-A903-60B34DE47BC8@gmail.com> ("Mattias Engdegård"'s message of "Sat, 4 May 2024 11:47:58 +0200")

Mattias Engdegård <mattias.engdegard@gmail.com> writes:

> Thanks for raising this concern. For now I settled on warning about
> *.el and .emacs only, on the grounds that it would eliminate at least
> some of the false positives.

But not all, not even all the packages in core, let alone ELPA.  It's
really not acceptable for Emacs to become a patchwork of warring
features, where no sooner does one feature save a file than does the
next feature proceed to pester the user to delete it.

> I do think it is appropriate to warn about the user init files because
> they tend to gather a lot of actual Lisp code, not just data. (New
> Emacs-generated init files should have a lexical cookie.)

That's a matter of opinion.

> Not sure how common pure data-as-code files are in reality; most Lisp
> data files aren't evaluated. Those that are are probably just
> sequences of function calls with constant arguments and thus rarely
> affected by lexical-binding.

newsrc.eld, desktop files (which do bear lexical-binding cookies), the
URL cookie list, generated custom themes, and the like.

> Now if data-as-code files turn out to be just too common and detecting
> them systematically too difficult, then I'd rather get rid of the
> warning altogether; it's not important enough to build an elaborate
> suppression system for, much less have endless discussions about.
>
> It's quite common to see other actual code files under ~/.emacs.d/,
> but maybe they are not worth warning about if it means too many false
> positives?
>
> Some options:
>
> A. Add a suppression system. We could add the variable
> `lisp-source-load-missing-lexical-binding-declaration-warning-suppression-regexp-list`.

I hope this is in jest.

> B. Strong-arm package maintainers into writing a lexical cookie when
> saving data-as-code.

Strong-arming users is hardly a laudable action on our part, or that of
any software developers at that.

> C. Don't warn about ~/.emacs.d/**/*.el, except init.el.

I thought the purpose of this warning was to detect bodies of Lisp code
of which the user might be unaware, to give him an opportunity to
futureproof them in time for Emacs 31.

> Z. Remove the warning.

Not the worst proposal I've heard.



  reply	other threads:[~2024-05-04 10:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 17:28 missing lexical-binding cookie warning when loading .el files Mattias Engdegård
2024-05-03 17:59 ` Eli Zaretskii
2024-05-03 19:41   ` Mattias Engdegård
2024-05-04  3:41     ` Po Lu
2024-05-04  4:18       ` Po Lu
2024-05-04  4:40         ` Po Lu
2024-05-04  7:32           ` Eli Zaretskii
2024-05-04  8:10             ` Po Lu
2024-05-04  8:19               ` Eli Zaretskii
2024-05-04  8:23                 ` Po Lu
2024-05-04  9:05                   ` Eli Zaretskii
2024-05-04  9:22                     ` Po Lu
2024-05-04  9:24                     ` Eli Zaretskii
2024-05-04 10:31                       ` Mattias Engdegård
2024-05-04 12:59                         ` Eli Zaretskii
2024-05-04 16:22                           ` Mattias Engdegård
2024-05-05 14:13                             ` Mattias Engdegård
2024-05-05 14:28                               ` Arsen Arsenović
2024-05-05 14:58                                 ` Mattias Engdegård
2024-05-05 16:22                                   ` [External] : " Drew Adams
2024-05-05 14:44                               ` Po Lu
2024-05-04  9:47             ` Mattias Engdegård
2024-05-04 10:01               ` Po Lu [this message]
2024-05-04 16:54               ` [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87le4p99r1.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.