-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfuthark-fmt.el
45 lines (32 loc) · 1.18 KB
/
futhark-fmt.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;;; futhark-fmt.el --- Format SML source code using the "futhark fmt" program -*- lexical-binding: t -*-
;; Copyright (C) DIKU 2013-2019, University of Copenhagen
;; This file is not part of GNU Emacs.
;;; License:
;; ICS <https://github.com/diku-dk/futhark-mode/blob/master/LICENSE>
;;; Commentary:
;; See futhark-mode.el.
;;; Code:
(require 'reformatter)
(defgroup futhark-fmt nil
"Integration with the \"futhark fmt\" formatting program."
:prefix "futhark-fmt-"
:group 'sml)
(defcustom futhark-fmt-extra-args '()
"Extra arguments to give to \"futhark fmt\"."
:group 'futhark-fmt
:type 'sexp
:safe #'listp)
(defvar futhark-fmt-mode-map (make-sparse-keymap)
"Local keymap used for `futhark-fmt-on-save-mode`.")
;;;###autoload (autoload 'futhark-fmt-buffer "futhark-fmt" nil t)
;;;###autoload (autoload 'futhark-fmt-region "futhark-fmt" nil t)
;;;###autoload (autoload 'futhark-fmt-on-save-mode "futhark-fmt" nil t)
(reformatter-define futhark-fmt
:program "futhark"
:args (cons "fmt" futhark-fmt-extra-args)
:group 'futhark-fmt
:lighter " Fmt"
:keymap futhark-fmt-mode-map)
(defalias 'futhark-fmt 'futhark-fmt-buffer)
(provide 'futhark-fmt)
;;; futhark-fmt.el ends here