From 4718aba6edee852dee72f0561223ab400ae23820 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Mon, 9 Jan 2023 19:54:14 -0800 Subject: [PATCH] Fix bug for having my compile commands go to eshell Now that EAT can handle the weird `docker` and `ansible-playbook` commands that I do. --- ha-programming.org | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ha-programming.org b/ha-programming.org index 50286a0..f4a33cd 100644 --- a/ha-programming.org +++ b/ha-programming.org @@ -481,9 +481,15 @@ And what about sending the command to Eshell as well? #+begin_src emacs-lisp (defvar rx-compile-to-eshell (rx "|" (0+ space) "s" (0+ space) line-end)) - (defun ha-compile-eshell (full-command) + (defun ha-compile-eshell (full-command &optional project-dir) + "Send a command to the currently running Eshell terminal. + If a terminal isn't running, it will be started, allowing follow-up + commands." + (unless project-dir + (setq project-dir (projectile-project-name))) + (let ((command (replace-regexp-in-string rx-compile-to-eshell "" full-command))) - (ha-shell-send command project-dir))) + (ha-eshell-send command project-dir))) #+end_src And let’s add it to the Project leader: #+begin_src emacs-lisp