Skip to content

Commit

Permalink
auto merge of #8747 : pnkfelix/rust/fsk-issue6887-fix-emacs-compilati…
Browse files Browse the repository at this point in the history
…on-regexp, r=graydon

Fix #6887
  • Loading branch information
bors committed Aug 27, 2013
2 parents af99b8d + 9d8897b commit c0aadfd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/etc/emacs/rust-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,27 @@ The initializer is `DEFAULT-TAB-WIDTH'.")

(provide 'rust-mode)

;; Issue #6887: Rather than inheriting the 'gnu compilation error
;; regexp (which is broken on a few edge cases), add our own 'rust
;; compilation error regexp and use it instead.
(defvar rustc-compilation-regexps
(let ((file "^\\([^\n]+\\)")
(start-line "\\([0-9]+\\)")
(start-col "\\([0-9]+\\)")
(end-line "\\([0-9]+\\)")
(end-col "\\([0-9]+\\)")
(error-or-warning "\\(?:[Ee]rror\\|\\([Ww]arning\\)\\)"))
(let ((re (concat "^" file ":" start-line ":" start-col
": " end-line ":" end-col
" \\(?:[Ee]rror\\|\\([Ww]arning\\)\\):")))
(cons re '(1 (2 . 4) (3 . 5) (6)))))
"Specifications for matching errors in rustc invocations.
See `compilation-error-regexp-alist for help on their format.")

(eval-after-load 'compile
'(progn
(add-to-list 'compilation-error-regexp-alist-alist
(cons 'rustc rustc-compilation-regexps))
(add-to-list 'compilation-error-regexp-alist 'rustc)))

;;; rust-mode.el ends here

0 comments on commit c0aadfd

Please sign in to comment.