emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs Lisp code formatting


From: Lars Ingebrigtsen
Subject: Re: Emacs Lisp code formatting
Date: Sun, 07 Nov 2021 22:06:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Juri Linkov <juri@linkov.net> writes:

> Oh, I thought it works like 'pp-buffer' - just by adding/removing newlines
> (because everything else is handled by 'indent-sexp').

Since we're being passed a sexp, I thought it would be easier to just
work on the sexp instead of inserting it into the buffer and then
partially re-parse it to get at the symbol properties.  pp-buffer
doesn't have that problem, since it basically doesn't care about any of
that.

> Would it be possible to do such a thing and keep it uncomplicated?
> For example, to ensure there is no newline after if/when/unless, but insert
> a newline after its condition, unless it's short enough to fit on one line,
> etc.

Sure, doing it that way around would produce results that could be used
when editing code, too (which was not part of what I was trying to do
here), but my guess is that it'd be more complicated.  But I haven't
tried -- if you want to rewrite the code to do it that way around,
please do so.  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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