diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/printing-in-edebug.html | |
new repository
Diffstat (limited to 'devdocs/elisp/printing-in-edebug.html')
| -rw-r--r-- | devdocs/elisp/printing-in-edebug.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/devdocs/elisp/printing-in-edebug.html b/devdocs/elisp/printing-in-edebug.html new file mode 100644 index 00000000..0e2a14c9 --- /dev/null +++ b/devdocs/elisp/printing-in-edebug.html @@ -0,0 +1,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> |
