+@html
+<A NAME="EDEBUG"></A>
+@end html
+@node Electric Debug Mode, , Walking the Calling Stack, Debugging IDL Programs
+@subsection Electric Debug Mode
+@cindex Electric Debug Mode
+@cindex @samp{*Debugging*}
+
+Even with a convenient debug key prefix enabled, repetitive stepping,
+variable examination (@pxref{Examining Variables}), and other debugging
+activities can be awkward and slow using commands which require multiple
+keystrokes. Luckily, there's a better way, inspired by the lisp e-debug
+mode, and available through the @emph{Electric Debug Mode}. By default,
+as soon as a breakpoint is hit, this minor mode is enabled. The buffer
+showing the line where execution has halted is switched to Electric
+Debug Mode. This mode is visible as @samp{*Debugging*} in the mode
+line, and a different face (violet by default, if color is available)
+for the line stopped at point. The buffer is made read-only and
+single-character bindings for the most commonly used debugging commands
+are enabled. These character commands (a list of which is available
+with @kbd{C-?}) are:
+
+@multitable @columnfractions .2 .8
+@item @kbd{a}
+@tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp})
+@item @kbd{b}
+@tab Set breakpoint, @kbd{C-u b} for a conditional break, @kbd{C-n b} for nth hit (@code{idlwave-shell-break-here})
+@item @kbd{d}
+@tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp})
+@item @kbd{e}
+@tab Prompt for expression to print (@code{idlwave-shell-clear-current-bp}).
+@item @kbd{h}
+@tab Continue to the line at cursor position (@code{idlwave-shell-to-here})
+@item @kbd{i}
+@tab Set breakpoint in module named here (@code{idlwave-shell-break-in})
+@item @kbd{[}
+@tab Go to the previous breakpoint in the file (@code{idlwave-shell-goto-previous-bp})
+@item @kbd{]}
+@tab Go to the next breakpoint in the file
+(@code{idlwave-shell-goto-next-bp})
+@item @kbd{\}
+@tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp})
+@item @kbd{j}
+@tab Set breakpoint at beginning of enclosing routine (@code{idlwave-shell-break-this-module})
+@item @kbd{k}
+@tab Skip one statement (@code{idlwave-shell-skip})
+@item @kbd{m}
+@tab Continue to end of function (@code{idlwave-shell-return})
+@item @kbd{n}
+@tab Step, over function calls (@code{idlwave-shell-stepover})
+@item @kbd{o}
+@tab Continue past end of function (@code{idlwave-shell-out})
+@item @kbd{p}
+@tab Print expression near point or in region with @kbd{C-u p} (@code{idlwave-shell-print})
+@item @kbd{q}
+@tab End the debugging session and return to the Shell's main level
+(@code{idlwave-shell-retall})
+@item @kbd{r}
+@tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont})
+@item @kbd{s} or @kbd{@key{SPACE}}
+@tab Step, into function calls (@code{idlwave-shell-step})
+@item @kbd{t}
+@tab Print a calling-level traceback in the shell
+@item @kbd{u}
+@tab Continue to end of block (@code{idlwave-shell-up})
+@item @kbd{v}
+@tab Turn Electric Debug Mode off
+(@code{idlwave-shell-electric-debug-mode})
+@item @kbd{x}
+@tab Examine expression near point (or in region with @kbd{C-u x})
+with shortcut of examine type.
+@item @kbd{z}
+@tab Reset IDL (@code{idlwave-shell-reset})
+@item @kbd{+} or @kbd{=}
+@tab Show higher level in calling stack (@code{idlwave-shell-stack-up})
+@item @kbd{-} or @kbd{_}
+@tab Show lower level in calling stack (@code{idlwave-shell-stack-down})
+@item @kbd{?}
+@tab Help on expression near point or in region with @kbd{C-u ?}
+(@code{idlwave-shell-help-expression})
+@item @kbd{C-?}
+@tab Show help on the commands available.
+@end multitable
+
+Most single-character electric debug bindings use the final keystroke
+of the equivalent multiple key commands (which are of course also
+still available), but some differ (e.g. @kbd{e},@kbd{t},@kbd{q},@kbd{x}).
+Some have additional convenience bindings (like @kbd{@key{SPACE}} for
+stepping). All prefix and other argument options described in this
+section for the commands invoked by electric debug bindings are still
+valid. For example, @kbd{C-u b} sets a conditional breakpoint, just
+as it did with @kbd{C-u C-c C-d C-b}.
+
+You can toggle the electric debug mode at any time in a buffer using
+@kbd{C-c C-d C-v} (@kbd{v} to turn it off while in the mode), or from
+the Debug menu. Normally the mode will be enabled and disabled at the
+appropriate times, but occassionally you might want to edit a file
+while still debugging it, or switch to the mode for conveniently
+setting lots of breakpoints.
+
+To quickly abandon a debugging session and return to normal editing at
+the Shell's main level, use @kbd{q} (@code{idlwave-shell-retall}).
+This disables electric debug mode in all IDLWAVE buffers@footnote{Note
+that this binding is not symmetric: @kbd{C-c C-d C-q} is bound to
+@code{idlwave-shell-quit}, which quits your IDL session.}. Help is
+available for the command shortcuts with @kbd{C-?}. If you find this
+mode gets in your way, you can keep it from automatically activating
+by setting the variable @code{idlwave-shell-automatic-electric-debug}
+to @code{nil}, or @code{'breakpoint}. If you'd like the convenient
+electric debug shortcuts available also when run-time errors are
+encountered, set to @code{t}.
+
+@defopt idlwave-shell-automatic-electric-debug (@code{'breakpoint})
+Whether to enter electric debug mode automatically when a breakpoint
+or run-time error is encountered, and then disable it in all buffers
+when the $MAIN$ level is reached (either through normal program
+execution, or retall). In addition to @code{nil} for never, and
+@code{t} for both breakpoints and errors, this can be
+@code{'breakpoint} (the default) to enable it only at breakpoint
+halts.
+@end defopt
+
+@defopt idlwave-shell-electric-stop-color (Violet)
+Default color of the stopped line overlay when in electric debug mode.
+@end defopt
+
+@defopt idlwave-shell-electric-stop-line-face
+The face to use for the stopped line. Defaults to a face similar to the
+modeline, with color @code{idlwave-shell-electric-stop-color}.
+@end defopt
+
+@defopt idlwave-shell-electric-zap-to-file (@code{t})
+If set, when entering electric debug mode, select the window displaying
+the file where point is stopped. This takes point away from the shell
+window, but is useful for immediate stepping, etc.
+@end defopt
+
+@html
+<A NAME="EXAMINE"></A>
+@end html