19.2.7 错误捕获

当 Emacs 触发错误且未通过 condition-case 处理时,通常会显示错误信息。 当 Edebug 处于激活状态并执行插桩代码时,它会默认响应所有未处理的错误。 你可以通过选项 edebug-on-erroredebug-on-quit 自定义这一行为,见 Edebug 选项

当 Edebug 响应错误时,会定位到错误发生前最后一个暂停点。 该位置可能是某个未插桩函数的调用点,而错误实际发生在该函数内部。 对于未绑定变量错误,最后一个已知暂停点可能距离出错的变量引用很远。 这种情况下,你可能需要显示完整调用栈(see Edebug 其他命令)。

如果在 Edebug 激活期间修改了 debug-on-errordebug-on-quit, 这些修改会在 Edebug 退出后失效。 此外,在 Edebug 的递归编辑期间,这些变量会被绑定为进入 Edebug 之前的值。

emacs

Emacs

org-mode

Orgmode

Donations

打赏

Copyright

© 2025 Jasper Hsu

Creative Commons

Creative Commons

Attribute

Attribute

Noncommercial

Noncommercial

Share Alike

Share Alike