Source

(setqmy-emacs-lisp-open-line-list'(ifwhenunlessdefundefmacrodefvardefcustomletlet*))(defunmy-emacs-lisp-open-line()"Opens a new line if the point is at the closing parens offunction on `my-emacs-lisp-open-line-list'."(interactive)(open-next-line)(when(save-excursion(forward-char)(backward-sexp)(member(car(sexp-at-point))my-emacs-lisp-open-line-list))(newline)(indent-according-to-mode)(previous-line)))(defunmy-emacs-lisp-init()(define-keyemacs-lisp-mode-map(kbd"RET")'my-emacs-lisp-open-line))(add-hook'emacs-lisp-mode-hook'my-emacs-lisp-init)