|
| 1 | +;;; eask-api-util.el --- Eask API -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +;; Copyright (C) 2022 Shen, Jen-Chieh |
| 4 | + |
| 5 | +;; This file is not part of GNU Emacs. |
| 6 | + |
| 7 | +;; This program is free software: you can redistribute it and/or modify |
| 8 | +;; it under the terms of the GNU General Public License as published by |
| 9 | +;; the Free Software Foundation, either version 3 of the License, or |
| 10 | +;; (at your option) any later version. |
| 11 | + |
| 12 | +;; This program is distributed in the hope that it will be useful, |
| 13 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +;; GNU General Public License for more details. |
| 16 | + |
| 17 | +;; You should have received a copy of the GNU General Public License |
| 18 | +;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + |
| 20 | +;;; Commentary: |
| 21 | +;; |
| 22 | +;; Utility functions |
| 23 | +;; |
| 24 | + |
| 25 | +;;; Code: |
| 26 | + |
| 27 | +(require 'subr-x) |
| 28 | + |
| 29 | +;;; Externals |
| 30 | + |
| 31 | +(declare-function project-root "project" (project)) |
| 32 | + |
| 33 | +;;; Core |
| 34 | + |
| 35 | +;;;###autoload |
| 36 | +(defun eask-api-setup () |
| 37 | + "Set up for `eask-api'." |
| 38 | + (when-let* ((root (if (fboundp #'project-root) |
| 39 | + (ignore-errors (project-root (project-current))) |
| 40 | + (cdr (project-current)))) |
| 41 | + (file-eask (concat root "Easkfile")) ; just Eask is not allowed |
| 42 | + ((file-exists-p file-eask))) |
| 43 | + (require 'eask-api))) |
| 44 | + |
| 45 | +(provide 'eask-api-util) |
| 46 | +;;; eask-api.el ends here |
0 commit comments