|
1 |
| -;;; flymake-eask.el --- -*- lexical-binding: t; -*- |
| 1 | +;;; flymake-eask.el --- Eask support in Flymake -*- lexical-binding: t; -*- |
2 | 2 |
|
3 | 3 | ;; Copyright (C) 2022 Shen, Jen-Chieh
|
4 | 4 |
|
5 | 5 | ;; Author: Shen, Jen-Chieh <[email protected]>
|
6 | 6 | ;; Maintainer: Shen, Jen-Chieh <[email protected]>
|
7 | 7 | ;; URL: https://github.com/emacs-eask/flymake-eask
|
8 | 8 | ;; Version: 0.1.0
|
9 |
| -;; Package-Requires: ((emacs "26.1")) |
10 |
| -;; Keywords: |
| 9 | +;; Package-Requires: ((emacs "26.1") (flymake-easy "0.1")) |
| 10 | +;; Keywords: lisp eask |
11 | 11 |
|
12 | 12 | ;; This file is not part of GNU Emacs.
|
13 | 13 |
|
|
26 | 26 |
|
27 | 27 | ;;; Commentary:
|
28 | 28 | ;;
|
29 |
| -;; |
| 29 | +;; Eask support in Flymake. |
30 | 30 | ;;
|
31 | 31 |
|
32 | 32 | ;;; Code:
|
33 | 33 |
|
| 34 | +(require 'flymake) |
| 35 | + |
| 36 | +(require 'flymake-easy) |
| 37 | + |
| 38 | +(defgroup flymake-eask nil |
| 39 | + "Eask support for Flymake." |
| 40 | + :prefix "flymake-eask-" |
| 41 | + :group 'flymake |
| 42 | + :link '(url-link :tag "Github" "https://github.com/emacs-eask/flymake-eask")) |
| 43 | + |
| 44 | +(defconst flymake-eask-err-line-patterns |
| 45 | + '(("^\\(.*\\):\\([0-9]+\\):\\([0-9]+\\): \\(Error\\|Warning\\): \\(.*\\)$" 1 2 3 5))) |
| 46 | + |
| 47 | +(defun flymake-eask-command (filename) |
| 48 | + "Construct a command that flymake can use to check Eask source." |
| 49 | + (list "eask" "check-eask" filename)) |
| 50 | + |
| 51 | +;;;###autoload |
| 52 | +(defun flymake-eask-load () |
| 53 | + "Configure flymake mode to check the current buffer's Eask syntax. |
34 | 54 |
|
| 55 | +This function is designed to be called in `eask-mode-hook'; it does not alter |
| 56 | +flymake's global configuration, so function `flymake-mode' alone will not |
| 57 | +suffice." |
| 58 | + (interactive) |
| 59 | + (when (eq 'eask-mode major-mode) |
| 60 | + (flymake-easy-load 'flymake-eask-command |
| 61 | + flymake-eask-err-line-patterns |
| 62 | + 'tempdir |
| 63 | + "eask"))) |
35 | 64 |
|
36 | 65 | (provide 'flymake-eask)
|
37 | 66 | ;;; flymake-eask.el ends here
|
0 commit comments