branch: externals/vertico commit 6ba59484fa967540739d20f733c78264fea89b9d Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
README: Add section about debugging Vertico --- README.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.org b/README.org index a4c5a41fbc..fb48514ad6 100644 --- a/README.org +++ b/README.org @@ -493,6 +493,26 @@ following resources: Since this package is part of [[https://elpa.gnu.org/packages/vertico.html][GNU ELPA]] contributions require a copyright assignment to the FSF. +* Debugging Vertico + +When you observe an error in the =vertico--exhibit= post command hook, you should +install an advice to enforce debugging. This allows you to obtain a stack trace +in order to narrow down the location of the error. The reason is that post +command hooks are automatically disabled (and not debugged) by Emacs. Otherwise +Emacs could become unusable, given that the hooks are executed after every +command. + +#+begin_src emacs-lisp + (setq debug-on-error t) + + (defun force-debug (func &rest args) + (condition-case e + (apply func args) + ((debug error) (signal (car e) (cdr e))))) + + (advice-add #'vertico--exhibit :around #'force-debug) +#+end_src + * Problematic completion commands Vertico is robust in most scenarios. However some completion commands make