branch: master commit 580e5c64f62153f0a3c6093770d4ffabcf695ce5 Author: Noam Postavsky <npost...@users.sourceforge.net> Commit: Noam Postavsky <npost...@users.sourceforge.net>
Don't lose error message when yas-good-grace is t * yasnippet.el (yas--eval-lisp-no-saves): Pass error message to message function. (yas--handle-error): Pass "%s" to error to avoid accidentally interpreting % in the error message as format codes. --- yasnippet.el | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index c1527dd..9d4764d 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -1250,7 +1250,7 @@ yasnippet keeps a list of modes like this to help the judgment." "Handle error depending on value of `yas-good-grace'." (let ((msg (yas--format "elisp error: %s" (error-message-string err)))) (if yas-good-grace msg - (error msg)))) + (error "%s" msg)))) (defun yas--eval-lisp (form) "Evaluate FORM and convert the result to string." @@ -1272,7 +1272,7 @@ yasnippet keeps a list of modes like this to help the judgment." (defun yas--eval-lisp-no-saves (form) (condition-case err (eval form) - (error (yas--handle-error err)))) + (error (message "%s" (yas--handle-error err))))) (defun yas--read-lisp (string &optional nil-on-error) "Read STRING as a elisp expression and return it.