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.

3
  • 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, 2017 at 18:35
  • 1
    lispy can do something towards your goal. emacs.stackexchange.com/a/2235/4068
    – p_wiersig
    Sep 20, 2017 at 9:14
  • 1
    I get pretty good results just from fill-paragraph followed by re-indenting (I use Smartparens' sp-indent-defun). Sep 21, 2017 at 15:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.