I need to advise emacs to do something when any error dings to the user. I can't find any documentation on which function I actually need to advise.
Which function do I need to advise to do something when a user-error is unhandled?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
The dinging is called ringing the bell. If the variable
ring-bell-function is defined, it's called instead of the terminal-dependent method (which may either emit a sound or flash the screen). So you'd set this variable, rather than advising a function.
If you want to get information about the error, you can piggyback on the debugger trigger mechanism. Set
t (and possibly tune other variables mentioned in the same section of the manual to make sure that the debugger is entered in the circumstances you want) and set the variable
debugger to your function. The default function is
debug if you want to call it from yours.