emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Project.el - running processes in root


From: Dmitry Gutov
Subject: Re: Project.el - running processes in root
Date: Fri, 5 Jun 2020 01:07:40 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hello!

On 05.06.2020 00:53, Theodor Thornhill wrote:

What is the best way to run a subprocess in root of a project currently?

Right now I've made a small convenience macro for this:

(defmacro with-project-root (&rest body)
   "Dynamically bind default directory to project root."
   (declare (debug t) (indent 0))
   `(let ((default-directory (project-root (project-current))))
      ,@body))


Then I can:

(defun elm-repl ()
   "Create a new buffer with Elm repl started and switch to it."
   (interactive)
   (with-project-root
     (switch-to-buffer-other-window
      (make-comint "Elm Repl" "elm" nil "repl"))))

It's as good a solution as any.

Otherwise, would this be something appropriate for
project.el to expose?

I'm not sure... It doesn't even save one line. Just shortens it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]