|
14 | 14 |
|
15 | 15 | ;;; Code:
|
16 | 16 |
|
17 |
| -(eval-when-compile (require 'rx) |
18 |
| - (require 'compile) |
19 |
| - (require 'url-vars)) |
| 17 | +(eval-when-compile (require 'rx)) |
| 18 | +(eval-when-compile (require 'url-vars)) |
20 | 19 |
|
21 | 20 | (require 'json)
|
22 | 21 | (require 'thingatpt)
|
@@ -1973,77 +1972,6 @@ Return the created process."
|
1973 | 1972 | (or (rust--format-error-handler)
|
1974 | 1973 | (message "rustfmt detected problems, see *rustfmt* for more."))))))
|
1975 | 1974 |
|
1976 |
| -;;; Compilation |
1977 |
| - |
1978 |
| -(defvar rustc-compilation-location |
1979 |
| - (let ((file "\\([^\n]+\\)") |
1980 |
| - (start-line "\\([0-9]+\\)") |
1981 |
| - (start-col "\\([0-9]+\\)")) |
1982 |
| - (concat "\\(" file ":" start-line ":" start-col "\\)"))) |
1983 |
| - |
1984 |
| -(defvar rustc-compilation-regexps |
1985 |
| - (let ((re (concat "^\\(?:error\\|\\(warning\\)\\|\\(note\\)\\)[^\0]+?--> " |
1986 |
| - rustc-compilation-location))) |
1987 |
| - (cons re '(4 5 6 (1 . 2) 3))) |
1988 |
| - "Specifications for matching errors in rustc invocations. |
1989 |
| -See `compilation-error-regexp-alist' for help on their format.") |
1990 |
| - |
1991 |
| -(defvar rustc-colon-compilation-regexps |
1992 |
| - (let ((re (concat "^ *::: " rustc-compilation-location))) |
1993 |
| - (cons re '(2 3 4 0 1))) |
1994 |
| - "Specifications for matching `:::` hints in rustc invocations. |
1995 |
| -See `compilation-error-regexp-alist' for help on their format.") |
1996 |
| - |
1997 |
| -(defvar rustc-refs-compilation-regexps |
1998 |
| - (let ((re "^\\([0-9]+\\)[[:space:]]*|")) |
1999 |
| - (cons re '(nil 1 nil 0 1))) |
2000 |
| - "Specifications for matching code references in rustc invocations. |
2001 |
| -See `compilation-error-regexp-alist' for help on their format.") |
2002 |
| - |
2003 |
| -;; Match test run failures and panics during compilation as |
2004 |
| -;; compilation warnings |
2005 |
| -(defvar cargo-compilation-regexps |
2006 |
| - '("^\\s-+thread '[^']+' panicked at \\('[^']+', \\([^:]+\\):\\([0-9]+\\)\\)" |
2007 |
| - 2 3 nil nil 1) |
2008 |
| - "Specifications for matching panics in cargo test invocations. |
2009 |
| -See `compilation-error-regexp-alist' for help on their format.") |
2010 |
| - |
2011 |
| -(defun rustc-scroll-down-after-next-error () |
2012 |
| - "In the new style error messages, the regular expression |
2013 |
| -matches on the file name (which appears after `-->`), but the |
2014 |
| -start of the error appears a few lines earlier. This hook runs |
2015 |
| -after `next-error' (\\[next-error]); it simply scrolls down a few lines in |
2016 |
| -the compilation window until the top of the error is visible." |
2017 |
| - (save-selected-window |
2018 |
| - (when (eq major-mode 'rust-mode) |
2019 |
| - (select-window (get-buffer-window next-error-last-buffer 'visible)) |
2020 |
| - (when (save-excursion |
2021 |
| - (beginning-of-line) |
2022 |
| - (looking-at " *-->")) |
2023 |
| - (let ((start-of-error |
2024 |
| - (save-excursion |
2025 |
| - (beginning-of-line) |
2026 |
| - (while (not (looking-at "^[a-z]+:\\|^[a-z]+\\[E[0-9]+\\]:")) |
2027 |
| - (forward-line -1)) |
2028 |
| - (point)))) |
2029 |
| - (set-window-start (selected-window) start-of-error)))))) |
2030 |
| - |
2031 |
| -(eval-after-load 'compile |
2032 |
| - '(progn |
2033 |
| - (add-to-list 'compilation-error-regexp-alist-alist |
2034 |
| - (cons 'rustc-refs rustc-refs-compilation-regexps)) |
2035 |
| - (add-to-list 'compilation-error-regexp-alist 'rustc-refs) |
2036 |
| - (add-to-list 'compilation-error-regexp-alist-alist |
2037 |
| - (cons 'rustc rustc-compilation-regexps)) |
2038 |
| - (add-to-list 'compilation-error-regexp-alist 'rustc) |
2039 |
| - (add-to-list 'compilation-error-regexp-alist-alist |
2040 |
| - (cons 'rustc-colon rustc-colon-compilation-regexps)) |
2041 |
| - (add-to-list 'compilation-error-regexp-alist 'rustc-colon) |
2042 |
| - (add-to-list 'compilation-error-regexp-alist-alist |
2043 |
| - (cons 'cargo cargo-compilation-regexps)) |
2044 |
| - (add-to-list 'compilation-error-regexp-alist 'cargo) |
2045 |
| - (add-hook 'next-error-hook 'rustc-scroll-down-after-next-error))) |
2046 |
| - |
2047 | 1975 | ;;; Secondary Commands
|
2048 | 1976 |
|
2049 | 1977 | (defun rust-playpen-region (begin end)
|
|
0 commit comments