Skip to content

Instantly share code, notes, and snippets.

View jsoo1's full-sized avatar

John Soo jsoo1

View GitHub Profile
@jdtsmith
jdtsmith / toggle-debug-on-hidden-error.el
Last active May 29, 2024 18:44
Elisp: get stack trace for functions with suppressed errors (filter functions, post command hooks, etc.)
;;;; Power debugging
(defun my/reraise-error (func &rest args)
"Call function FUNC with ARGS and re-raise any error which occurs.
Useful for debugging post-command hooks and filter functions, which
normally have their errors suppressed."
(condition-case err
(apply func args)
((debug error) (signal (car err) (cdr err)))))
(defun toggle-debug-on-hidden-errors (func)