Let's say I have a function that looks like the following (as is often the case when printing elisp output).
(defun my-example-function () (let ((a (do-something)) (b (do-something))) (setq someone me) (with-current-buffer b (do-that (or this (and that those))) (format "%s" a))))
I would like a command that can turn that into something a human would write, such as the following.
(defun my-example-function ()
(let ((a (do-something))
(b (do-something)))
(setq someone me)
(with-current-buffer b
(do-that (or this (and that those)))
(format "%s" a))))
I understand that there's more than one way to format a piece of elisp code, and different human beings do it differently. Furthermore, I understand it's somewhat subjective. But it should be fairly easy to come up with a set of rules that results in code that is at least decent.
I actually tought of doing this myself a while ago, but I figured it's better to ask before I reinvent the wheel.
Note, I'm aware of the pp function, but it doesn't quite get there:
(defun my-example-function nil
(let
((a
(do-something))
(b
(do-something)))
(setq someone me)
(with-current-buffer b
(do-that
(or this
(and that those)))
(format "%s" a))))
pp
.