-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
esy-core.el
57 lines (44 loc) · 1.94 KB
/
esy-core.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
46
47
48
49
50
51
52
53
54
55
56
57
;;; esy-core --- core library for minor mode and esy.el. -*- lexical-binding: t; -*-
;; Copyright (C) 2020 Manas Jayanth
;; Author: Manas Jayanth <[email protected]>
;; Created: 19 November 2024
;; Keywords: Reason, OCaml
;; Package-Requires: ((emacs "25.1"))
;; Homepage: http://example.com/foo
;;; Commentary:
;;; Change Log: TODO
;;; Code:
;; macros
(defmacro esy/macro--with-esy-project (buffer binding-project exp)
`(let ((project (esy/project--of-buffer ,buffer)))
(if (esy/project--p project)
(let ((,binding-project project)) ,exp)
(message "Doesn't look like an esy project. esy-mode will stay dormant"))))
(defmacro let-esy-project (binding exp)
`(let ((,(car binding) ,(cadr binding)))
(if (esy/project--p ,(car binding))
,exp
(message "Doesn't look like an esy project. esy-mode will stay dormant"))))
;;;;;;;;;;;;;;;;;;; esy/status--* defuns ;;;;;;;;;;;;;;;;;;;;;;;
(defun esy/status--get-manifest-file-path (esy-status)
"Given the json object of \'esy status\' output,
it returns the manifest file"
(gethash "rootPackageConfigPath" esy-status))
(defun esy/status--dependencies-installed-p (esy-status)
"Given the json object of \'esy status\' output,
it returns if dependencies have been installed."
(gethash "isProjectFetched" esy-status))
(defun esy/status--dependency-constraints-solved-p (esy-status)
"Given the json object of \'esy status\' output,
it returns if dependencies have been installed."
(gethash "isProjectSolved" esy-status))
(defun esy/status--ready-for-dev-p (esy-status)
"Given the json object of \'esy status\' output,
it returns if dependencies have been installed."
(gethash "isProjectReadyForDev" esy-status))
(defun esy/status--project-p (esy-status)
"Given the json object of \'esy status\' output,
it returns if dependencies have been installed."
(gethash "isProject" esy-status))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide 'esy-core)