Function: ghostel--run-hook-safely

ghostel--run-hook-safely is a natively compiled function defined in ghostel.el.

Signature

(ghostel--run-hook-safely HOOK &rest ARGS)

Documentation

Run HOOK with ARGS, isolating errors per handler.

Each handler is wrapped in with-demoted-errors so a raising handler logs and the remaining hooks still run. As with the rest of Emacs, with-demoted-errors re-signals when debug-on-error is non-nil so the debugger fires for hook authors who want it.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel--run-hook-safely (hook &rest args)
  "Run HOOK with ARGS, isolating errors per handler.
Each handler is wrapped in `with-demoted-errors' so a raising
handler logs and the remaining hooks still run.  As with the rest
of Emacs, `with-demoted-errors' re-signals when `debug-on-error'
is non-nil so the debugger fires for hook authors who want it."
  (run-hook-wrapped
   hook
   (lambda (fn)
     (with-demoted-errors "ghostel: error in hook: %S"
       (apply fn args))
     nil)))