blob: 0e2a14c996aaca5d8ac245204529b3a1725680b6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
<h4 class="subsection">Printing in Edebug</h4> <p>If an expression in your program produces a value containing circular list structure, you may get an error when Edebug attempts to print it. </p> <p>One way to cope with circular structure is to set <code>print-length</code> or <code>print-level</code> to truncate the printing. Edebug does this for you; it binds <code>print-length</code> and <code>print-level</code> to the values of the variables <code>edebug-print-length</code> and <code>edebug-print-level</code> (so long as they have non-<code>nil</code> values). See <a href="output-variables">Output Variables</a>. </p> <dl> <dt id="edebug-print-length">User Option: <strong>edebug-print-length</strong>
</dt> <dd><p>If non-<code>nil</code>, Edebug binds <code>print-length</code> to this value while printing results. The default value is <code>50</code>. </p></dd>
</dl> <dl> <dt id="edebug-print-level">User Option: <strong>edebug-print-level</strong>
</dt> <dd><p>If non-<code>nil</code>, Edebug binds <code>print-level</code> to this value while printing results. The default value is <code>50</code>. </p></dd>
</dl> <p>You can also print circular structures and structures that share elements more informatively by binding <code>print-circle</code> to a non-<code>nil</code> value. </p> <p>Here is an example of code that creates a circular structure: </p> <div class="example"> <pre class="example">(setq a (list 'x 'y))
(setcar a a)
</pre>
</div> <p>If <code>print-circle</code> is non-<code>nil</code>, printing functions (e.g., <code>prin1</code>) will print <code>a</code> as ‘<samp>#1=(#1# y)</samp>’. The ‘<samp>#1=</samp>’ notation labels the structure that follows it with the label ‘<samp>1</samp>’, and the ‘<samp>#1#</samp>’ notation references the previously labeled structure. This notation is used for any shared elements of lists or vectors. </p> <dl> <dt id="edebug-print-circle">User Option: <strong>edebug-print-circle</strong>
</dt> <dd><p>If non-<code>nil</code>, Edebug binds <code>print-circle</code> to this value while printing results. The default value is <code>t</code>. </p></dd>
</dl> <p>For further details about how printing can be customized, see see <a href="output-functions">Output Functions</a>. </p><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Printing-in-Edebug.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Printing-in-Edebug.html</a>
</p>
</div>
|