emacs-devel
[Top][All Lists]
Advanced

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

Indentation of def*


From: Lars Ingebrigtsen
Subject: Indentation of def*
Date: Thu, 14 Oct 2021 01:13:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

A longstanding issue is whether to do anything about this heuristic in
our indentation code:

(defun definitely-regular (a b))
(defun still-regular (a b))

(progn
  (definitely-regular a
    b)
  (still-regular a
                 b))

That is, any function or macro that has a name that starts with "def" is
indented similarly to a `defun' (etc).

This is discussed in bug#43329, and all two of us discussing this have
landed on "let's fix this".  So today I've tagged all in-tree def*
function/macros with correct indentation (ahem), so if we remove the
heuristic from the indentation function, in-tree code won't change how
it's indented.  (By and large -- there's a handful of functions that
will change, but the affected call sites should be less than a dozen, if
I got it right.)

But code that uses out-of-tree functions named def* will see indentation
changes until everybody tags up their functions with

(defun define-whatever ()
  (declare (indent defun))

And people going back and forth between Emacs 29 and earlier versions
will see the indentation change (for untagged functions), which is why
we rarely change how Emacs Lisp is indented.

So this is the thread where you can say "yay" or "eek".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




reply via email to

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