doomemacs/modules/tools/make/autoload.el
Henrik Lissner 53fe7a1f04 Refactor Project API to reflect changes upstream
projectile-project-root no longer returns `default-directory` if not in
a project (it returns nil). As such, doom-project-* functions (and their
uses) have been refactored.

+ doom-project-p & doom-project-root are aliases for
  projectile-project-p & projectile-project-root.
+ doom-project-{p,root,name,expand} now has a DIR argument (for
  consistency, since projectile-project-name and
  projectile-project-expand do not).
+ The nocache parameter is no longer necessary, as projectile's caching
  behavior is now more sane.
+ Removed some projectile advice/hacks that are no longer necessary.
+ Updated unit tests
2018-09-28 21:13:27 -04:00

26 lines
919 B
EmacsLisp

;;; tools/make/autoload.el -*- lexical-binding: t; -*-
(require 'makefile-executor)
;;;###autoload
(defun +make/run ()
"Run a make task in the current project. If multiple makefiles are available,
you'll be prompted to select one."
(interactive)
(if (doom-project-p)
(makefile-executor-execute-project-target)
(let ((makefile (cl-loop with buffer-file = (or buffer-file-name default-directory)
for file in (list "Makefile" "makefile")
if (locate-dominating-file buffer-file file)
return file)))
(unless makefile
(user-error "Cannot find a makefile in the current project"))
(let ((default-directory (file-name-directory makefile)))
(makefile-executor-execute-target makefile)))))
;;;###autoload
(defun +make/run-last ()
"TODO"
(interactive)
(makefile-executor-execute-last nil))