3

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

  • 1
    No. Feel free to write such a thing, it's way harder than it looks. 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. emacs.stackexchange.com/a/2235/4068 – p_wiersig Sep 20 '17 at 9: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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.