From 8e13bc68c7f545f9be67fb5cc271fce484689dcc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 21 Nov 2021 15:57:58 +0100 Subject: [PATCH] fix(lookup): strip text properties from error message Otherwise the error will display a lot of (albeit harmless) gibberish to the end user. Fix: #5652 --- modules/tools/lookup/autoload/lookup.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index 1f9e9b2de..e8222bed6 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -329,7 +329,7 @@ evil-mode is active." current-prefix-arg)) (cond ((null identifier) (user-error "Nothing under point")) ((+lookup--jump-to :definition identifier nil arg)) - ((error "Couldn't find the definition of %S" identifier)))) + ((user-error "Couldn't find the definition of %S" (substring-no-properties identifier))))) ;;;###autoload (defun +lookup/implementations (identifier &optional arg) @@ -341,7 +341,7 @@ the point or current buffer." current-prefix-arg)) (cond ((null identifier) (user-error "Nothing under point")) ((+lookup--jump-to :implementations identifier nil arg)) - ((error "Couldn't find the implementations of %S" identifier)))) + ((user-error "Couldn't find the implementations of %S" (substring-no-properties identifier))))) ;;;###autoload (defun +lookup/type-definition (identifier &optional arg) @@ -353,7 +353,7 @@ the point or current buffer." current-prefix-arg)) (cond ((null identifier) (user-error "Nothing under point")) ((+lookup--jump-to :type-definition identifier nil arg)) - ((error "Couldn't find the definition of %S" identifier)))) + ((user-error "Couldn't find the definition of %S" (substring-no-properties identifier))))) ;;;###autoload (defun +lookup/references (identifier &optional arg) @@ -366,7 +366,7 @@ search otherwise." current-prefix-arg)) (cond ((null identifier) (user-error "Nothing under point")) ((+lookup--jump-to :references identifier nil arg)) - ((error "Couldn't find references of %S" identifier)))) + ((user-error "Couldn't find references of %S" (substring-no-properties identifier))))) ;;;###autoload (defun +lookup/documentation (identifier &optional arg) @@ -378,7 +378,7 @@ for the current mode/buffer (if any), then falls back to the backends in (interactive (list (doom-thing-at-point-or-region) current-prefix-arg)) (cond ((+lookup--jump-to :documentation identifier #'pop-to-buffer arg)) - ((user-error "Couldn't find documentation for %S" identifier)))) + ((user-error "Couldn't find documentation for %S" (substring-no-properties identifier))))) ;;;###autoload (defun +lookup/file (&optional path)