Go to the first, previous, next, last section, table of contents.


Printing in Edebug

If an expression in your program produces a value containing circular list structure, you may get an error when Edebug attempts to print it.

One way to cope with circular structure is to set print-length or print-level to truncate the printing. Edebug does this for you; it binds print-length and print-level to 50 if they were nil. (Actually, the variables edebug-print-length and edebug-print-level specify the values to use within Edebug.) See section Variables Affecting Output.

User Option: edebug-print-length
If non-nil, bind print-length to this while printing results in Edebug. The default value is 50.

User Option: edebug-print-level
If non-nil, bind print-level to this while printing results in Edebug. The default value is 50.

You can also print circular structures and structures that share elements more informatively by using the `cust-print' package.

To load `cust-print' and activate custom printing only for Edebug, simply use the command M-x edebug-install-custom-print. To restore the standard print functions, use M-x edebug-uninstall-custom-print.

Here is an example of code that creates a circular structure:

(setq a '(x y))
(setcar a a)

Custom printing prints this as `Result: #1=(#1# y)'. The `#1=' notation labels the structure that follows it with the label `1', and the `#1#' notation references the previously labeled structure. This notation is used for any shared elements of lists or vectors.

User Option: edebug-print-circle
If non-nil, bind print-circle to this while printing results in Edebug. The default value is nil.

Other programs can also use custom printing; see `cust-print.el' for details.


Go to the first, previous, next, last section, table of contents.