Subject: Re: bug#33301: 27.0.50; broken elisp indentation for non-definition symbols starting with "def.."

From: João Távora <[email-masked]>
Date: Sat, 10 Nov 2018 12:46:18 +0000

Andreas Schwab <[email-masked]> writes:

> On Nov 09 2018, João Távora <[email-masked]> wrote:
>
>> @@ -1104,7 +1104,9 @@ lisp-indent-function
>>  	(cond ((or (eq method 'defun)
>>  		   (and (null method)
>>  			(> (length function) 3)
>> -			(string-match "\\`def" function)))
>> +			(string-match "\\`def" function)
>> +                        (or (not (derived-mode-p 'emacs-lisp-mode))
>> +                            (macrop (intern function)))))
>
> Why is a defining function required to be a macro?

Do you know any that aren't?  Of course you can name a function however
you want, and give it your own "definition" semantics, but if you want
to do it in the lisp sense, generally the properties of macros are good:

1. They are evaluated at compilation time, so the byte compiler can
   understand the uses of your new definition down the line;

2. The arguments of a macro don't get evaluated unless you want them to,
   which is crucial for defining formal arguments.

João

PS: a defining function can also be a special form, which also has the
above properties