blob: 96cc379310f3bb91a0c4aabb822ecee4449ae465 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<h4 class="subsection">Entering the debugger when a variable is modified</h4> <p>Sometimes a problem with a function is due to a wrong setting of a variable. Setting up the debugger to trigger whenever the variable is changed is a quick way to find the origin of the setting. </p> <dl> <dt id="debug-on-variable-change">Command: <strong>debug-on-variable-change</strong> <em>variable</em>
</dt> <dd>
<p>This function arranges for the debugger to be called whenever <var>variable</var> is modified. </p> <p>It is implemented using the watchpoint mechanism, so it inherits the same characteristics and limitations: all aliases of <var>variable</var> will be watched together, only dynamic variables can be watched, and changes to the objects referenced by variables are not detected. For details, see <a href="watching-variables">Watching Variables</a>. </p>
</dd>
</dl> <dl> <dt id="cancel-debug-on-variable-change">Command: <strong>cancel-debug-on-variable-change</strong> <em>&optional variable</em>
</dt> <dd><p>This function undoes the effect of <code>debug-on-variable-change</code> on <var>variable</var>. When called interactively, it prompts for <var>variable</var> in the minibuffer. If <var>variable</var> is omitted or <code>nil</code>, it cancels break-on-change for all variables. Calling <code>cancel-debug-on-variable-change</code> does nothing to a variable which is not currently set up to break on change. </p></dd>
</dl><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/Variable-Debugging.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Variable-Debugging.html</a>
</p>
</div>
|