Pprint handler-case better?
Describe the feature
Consider the form:
(defun careful-expand-macro (fun form)
(handler-case (invoke-macroexpand-hook fun form *lexical-environment*)
(error (condition)
(compiler-error "(during macroexpansion)~%~A"
condition))))
When cmucl pprints it, we get:
* (pprint '(defun careful-expand-macro (fun form)
(handler-case (invoke-macroexpand-hook fun form *lexical-environment*)
(error (condition)
(compiler-error "(during macroexpansion)~%~A"
condition)))))
(DEFUN CAREFUL-EXPAND-MACRO (FUN FORM)
(HANDLER-CASE (INVOKE-MACROEXPAND-HOOK FUN FORM *LEXICAL-ENVIRONMENT*)
(ERROR (CONDITION)
(COMPILER-ERROR "(during macroexpansion)~%~A" CONDITION))))
I think it looks better if the result were:
(DEFUN CAREFUL-EXPAND-MACRO (FUN FORM)
(HANDLER-CASE (INVOKE-MACROEXPAND-HOOK FUN FORM *LEXICAL-ENVIRONMENT*)
(ERROR (CONDITION)
(COMPILER-ERROR "(during macroexpansion)~%~A" CONDITION))))
That is, the body of the error
shouldn't be lined up with the arg. It should be indented 2 spaces.
Looking at some examples in the code base, there's a mixe of styles. Some is like the former and some like the latter.
Is there a prototype?
No. But it should be hard to create a pprinter for this.