diff options
| author | Nathan Moreau <nathan.moreau@m4x.org> | 2020-05-29 04:50:03 +0200 |
|---|---|---|
| committer | Nathan Moreau <nathan.moreau@m4x.org> | 2020-06-03 11:55:12 +0200 |
| commit | 15a077a61743f49076eb9a1c5c77a4279e01a736 (patch) | |
| tree | bcfcda5e5c6dab8594759f8dcd2f9fce5a871467 /rust-mode.el | |
| parent | bded6679d0659032851d033cdd206aae2a884ba4 (diff) | |
| download | rust-mode-15a077a61743f49076eb9a1c5c77a4279e01a736.tar.gz | |
rustc-colon-compilation-regexps: improve highlighting.
Diffstat (limited to 'rust-mode.el')
| -rw-r--r-- | rust-mode.el | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/rust-mode.el b/rust-mode.el index a53d320..0e95575 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -1928,23 +1928,22 @@ Return the created process." (or (rust--format-error-handler) (message "rustfmt detected problems, see *rustfmt* for more.")))))) -(defvar rustc-compilation-regexps +(defvar rustc-compilation-location (let ((file "\\([^\n]+\\)") (start-line "\\([0-9]+\\)") (start-col "\\([0-9]+\\)")) - (let ((re (concat "^\\(?:error\\|\\(warning\\)\\|\\(note\\)\\)[^\0]+?--> \\(" - file ":" start-line ":" start-col "\\)"))) - (cons re '(4 5 6 (1 . 2) 3)))) + (concat "\\(" file ":" start-line ":" start-col "\\)"))) + +(defvar rustc-compilation-regexps + (let ((re (concat "^\\(?:error\\|\\(warning\\)\\|\\(note\\)\\)[^\0]+?--> " + rustc-compilation-location))) + (cons re '(4 5 6 (1 . 2) 3))) "Specifications for matching errors in rustc invocations. See `compilation-error-regexp-alist' for help on their format.") (defvar rustc-colon-compilation-regexps - (let ((file "\\([^\n]+\\)") - (start-line "\\([0-9]+\\)") - (start-col "\\([0-9]+\\)")) - (let ((re (concat "^ *::: " file ":" start-line ":" start-col ; ::: foo/bar.rs - ))) - (cons re '(1 2 3 0)))) ;; 0 for info type + (let ((re (concat "^ *::: " rustc-compilation-location))) + (cons re '(2 3 4 0 1))) "Specifications for matching `:::` hints in rustc invocations. See `compilation-error-regexp-alist' for help on their format.") |
