feat(makefile): improve makefile execution and bind it to C-c C-m

Use the makefile-executor package instead of helm-make to execute make
targets. But we still rely on helm-make due to it's more efficient
available targets lookup function compared to that of makefile-executor.

Running make targets is bound to C-c C-m now which is nice and fast, and
completes via completing-read, which is currently giving a better
suggested candidates via selectrum+orderless than helm-make does.

And helm-make is still available via the old C-c h m keybinding.
This commit is contained in:
2021-09-13 12:38:34 +01:00
parent 784a29585a
commit 4cb9c3d3a0
5 changed files with 31 additions and 10 deletions

View File

@@ -147,6 +147,7 @@
(require 'siren-helm-make)
(require 'siren-httprepl)
(require 'siren-kubernetes)
(require 'siren-makefile-executor)
(require 'siren-restclient)
;; XWidgets

View File

@@ -7,12 +7,17 @@
;;; Code:
(require 'siren-display-indentation)
(require 'siren-makefile-executor)
(use-package make-mode
:straight (:type built-in)
:hook
(makefile-mode . siren-makefile-mode-setup)
:bind
(:map makefile-mode-map
("C-c C-m" . makefile-executor-execute-project-target))
:init
(add-to-list 'siren-indent-sensitive-modes 'makefile-mode)

View File

@@ -112,16 +112,6 @@
(advice-add 'helm :before 'siren-helm--hide-neotree)
(advice-add 'helm :before 'siren-helm--hide-treemacs))
(use-package helm-command
:straight helm
:after (helm-global-bindings)
:bind
("C-c C-m" . helm-M-x)
:custom
(helm-M-x-always-save-history t)
(helm-M-x-fuzzy-match t))
(use-package helm-elisp
:straight helm
:after (helm-global-bindings)

View File

@@ -0,0 +1,24 @@
;;; siren-makefile-executor.el --- jimeh's Emacs Siren: makefile-executor configuration.
;;; Commentary:
;; Basic configuration for makefile-executor.
;;; Code:
(require 'helm-make)
(use-package makefile-executor
:hook
(makefile-mode . makefile-executor-mode)
:bind
("C-c C-m" . makefile-executor-execute-project-target)
:config
;; Replace get targets function with that from helm-make as it faster and more
;; efficient by not needing to write any temporary files to disk.
(defalias 'makefile-executor-get-targets 'helm--make-target-list-qp))
(provide 'siren-makefile-executor)
;;; siren-makefile-executor.el ends here

View File

@@ -117,6 +117,7 @@
("marginalia" . "db5812c8750f729627a927aa1d0dd9178ffc2b58")
("markdown-mode" . "f28e263b915d48ee9757990da1cdd160b355cb8c")
("melpa" . "2571aed58ce9c4df998588cbcffdde704f4dce54")
("makefile-executor.el" . "d0a34c355fb80a8616ae7ed5eebbda8507aa14ac")
("mermaid-mode" . "562ffe86cad91627e2b94b8684818562c3ad2b5d")
("minions" . "1be68e8571336672d6cbec86246d1bf7844976be")
("mmm-mode" . "0d00cdf4d02cc166304f6967a20fa22e2eaf208b")