From b2a20abf92b8c2a5ffe576da40189046ecac00dc Mon Sep 17 00:00:00 2001 From: West Date: Mon, 18 Jul 2022 08:43:25 +0000 Subject: [PATCH] Add rust-mode workaround for error_stack errors (#812) Co-authored-by: Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> --- packages/libs/error-stack/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/libs/error-stack/README.md b/packages/libs/error-stack/README.md index 9f7a9146c04..1c3e5c08ddf 100644 --- a/packages/libs/error-stack/README.md +++ b/packages/libs/error-stack/README.md @@ -111,3 +111,17 @@ Caused by: ``` Please see the [documentation] for a full description. + +## Troubleshooting + +### Emacs [rust-mode](https://github.com/rust-lang/rust-mode) workaround + +Due to [rust-lang/rust-mode#452](https://github.com/rust-lang/rust-mode/issues/452), errors messages are improperly parsed. As a result, the error messages show incorrect highlighting but also yield an incorrect hyperlink. + +The one workaround is to modify the regular expression used to format the string and create a hyperlink. + +```emacs-lisp +(setq cargo-compilation-regexps + '("\\(?:at\\|',\\) \\(\\([^:\s]+\\):\\([0-9]+\\)\\)" + 2 3 nil nil 1)) +```