Skip to content

Commit

Permalink
add rust-mode workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
wildwestrom authored Jul 15, 2022
1 parent 7e4bab0 commit 0fcb823
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/libs/error-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,15 @@ Caused by:
```

Please see the [documentation] for a full description.

## 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 for `cargo-mode`, contained within `compilation-error-regexp-alist-alist`, which is used to format the string and create a hyperlink.
```emacs-lisp
(setq error_stack-regexps
'("\\(?:at\\|',\\) \\(\\([^:\s]+\\):\\([0-9]+\\)\\)"
2 3 nil nil 1))
(setf (cdr (assoc 'cargo compilation-error-regexp-alist-alist))
error_stack-regexps)
```

0 comments on commit 0fcb823

Please sign in to comment.