From 35bdf63045bb210b232a3e86434c11fe050c4ca7 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 10 Mar 2023 08:51:43 -0500 Subject: [PATCH] Update run-command config to latest version --- emacs/.emacs.d/config/init-run-command.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/emacs/.emacs.d/config/init-run-command.el b/emacs/.emacs.d/config/init-run-command.el index a8b6b1d..df8a506 100644 --- a/emacs/.emacs.d/config/init-run-command.el +++ b/emacs/.emacs.d/config/init-run-command.el @@ -2,19 +2,12 @@ ;; A handy package for running external commands (use-package run-command - :straight (run-command :host github :repo "bard/emacs-run-command" - :fork (:host github :repo "jdormit/emacs-run-command" :branch "master")) :init (defvar-local run-command-local-commands nil) (put 'run-command-local-commands 'safe-local-variable (lambda (_) t)) (defvar-local run-command-project-local-commands nil) (put 'run-command-project-local-commands 'safe-local-variable (lambda (_) t)) :config - (general-def run-command-term-minor-mode-map - [remap recompile] #'run-command-term-recompile - "g" nil) - (general-def 'normal run-command-term-minor-mode-map "gr" #'run-command-term-recompile) - (defun run-command-recipe-terraform () (when (directory-files default-directory nil @@ -335,8 +328,9 @@ (defun get-script-run-command (file) (with-temp-buffer (insert-file-contents-literally file) - (when-let* ((line (s-trim (thing-at-point 'line t)))) - (cadr (s-match (rx "#!" (group (1+ anychar))) line))))) + (when-let* ((line (thing-at-point 'line t)) + (line-trimmed (s-trim line))) + (cadr (s-match (rx "#!" (group (1+ anychar))) line-trimmed))))) (defun run-command-recipe-scripts () (let* ((root-dir (expand-file-name (or (projectile-project-root) default-directory))) @@ -363,7 +357,8 @@ :general (leader-map "\"" #'run-command) :custom - (run-command-run-method 'async-shell) + (run-command-default-runner 'run-command-runner-compile) + (run-command-completion-method 'completing-read) (run-command-recipes '(run-command-recipe-terraform run-command-recipe-local run-command-recipe-package-json