From 3937833fff0c31f9f6c71badcec2e5d43f7e5eba Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 29 Jan 2026 17:11:17 +0200 Subject: [PATCH] xref-find-backend: Error instead of returning nil * lisp/progmodes/xref.el (xref-find-backend): Signal error when we can't find a backend to use (bug#80246). --- lisp/progmodes/xref.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index d2dd4167725..84a3fa4dfba 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -247,7 +247,9 @@ generic functions.") ;;;###autoload (defun xref-find-backend () - (run-hook-with-args-until-success 'xref-backend-functions)) + (or + (run-hook-with-args-until-success 'xref-backend-functions) + (user-error "No Xref backend available"))) (cl-defgeneric xref-backend-definitions (backend identifier) "Find definitions of IDENTIFIER.