forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promote a subset of the files + emacs integration (ocaml#1192)
- add support for promoting a selected list of files - add an emacs mode with helpers for promoting the correction for the current buffer Signed-off-by: Jeremie Dimino <[email protected]>
- Loading branch information
1 parent
d8e474c
commit 5cad714
Showing
7 changed files
with
154 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
;;; dune.el --- Align words in an intelligent way | ||
|
||
;; Copyright 2018 Jane Street Group, LLC <[email protected]> | ||
;; URL: https://github.com/ocaml/dune | ||
;; Version: 1.0 | ||
|
||
;;; Commentary: | ||
|
||
;; This package provides helper functions for interacting with the | ||
;; dune build system from emacs. | ||
|
||
;; Installation: | ||
;; You need to install the OCaml program ``dune''. The | ||
;; easiest way to do so is to install the opam package manager: | ||
;; | ||
;; https://opam.ocaml.org/doc/Install.html | ||
;; | ||
;; and then run "opam install dune". | ||
|
||
;;; Code: | ||
|
||
(defgroup dune nil | ||
"Integration with the dune build system." | ||
:tag "Dune build system." | ||
:version "1.0" | ||
:group 'align) | ||
|
||
(defcustom dune-command "dune" | ||
"The dune command." | ||
:type 'string | ||
:group 'dune) | ||
|
||
;;;###autoload | ||
(defun dune-promote () | ||
"Promote the correction for the current file." | ||
(interactive) | ||
(if (buffer-modified-p) | ||
(error "Cannot promote as buffer is modified.") | ||
(shell-command | ||
(format "%s promote %s" | ||
dune-command | ||
(file-name-nondirectory (buffer-file-name)))) | ||
(revert-buffer nil t))) | ||
|
||
;;;###autoload | ||
(defun dune-runtest-and-promote () | ||
"Run tests in the current directory and promote the current buffer." | ||
(interactive) | ||
(compile (format "%s build @@runtest" dune-command)) | ||
(dune-promote)) | ||
|
||
(provide 'dune) | ||
|
||
;;; dune.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters