|
From: | Juri Linkov |
Subject: | bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in project-compile |
Date: | Wed, 13 Jan 2021 20:05:20 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
> So you're not worried about compilation-read-command in your code being > called in the wrong directory (exhibiting what the current bug report aims > to fix)? > > I think you might as well inline the definition, it's almost as short: > > (define-key my-map "m" ;; mnemonics "make" > (lambda () > (interactive) > (let ((default-directory (project-root (project-current t)))) > (compile > ;; Use previous command from history > ;; instead of the default from compile-command > (compilation-read-command (car compile-history)) > ;; Don't use compilation-shell-minor-mode > nil)))) Indeed, this means that let-binding default-directory to (project-root (project-current t))) is unavoidable in the init file. So it's easier to just replace 'project-compile' with 'compile'. This means Kévin's first patch is the way to go.
[Prev in Thread] | Current Thread | [Next in Thread] |