GNU bug report logs - #21922
Indentation of Emacs Lisp list constants is surprising

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Sat, 14 Nov 2015 18:31:01 UTC

Severity: minor

Merged with 27646

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 21922 <at> debbugs.gnu.org (full text, mbox):

From: Alexander Shukaev <emacs <at> Alexander.Shukaev.name>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 27646 <at> debbugs.gnu.org, 21922 <at> debbugs.gnu.org
Subject: Re: bug#27646: Bug: Emacs Lisp Indentation
Date: Fri, 17 Jan 2020 21:26:49 +0100
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.