Evaluate the expression before point, in the context outside of Edebug
(@code{edebug-eval-last-sexp}). With the prefix argument of zero
(@kbd{C-u 0 C-x C-e}), don't shorten long items (like strings and
-lists).
+lists). Any other prefix will result in the value being
+pretty-printed in a separate buffer.
@end table
@cindex lexical binding (Edebug)
When invoked with a prefix argument, as in 'C-u e', this command will
pop up a new buffer and show the full pretty-printed value there.
++++
+*** 'C-x C-e' now interprets a non-zero prefix arg to pretty-print the results.
+When invoked with a non-zero prefix argument, as in 'C-u C-x C-e',
+this command will pop up a new buffer and show the full pretty-printed
+value there.
+
** Compile
+++
(t
(princ result)))))
-(defun edebug-eval-last-sexp (&optional no-truncate)
+(defun edebug-eval-last-sexp (&optional display-type)
"Evaluate sexp before point in the outside environment.
-Print value in minibuffer.
-
-If NO-TRUNCATE is non-nil (or interactively with a prefix
-argument of zero), show the full length of the expression, not
-limited by `edebug-print-length' or `edebug-print-level'."
+If DISPLAY-TYPE is `pretty-print' (interactively, a non-zero
+prefix argument), pretty-print the value in a separate buffer.
+Otherwise, print the value in minibuffer. If DISPLAY-TYPE is any
+other non-nil value (or interactively with a prefix argument of
+zero), show the full length of the expression, not limited by
+`edebug-print-length' or `edebug-print-level'."
(interactive
(list (and current-prefix-arg
- (zerop (prefix-numeric-value current-prefix-arg)))))
- (if no-truncate
- (let ((edebug-print-length nil)
- (edebug-print-level nil))
- (edebug-eval-expression (edebug-last-sexp)))
- (edebug-eval-expression (edebug-last-sexp))))
+ (if (zerop (prefix-numeric-value current-prefix-arg))
+ 'no-truncate
+ 'pretty-print))))
+ (if (or (null display-type)
+ (eq display-type 'pretty-print))
+ (edebug-eval-expression (edebug-last-sexp) display-type)
+ (let ((edebug-print-length nil)
+ (edebug-print-level nil))
+ (edebug-eval-expression (edebug-last-sexp)))))
(defun edebug-eval-print-last-sexp (&optional no-truncate)
"Evaluate sexp before point in outside environment; insert value.