unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mattias.engdegard@gmail.com,  Emacs-devel@gnu.org
Subject: Re: "Eager macro-expansion failure: (excessive-variable-binding)"
Date: Wed, 14 Sep 2022 19:18:59 +0200	[thread overview]
Message-ID: <877d256fi4.fsf@gnus.org> (raw)
In-Reply-To: <831qsd3msk.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Sep 2022 20:09:47 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

> I'm not objected to finding a better solution, if we can find it.  I'm
> talking about this particular variable and the mess that you needed to
> go through to allow it being in .dir-locals.el without slowing down
> the build.  It's unjustified.  I think we should delete it for now,
> and revisit this when the infrastructure you are thinking about is
> available.

It might just be as simple as having a guideline here ("don't
`safe-local-variable' autoloaded functions), but I don't know how
realistic that would be.  I'm grepping a bit, and there aren't too many
of these.  For instance:

;;;###autoload(put 'time-stamp-time-zone 'safe-local-variable 'time-stamp-zone-type-p)
;;;###autoload
(defun time-stamp-zone-type-p (zone)
  "Return non-nil if ZONE is of the correct type for a timezone rule.
Valid ZONE values are described in the documentation of `format-time-string'."
  (or (memq zone '(nil t wall))
      (stringp zone)
      (and (consp zone)
           (integerp (car zone))
           (consp (cdr zone))
           (stringp (cadr zone)))
      (integerp zone)))

Which is the identical problem.  But in this case, the function isn't
totally trivial, so perhaps we don't want that in ldefs-boot.el.

That's the only non-trivial case I've found after some cursory grepping.
Most of the other things here already do it correctly.  Like:

;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))

So our change here would be to transform all the things like:

;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'checkdoc-list-of-strings-p)
;;;###autoload
(defun checkdoc-list-of-strings-p (obj)
  "Return t when OBJ is a list of strings."
  ;; this is a function so it might be shared by checkdoc-proper-noun-list
  ;; and/or checkdoc-ispell-lisp-words in the future
  (and (listp obj)
       (not (memq nil (mapcar #'stringp obj)))))

into something similar.

Unless somebody has a different idea.



      reply	other threads:[~2022-09-14 17:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 12:18 "Eager macro-expansion failure: (excessive-variable-binding)" Lars Ingebrigtsen
2022-09-14 14:16 ` Mattias Engdegård
2022-09-14 15:15   ` Lars Ingebrigtsen
2022-09-14 15:38     ` Lars Ingebrigtsen
2022-09-14 16:50       ` Eli Zaretskii
2022-09-14 16:52         ` Lars Ingebrigtsen
2022-09-14 16:55           ` Eli Zaretskii
2022-09-14 17:03             ` Lars Ingebrigtsen
2022-09-14 17:09               ` Eli Zaretskii
2022-09-14 17:18                 ` Lars Ingebrigtsen [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=877d256fi4.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=Emacs-devel@gnu.org \
    --cc=eliz@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).