diff options
Diffstat (limited to '.emacs.d/lisp/rust-compile.el')
| -rw-r--r-- | .emacs.d/lisp/rust-compile.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/.emacs.d/lisp/rust-compile.el b/.emacs.d/lisp/rust-compile.el index 04ac6b6..cbdf43a 100644 --- a/.emacs.d/lisp/rust-compile.el +++ b/.emacs.d/lisp/rust-compile.el | |||
| @@ -28,6 +28,12 @@ See `compilation-error-regexp-alist' for help on their format.") | |||
| 28 | "Specifications for matching `:::` hints in rustc invocations. | 28 | "Specifications for matching `:::` hints in rustc invocations. |
| 29 | See `compilation-error-regexp-alist' for help on their format.") | 29 | See `compilation-error-regexp-alist' for help on their format.") |
| 30 | 30 | ||
| 31 | (defvar rustc-backtrace-compilation-regexps | ||
| 32 | (let ((re (concat "^ +at " rustc-compilation-location))) | ||
| 33 | (cons re '(2 3 4 0 1))) | ||
| 34 | "Specifications for matching stack backtraces in rustc invocations. | ||
| 35 | See `compilation-error-regexp-alist' for help on their format.") | ||
| 36 | |||
| 31 | (defvar rustc-refs-compilation-regexps | 37 | (defvar rustc-refs-compilation-regexps |
| 32 | (let ((re "^\\([0-9]+\\)[[:space:]]*|")) | 38 | (let ((re "^\\([0-9]+\\)[[:space:]]*|")) |
| 33 | (cons re '(nil 1 nil 0 1))) | 39 | (cons re '(nil 1 nil 0 1))) |
| @@ -48,6 +54,12 @@ See `compilation-error-regexp-alist' for help on their format.") | |||
| 48 | "Specifications for matching panics in cargo test invocations. | 54 | "Specifications for matching panics in cargo test invocations. |
| 49 | See `compilation-error-regexp-alist' for help on their format.") | 55 | See `compilation-error-regexp-alist' for help on their format.") |
| 50 | 56 | ||
| 57 | (defvar rustc-dbg!-compilation-regexps | ||
| 58 | (let ((re (concat "\\[" rustc-compilation-location "\\]"))) | ||
| 59 | (cons re '(2 3 4 0 1))) | ||
| 60 | "Specifications for matching dbg! output. | ||
| 61 | See `compilation-error-regexp-alist' for help on their format.") | ||
| 62 | |||
| 51 | (defun rustc-scroll-down-after-next-error () | 63 | (defun rustc-scroll-down-after-next-error () |
| 52 | "In the new style error messages, the regular expression | 64 | "In the new style error messages, the regular expression |
| 53 | matches on the file name (which appears after `-->`), but the | 65 | matches on the file name (which appears after `-->`), but the |
| @@ -80,11 +92,17 @@ the compilation window until the top of the error is visible." | |||
| 80 | (cons 'rustc-colon rustc-colon-compilation-regexps)) | 92 | (cons 'rustc-colon rustc-colon-compilation-regexps)) |
| 81 | (add-to-list 'compilation-error-regexp-alist 'rustc-colon) | 93 | (add-to-list 'compilation-error-regexp-alist 'rustc-colon) |
| 82 | (add-to-list 'compilation-error-regexp-alist-alist | 94 | (add-to-list 'compilation-error-regexp-alist-alist |
| 95 | (cons 'rustc-backtrace rustc-backtrace-compilation-regexps)) | ||
| 96 | (add-to-list 'compilation-error-regexp-alist 'rustc-backtrace) | ||
| 97 | (add-to-list 'compilation-error-regexp-alist-alist | ||
| 83 | (cons 'cargo cargo-compilation-regexps)) | 98 | (cons 'cargo cargo-compilation-regexps)) |
| 84 | (add-to-list 'compilation-error-regexp-alist-alist | 99 | (add-to-list 'compilation-error-regexp-alist-alist |
| 85 | (cons 'rustc-panics rustc-panics-compilation-regexps)) | 100 | (cons 'rustc-panics rustc-panics-compilation-regexps)) |
| 86 | (add-to-list 'compilation-error-regexp-alist 'rustc-panics) | 101 | (add-to-list 'compilation-error-regexp-alist 'rustc-panics) |
| 87 | (add-to-list 'compilation-error-regexp-alist 'cargo) | 102 | (add-to-list 'compilation-error-regexp-alist 'cargo) |
| 103 | (add-to-list 'compilation-error-regexp-alist-alist | ||
| 104 | (cons 'rust-dbg! rustc-dbg!-compilation-regexps)) | ||
| 105 | (add-to-list 'compilation-error-regexp-alist 'rust-dbg!) | ||
| 88 | (add-hook 'next-error-hook #'rustc-scroll-down-after-next-error))) | 106 | (add-hook 'next-error-hook #'rustc-scroll-down-after-next-error))) |
| 89 | 107 | ||
| 90 | ;;; _ | 108 | ;;; _ |
