From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#45765: [PATCH] 28.0.50; Change default-directory before prompting in project-compile Date: Mon, 11 Jan 2021 20:35:23 +0200 Organization: LINKOV.NET Message-ID: <87ft37bbp0.fsf@mail.linkov.net> References: <87bldx2bmk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33707"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 45765@debbugs.gnu.org To: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 11 20:01:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kz2RX-0008gP-AC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 20:01:31 +0100 Original-Received: from localhost ([::1]:46194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kz2RV-0005aK-Nt for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Jan 2021 14:01:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2R5-0005a4-AO for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:01:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46721) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kz2R4-0006Kw-6Z for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kz2R4-0002Sf-5A for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Jan 2021 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45765 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16103916609442 (code B ref -1); Mon, 11 Jan 2021 19:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Jan 2021 19:01:00 +0000 Original-Received: from localhost ([127.0.0.1]:58266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz2R2-0002S8-Cg for submit@debbugs.gnu.org; Mon, 11 Jan 2021 14:01:00 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kz2R0-0002Rt-1q for submit@debbugs.gnu.org; Mon, 11 Jan 2021 14:00:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46694) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2Qy-0005Zt-3Y for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:00:57 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:42767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kz2Qu-0006Ka-Sv for bug-gnu-emacs@gnu.org; Mon, 11 Jan 2021 14:00:55 -0500 X-Originating-IP: 91.129.98.64 Original-Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 2023AE000C; Mon, 11 Jan 2021 19:00:45 +0000 (UTC) In-Reply-To: <87bldx2bmk.fsf@gmail.com> ("=?UTF-8?Q?K=C3=A9vin?= Le Gouguec"'s message of "Sun, 10 Jan 2021 13:57:07 +0100") Received-SPF: pass client-ip=217.70.183.196; envelope-from=juri@linkov.net; helo=relay4-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197736 Archived-At: > 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. > > I see three ways to achieve this: > > (1) Rewrite project-compile with call-interactively, the way > project-shell-command is written (see patch #1). (1) has the obvious advantage of avoiding duplication of the interactive spec of 'compile' in 'project-compile', in addition to your use case of binding default-directory. > 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. Actually, (1) is not out of the question. Quite contrary, (1) is the cleanest solution. But before rewriting with call-interactively, we need to find a way to use project-compile in the init files, i.e. to find a replacement for such configurations: (define-key my-map "m" ;; mnemonics "make" (lambda () (interactive) (project-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)))