Skip to content

Fix #291: pprint handler-case neatly

Raymond Toy requested to merge issue-291-pprint-handler-case into master

Modify the pprinter for handler-case so that the error clauses are printed more like a function. Thus, for

(defun careful-expand-macro (fun form)
  (handler-case (invoke-macroexpand-hook fun form *lexical-environment*)
    (error (condition)
           (compiler-error "(during macroexpansion)~%~A"
                           condition))))

we get

(DEFUN CAREFUL-EXPAND-MACRO (FUN FORM)
  (HANDLER-CASE (INVOKE-MACROEXPAND-HOOK FUN FORM *LEXICAL-ENVIRONMENT*)
     (ERROR (CONDITION)
       (COMPILER-ERROR "(during macroexpansion)~%~A" CONDITION))))

where the error clause has its body indented by just 2 spaces instead of lining up with the opening parenthesis of the arg.

Merge request reports