unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>, 45765@debbugs.gnu.org
Cc: Juri Linkov <juri@linkov.net>
Subject: bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in project-compile
Date: Mon, 11 Jan 2021 02:47:24 +0200	[thread overview]
Message-ID: <03e46cb4-b81c-f369-b932-958f5707981a@yandex.ru> (raw)
In-Reply-To: <87bldx2bmk.fsf@gmail.com>

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	other threads:[~2021-01-11  0:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-10 12:57 bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in project-compile Kévin Le Gouguec
2021-01-11  0:47 ` Dmitry Gutov [this message]
2021-01-11 18:35 ` Juri Linkov
2021-01-11 19:13   ` Dmitry Gutov
2021-01-11 21:24     ` Kévin Le Gouguec
2021-01-12 18:46       ` Juri Linkov
2021-01-13  1:06         ` Dmitry Gutov
2021-01-13 18:05           ` Juri Linkov
2021-01-13 19:46           ` Kévin Le Gouguec
2021-01-16  3:51             ` Dmitry Gutov
2021-01-19 17:38               ` Juri Linkov
2021-01-19 19:50                 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03e46cb4-b81c-f369-b932-958f5707981a@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=45765@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=kevin.legouguec@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).