bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#33301: 27.0.50; broken elisp indentation for non-definition symbols


From: João Távora
Subject: bug#33301: 27.0.50; broken elisp indentation for non-definition symbols starting with "def.."
Date: Sat, 10 Nov 2018 12:46:18 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> On Nov 09 2018, João Távora <address@hidden> 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





reply via email to

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