emacs-devel
[Top][All Lists]
Advanced

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

Re: Codifying some aspects of Elisp code style and improving pretty prin


From: Robert Pluim
Subject: Re: Codifying some aspects of Elisp code style and improving pretty printer
Date: Fri, 01 Oct 2021 16:26:46 +0200

>>>>> On Fri, 01 Oct 2021 09:05:25 +0200, Lars Ingebrigtsen <larsi@gnus.org> 
>>>>> said:

    Lars> akater <nuclearspace@gmail.com> writes:
    >> But I don't think in Lisp this could be enforced in its entirety which
    >> is why I said that indentation mechanism should not attempt to enforce
    >> this.  It's very subjective.  Often, I want to keep a long line and a
    >> couple of moments afterwards I decide that it's too long after all.

    Lars> A coding style that's not automatically enforced isn't very useful, in
    Lars> my opinion.  It just leads to even more arguing, with some people
    Lars> insisting that it should always be adhered to, and others arguing that
    Lars> this is a special case where it shouldn't.

Apropos, I believe the current recommendation is to do

    (mapconcat #'identity seqs " ")

rather than

    (mapconcat 'identity seqs " ")

ie function-quoting the argument to mapconcat, apply, mapc etc, but

1. The elisp manual doesnʼt say that in (info "(elisp) Mapping Functions")
2. Emacs' code itself doesnʼt do that consistently (and we have the
odd #'(lambda ...) as well
3. The byte compiler doesnʼt warn about it.

I have a byte-compiler hack for [3] that could be used to fix [2], and
[1] is easily changed. But do we want to? I believe it helps the
byte-compiler generate better code, but donʼt know what the actual
effect is.

    Lars> We (the maintainers) usually touch up code before committing to adhere
    Lars> to our opinions of how the code should look, and hope that submitters
    Lars> pick up on it after a while (so that we don't have to keep on doing 
it).

Yes, but sometimes 'run your code through this tool first' encourages
people to conform, and saves you time.

Robert
-- 



reply via email to

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