emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Eager macro-expansion failure: (excessive-variable-binding)"


From: Lars Ingebrigtsen
Subject: Re: "Eager macro-expansion failure: (excessive-variable-binding)"
Date: Wed, 14 Sep 2022 19:18:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]