GNU bug report logs -
#21922
Indentation of Emacs Lisp list constants is surprising
Previous Next
Full log
Message #37 received at 21922 <at> debbugs.gnu.org (full text, mbox):
On 17/01/2020 18:58, Noam Postavsky wrote:
> tags 27646 - moreinfo unreproducible
> forcemerge 21922 27646
> quit
>
> Alexander Shukaev <emacs <at> Alexander.Shukaev.name> writes:
>
>> to the "*scratch*" buffer and indent to observe the following result
>>
>> (dolist (symbol '(ignore-errors
>> xxx
>> yyy)))
>>
>> The reason why this happens is because `ignore-errors' is a macro that has
>>
>> (declare (indent defun))
>>
>> Any other macro with the same declaration whose innocent symbol is
>> used as the first element in a list would reproduce the above
>> indentation bug. Backquote is also affected.
>
> That's Bug#21922, although the backquoted case is intentional (e.g., for
> writing code in macros).
>
I use the following trick right now:
(dolist (symbol '(;
ignore-errors
xxx
yyy)))
Since it's impossible to resolve that issue reliably and for all cases
including backquote, I propose to introduce some special comment (aka
;###list) format to indicate that this is a list rather than code to be
evaluated. In different contexts the same code could be desired to be
treated differently namely either as data or as to be evaluated.
This bug report was last modified 3 years and 168 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.