|
From: | Juri Linkov |
Subject: | bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in project-compile |
Date: | Tue, 12 Jan 2021 20:46:51 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
> Something like this maybe? > > +(defun project-compile (command &optional comint interactive) > +COMMAND and COMINT work as with `compile'. When calling this > +function from Lisp, you can pretend that it was called > +interactively by passing a non-nil INTERACTIVE argument." > + (interactive (list nil nil t)) > + (let ((default-directory (project-root (project-current t)))) > + (if interactive > + (call-interactively #'compile) > + (compile command comint)))) > > (Apologies if I misunderstood what Juri asked, or if my suggestion is > buggy) Perfect, thank you for finding the middle ground for different needs.
[Prev in Thread] | Current Thread | [Next in Thread] |