Stefan Monnier writes: Emacspeak in module emacspeak-advice.el https://github.com/tvraman/emacspeak/blob/master/lisp/emacspeak-advice.el#L819 uses the following lines to handle this: (defun emacspeak-error-handler (data context _calling-function) "Emacspeak custom error handler." (emacspeak-auditory-icon 'warn-user) (message "%s %s" (or context " ") (error-message-string data))) >>> I don't see a problem running arbitrary ELisp code at that time. >>> After all, we already exited the error-signaling context >> We did? > > You made me doubt, but indeed I see: > > Lisp_Object > command_loop_2 (Lisp_Object handlers) > { > register Lisp_Object val; > > do > val = internal_condition_case (command_loop_1, handlers, cmd_error); > while (!NILP (val)); > > return Qnil; > } > > So `cmd_error` is run after we exit the error-signaling context. > Also while looking at it, I saw tht `cmd_error` then calls > `cmd_error_internal` which calls `command-error-function`: > > command-error-function is a variable defined in ‘C source code’. > > Its value is ‘help-command-error-confusable-suggestions’ > > Function to output error messages. > Called with three arguments: > - the error data, a list of the form (SIGNALED-CONDITION . SIGNAL-DATA) > such as what ‘condition-case’ would bind its variable to, > - the context (a string which normally goes at the start of the message), > - the Lisp function within which the error was signaled. > > Also see ‘set-message-function’ (which controls how non-error messages > are displayed). > > So we do already allow running arbitrary ELisp code in there ;-) > > > Stefan > > -- Thanks, --Raman(I Search, I Find, I Misplace, I Research) ♈ Id: kg:/m/0285kf1 🦮