[Top][All Lists]

[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: Fri, 05 Nov 2021 00:34:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Doesn't Emacs have a pretty-printer for code?

Emacs does now.  So instead of the `pp' output of

(lambda nil
      ((beg nil))
    (setq beg
         (looking-at "[ \n ]")
    (delete-region beg

you can have

(lambda ()
  (let ((beg nil))
    (setq beg (point))
    (while (and (looking-at "[  \n ]") (not (eobp)))
    (delete-region beg (point))))

with `pp-emacs-lisp-code'.  And I'm sure there's a ton of stuff that can
be tweaked -- this is the sort of stuff that'd open ended, because
there's always something that can look just a bit prettier.

Have at it if you want to, but remember to add test cases.

(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]