4

(N00b question.)

Is there command/package/snippet to format elisp code (like in my init file) in a standard(-ish) way, like what Prettier does for JavaScript?

I'm not only concerned about indentation, but keeping lines at max 80 chars, and whatever other general readability things are considered useful.

Drew
  • 75,699
  • 9
  • 109
  • 225
agentofuser
  • 501
  • 3
  • 11
  • 1
    No. Feel free to write such a thing, it's [way harder than it looks](http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/). Personally, I'd just deal with inserting newlines myself and let Emacs auto-indent the code. – wasamasa Sep 16 '17 at 18:35
  • 1
    lispy can do something towards your goal. https://emacs.stackexchange.com/a/2235/4068 – p_wiersig Sep 20 '17 at 09:14
  • 1
    I get pretty good results just from `fill-paragraph` followed by re-indenting (I use Smartparens' `sp-indent-defun`). – Aaron Harris Sep 21 '17 at 15:11

0 Answers0