bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in


From: Dmitry Gutov
Subject: bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in project-compile
Date: Mon, 11 Jan 2021 02:47:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi Kevin,

On 10.01.2021 14:57, Kévin Le Gouguec wrote:

Unlike project-shell-command, project-compile first prompts for a
command, then binds default-directory and calls compile.  Binding
default-directory first makes completion work from the project root,
which is useful for completing on filenames relative to the root, on
targets from the toplevel Makefile, etc.

Thanks for the report.

I see three ways to achieve this:

(1) Rewrite project-compile with call-interactively, the way
project-shell-command is written (see patch #1).

(2) Set COMMAND to nil in the interactive spec, then prompt for it after
binding default-directory (see patch #2).

(3) Let-binding default-directory once in the interactive spec, and
again before calling compile.
I'm assuming (1) is out of the question, given 2020-06-02
"* lisp/progmodes/project.el (project-vc-dir, project-shell): New
commands." (2c1e5b9e77).  I'm CC'ing Juri to get his opinion though;
project-compile is new in Emacs 28.1, so its argument list is not yet
set in stone.

I see no strong reason to avoid (1), this new command has never seen an Emacs release, so we're not bound by compatibility promise yet.

Further, any code that would be calling project-compile in a program should inline its definition instead, in most of the cases.

Let's see what people think, of course.





reply via email to

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