diff --git a/eglot.el b/eglot.el index 718a42db..72e09153 100644 --- a/eglot.el +++ b/eglot.el @@ -609,9 +609,9 @@ treated as in `eglot-dbind'." ,obj-once ,@body))) (t - (eglot--error "%S didn't match any of %S" - ,obj-once - ',(mapcar #'car clauses))))))) + (eglot--user-error "%S didn't match any of %S" + ,obj-once + ',(mapcar #'car clauses))))))) ;;; API (WORK-IN-PROGRESS!) @@ -1321,6 +1321,11 @@ CONNECT-ARGS are passed as additional arguments to ;;; Helpers (move these to API?) ;;; + +(defun eglot--user-error (format &rest args) + "Signal Eglot-specific `user-error' with FORMAT and ARGS." + (user-error "[eglot] %s" (apply #'format format args))) + (defun eglot--error (format &rest args) "Error out with FORMAT with ARGS." (error "[eglot] %s" (apply #'format format args))) @@ -3135,7 +3140,7 @@ at point. With prefix argument, prompt for ACTION-KIND." when (or (not action-kind) (equal action-kind (plist-get action :kind))) collect (cons (plist-get action :title) action)) - (apply #'eglot--error + (apply #'eglot--user-error (if action-kind `("No \"%s\" code actions here" ,action-kind) `("No code actions here"))))) (preferred-action (cl-find-if