[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
(interactive)
(let
((beg nil))
(setq beg
(point))
(while
(and
(looking-at "[ \n ]")
(not
(eobp)))
(forward-char))
(delete-region beg
(point))))
you can have
(lambda ()
(interactive)
(let ((beg nil))
(setq beg (point))
(while (and (looking-at "[ \n ]") (not (eobp)))
(forward-char))
(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
- Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/02
- Re: Emacs Lisp code formatting, Campbell Barton, 2021/11/02
- Re: Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/03
- Re: Emacs Lisp code formatting, Campbell Barton, 2021/11/03
- Re: Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/04
- Re: Emacs Lisp code formatting, Campbell Barton, 2021/11/04
- Re: Emacs Lisp code formatting, Helmut Eller, 2021/11/04
- Re: Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/04
Re: Emacs Lisp code formatting,
Lars Ingebrigtsen <=
- Re: Emacs Lisp code formatting, Juri Linkov, 2021/11/06
- Re: Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/06
- Re: Emacs Lisp code formatting, Juri Linkov, 2021/11/07
- Re: Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/07
- Re: Emacs Lisp code formatting, Juri Linkov, 2021/11/08
- Re: Emacs Lisp code formatting, Lars Ingebrigtsen, 2021/11/08
Re: Emacs Lisp code formatting, Michael Heerdegen, 2021/11/06