|
36 | 36 |
|
37 | 37 | ;;; Code:
|
38 | 38 |
|
| 39 | +(require 'compile) ; compilation-error-regexp-alist-alist |
39 | 40 | (require 'easymenu) ; Elixir Mode menu definition
|
| 41 | +(require 'elixir-format) ; Elixir Format functions |
40 | 42 | (require 'elixir-smie) ; Syntax and indentation support
|
41 | 43 | (require 'pkg-info) ; Display Elixir Mode package version
|
42 |
| -(require 'elixir-format) ; Elixir Format functions |
43 | 44 |
|
44 | 45 | (defgroup elixir nil
|
45 | 46 | "Major mode for editing Elixir code."
|
@@ -551,6 +552,67 @@ just return nil."
|
551 | 552 | (add-to-list 'auto-mode-alist '("\\.ex\\'" . elixir-mode))
|
552 | 553 | (add-to-list 'auto-mode-alist '("\\.exs\\'" . elixir-mode)))
|
553 | 554 |
|
| 555 | +;;;###autoload |
| 556 | +(mapc |
| 557 | + (cl-function |
| 558 | + (lambda ((symbol . spec)) |
| 559 | + "Add SPEC to `compilation-error-regexp-alist-alist'." |
| 560 | + (setf (alist-get symbol compilation-error-regexp-alist-alist) spec))) |
| 561 | + |
| 562 | + '((elixir-error |
| 563 | + "^== Compilation error in file \\(.*\\) ==$" |
| 564 | + 1 ;; file |
| 565 | + nil ;; no line |
| 566 | + nil ;; no column |
| 567 | + 2 ;; type, 2 for error |
| 568 | + 1 ;; hyperlink; file |
| 569 | + ) |
| 570 | + |
| 571 | + (elixir-trace |
| 572 | + "^ +\\(\\([^:]+\\):\\([0-9]+\\)\\): .*$" |
| 573 | + 2 ;; file |
| 574 | + 3 ;; line |
| 575 | + nil ;; no column |
| 576 | + 0 ;; type, 0 for info |
| 577 | + 1 ;; hyperlink; file & line together |
| 578 | + ) |
| 579 | + |
| 580 | + (elixir-credo-warning |
| 581 | + "^┃ \\[W] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\):\\([0-9]+\\)\\) .*$" |
| 582 | + 2 ;; file |
| 583 | + 3 ;; line |
| 584 | + 4 ;; column |
| 585 | + 1 ;; type, 1 for warning |
| 586 | + 1 ;; hyperlink, file, line and column together |
| 587 | + ) |
| 588 | + |
| 589 | + (elixir-credo-warning-no-column |
| 590 | + "^┃ \\[W] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\)\\) .*$" |
| 591 | + 2 ;; file |
| 592 | + 3 ;; line |
| 593 | + nil ;; no column |
| 594 | + 1 ;; type, 1 for warning |
| 595 | + 1 ;; hyperlink, file and line together |
| 596 | + ) |
| 597 | + |
| 598 | + (elixir-credo-info |
| 599 | + "^┃ \\[[^W]] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\):\\([0-9]+\\)\\) .*$" |
| 600 | + 2 ;; file |
| 601 | + 3 ;; line |
| 602 | + 4 ;; column |
| 603 | + 0 ;; type, 0 for info |
| 604 | + 1 ;; hyperlink, file, line and column together |
| 605 | + ) |
| 606 | + |
| 607 | + (elixir-credo-info-no-column |
| 608 | + "^┃ \\[[^W]] . .*\n┃ +\\(\\([^:]+\\):\\([0-9]+\\)\\) .*$" |
| 609 | + 2 ;; file |
| 610 | + 3 ;; line |
| 611 | + nil ;; no column |
| 612 | + 0 ;; type, 0 for info |
| 613 | + 1 ;; hyperlink, file and line together |
| 614 | + ))) |
| 615 | + |
554 | 616 | (provide 'elixir-mode)
|
555 | 617 |
|
556 | 618 | ;;; elixir-mode.el ends here
|
0 commit comments