[Top][All Lists]

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

Re: Indentation of def*

From: Stefan Monnier
Subject: Re: Indentation of def*
Date: Fri, 15 Oct 2021 09:17:47 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Kangas [2021-10-14 17:50:18] wrote:
> Po Lu <luangruo@yahoo.com> writes:
>> That would be a step backwards, at least without a grace period for all
>> the code out there to adjust.
> I don't think it's a bad idea to announce this change as planned for
> Emacs 29.1 in the Emacs 28.1 NEWS file.

You mean something like:

   ** Deprecate ad-hoc indentation rule for functions/macros named def*
   All macros and functions which expect to be indented similarly to
   `defun` should use something like (declare (indent defun)) instead.

?  We could, but I think the more important change is to make it
concrete with changes in the behavior.

In order to make the change more gradual, here are some ideas:
- Let font-lock put an ugly color on those cases that would be affected
  by the rule change.
- Emit a warning every time we use the ad-hoc def* rule during
  indentation (could even be made fancy, e.g. accompany the warning
  with a button that jumps to the definition and adds the missing
  (declare (indent defun))).
- Make the change conditional on a variable, so that users can
  easily recover the previous behavior until the missing `declare`
  is added.  Could be a boolean var, or a var containing a list
  of offenders.


reply via email to

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