GNU bug report logs - #45765
[PATCH] 28.0.50; Change default-directory before prompting in project-compile

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Kévin Le Gouguec <kevin.legouguec@HIDDEN>; Keywords: patch; Done: Dmitry Gutov <dgutov@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 19 Jan 2021 17:58:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 19 12:58:52 2021
Received: from localhost ([127.0.0.1]:51577 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l1vHH-0002Us-Sv
	for submit <at> debbugs.gnu.org; Tue, 19 Jan 2021 12:58:52 -0500
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53597)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1l1vHF-0002Uc-Le
 for 45765 <at> debbugs.gnu.org; Tue, 19 Jan 2021 12:58:50 -0500
X-Originating-IP: 91.129.98.64
Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64])
 (Authenticated sender: juri@HIDDEN)
 by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id A96DF40004;
 Tue, 19 Jan 2021 17:58:41 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
Organization: LINKOV.NET
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN>
 <87zh1fyxo0.fsf@HIDDEN> <87lfcywhyc.fsf@HIDDEN>
 <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN>
 <8735z4tyb4.fsf@HIDDEN>
 <5ad49c92-6a29-ff7f-6b2a-2c3e5505334d@HIDDEN>
Date: Tue, 19 Jan 2021 19:38:24 +0200
In-Reply-To: <5ad49c92-6a29-ff7f-6b2a-2c3e5505334d@HIDDEN> (Dmitry Gutov's
 message of "Sat, 16 Jan 2021 05:51:47 +0200")
Message-ID: <875z3tgqjj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org,
 =?iso-8859-1?Q?K=E9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> PS: I've just seen Juri's reponse in bug#45765#26; I'm glad there is a
>> consensus on the first patch, because after looking at more in-tree
>> examples of optional INTERACTIVE arguments, I found myself agonizing
>> over spelling the spec (list nil nil t), '(nil nil t), or "i\ni\np".
>
> I know the feeling ;-)
>
> Patch installed, closing. Thanks again.

Thanks for installing the patch.  I noticed that the similar command
project-execute-extended-command has such line:

  (declare (interactive-only command-execute))

Should other interactive-only project commands like project-compile
and project(-async)-shell-command have the same?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765-done <at> debbugs.gnu.org:


Received: (at 45765-done) by debbugs.gnu.org; 16 Jan 2021 03:51:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 15 22:51:59 2021
Received: from localhost ([127.0.0.1]:42215 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1l0cd5-0001Xz-AX
	for submit <at> debbugs.gnu.org; Fri, 15 Jan 2021 22:51:59 -0500
Received: from mail-ed1-f53.google.com ([209.85.208.53]:36707)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1l0cd3-0001Xn-Aj
 for 45765-done <at> debbugs.gnu.org; Fri, 15 Jan 2021 22:51:58 -0500
Received: by mail-ed1-f53.google.com with SMTP id b2so11756801edm.3
 for <45765-done <at> debbugs.gnu.org>; Fri, 15 Jan 2021 19:51:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=6zjUPykM+gw7pzlw/1sbOYudWnX8aa6ZuNxWkGVmr3o=;
 b=LLHQ1XuXQbAiUq+ve6x4ZeRWUgO1CXrcdxxXpm1dQbkTQosdBabjYawiXHFO4P0Je5
 9WYzJppktA9WG2bl+jTHp4hMSPgoq9vVvTJ5K2SRIk2/x/l2tlBgMkeRH4pfTjb5t2WR
 K0R7XYny0qRU9i9sCXTjnjAnRLZgX2dxpmcGrjdeXJhNHiyQPkXcQW7BQ8g7iNKAop5V
 9tftU041PfQvl3pvu3oUNnwCIdMv+ZdjcLN3y0d8wzpAf4esteR+xjyZ+kVVE6Qqs75p
 /kSVv0ygFRt+Np/sQ9kZdQQnrfTO1XPu/6Mt4dFhjUk4ZYfeLDqjDtJwvyM2EeqOIIym
 XcLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=6zjUPykM+gw7pzlw/1sbOYudWnX8aa6ZuNxWkGVmr3o=;
 b=C7xqa/nrL/GVUvT3/DQYPQ1fOPsOUtq0/SQPS1syc7RYWUzg14/2d0iKERzZszlxFy
 oc9B4dMHh1vId4mwA151whYMXCTxVID4IpZ5AHi1yGepAkur9goV6P4vRtxw5iaYkvwn
 nQZu12pF6iuU38VNZoqDfeT0MDQDqPF+snvEb0ZeEN7GMsP6WQsf7MCwNkaOeko4d4hW
 0Lyq8Sd9b24URgkSSZR5UnL8zKsEfwLZiYraju6RwYdCH07l7bkFYA+GR6MVX7YIjm7h
 d81M6qNu74z9jGYemAq53e1vvozOouVM0Nr8ca1am/FcI/uUdvcYr+b5jfyarYogv6EQ
 b9Qg==
X-Gm-Message-State: AOAM532lD567DuB1XsuXiKV+8Kd1Y5plo3zxKJThKVJAf4lWypK7hnsV
 Njh0lnHxxPtlu8SrGJa7DNg=
X-Google-Smtp-Source: ABdhPJz2vkT6HHm/d89yHA5tlh3/Qol57tPEF/tx1hlm0k2mIjkIN/5TeIIsq7YsnwPaiNiv62LDKQ==
X-Received: by 2002:aa7:db85:: with SMTP id u5mr4863766edt.107.1610769111539; 
 Fri, 15 Jan 2021 19:51:51 -0800 (PST)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id k6sm5259482ejb.84.2021.01.15.19.51.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 15 Jan 2021 19:51:50 -0800 (PST)
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
To: =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN> <87zh1fyxo0.fsf@HIDDEN>
 <87lfcywhyc.fsf@HIDDEN>
 <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN> <8735z4tyb4.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <5ad49c92-6a29-ff7f-6b2a-2c3e5505334d@HIDDEN>
Date: Sat, 16 Jan 2021 05:51:47 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <8735z4tyb4.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 45765-done
Cc: 45765-done <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 13.01.2021 21:46, Kévin Le Gouguec wrote:
> Dmitry Gutov <dgutov@HIDDEN> writes:
> 
>> I'm not a big fan of the 'interactive' argument. It could be replaced
>> by using (called-interactively-p 'interactive), though I'm not sure
>> how idiomatic that is.
> 
> Not necessarily a fan either, but my takeaway from recent discussions on
> emacs-devel is that the argument is preferred to called-interactively-p,
> which should only be used when a function's arglist is set in stone.
> 
> <E1k7A3J-0005gG-4K@HIDDEN>
> https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00463.html
> 
> <jwvzh6ubtbe.fsf-monnier+emacs@HIDDEN>
> https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00472.html
> 
> I see a few dozen hits for "&optional \([\w-]+ \)*interactive)" under
> lisp/, so it seems to be an established practice.

All right, that makes sense. It will help the next time such question 
comes up.

> PS: I've just seen Juri's reponse in bug#45765#26; I'm glad there is a
> consensus on the first patch, because after looking at more in-tree
> examples of optional INTERACTIVE arguments, I found myself agonizing
> over spelling the spec (list nil nil t), '(nil nil t), or "i\ni\np".

I know the feeling ;-)

Patch installed, closing. Thanks again.




Notification sent to Kévin Le Gouguec <kevin.legouguec@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Dmitry Gutov <dgutov@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 13 Jan 2021 19:46:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 13 14:46:33 2021
Received: from localhost ([127.0.0.1]:36635 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kzm6D-00038q-Ez
	for submit <at> debbugs.gnu.org; Wed, 13 Jan 2021 14:46:33 -0500
Received: from mail-wr1-f44.google.com ([209.85.221.44]:37998)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1kzm6B-00038a-AB
 for 45765 <at> debbugs.gnu.org; Wed, 13 Jan 2021 14:46:31 -0500
Received: by mail-wr1-f44.google.com with SMTP id r7so3392664wrc.5
 for <45765 <at> debbugs.gnu.org>; Wed, 13 Jan 2021 11:46:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=hvOoitv95jqeVMYGPAF9faTWOEpGrlTvBTRn4OXIAno=;
 b=rf0PnFLc4ShEZIzzwkvoI2q8QW19pY018wehEEf96lH49OTIBfiAIcLK0Q0OuCXdrx
 66RvN0FS3VvBTNBvT1l9PdbsauJNypvRbfDL3fOxZf7sDBjk+0lXyLuyKToPuNgjU6Tt
 XeXRDDxqZbJRCm9uRx0swT9+RRwmO3Lfi8DKo2NQ0fA3nlAmuuHk8vAdNNOpRDGELZi6
 CA+1Gx2nzASWsq501qmEyEXqmRJemXmIF++Z2uz4Br7/ulp0InIT4jA2CWVxuuf8tX24
 Pgq6y3UQFouvHnQd1i0ecW4tVl/qJrCH5l52a+Uhu/xNRvkDLcg23SS7iXik6v/+WR6Y
 hHdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=hvOoitv95jqeVMYGPAF9faTWOEpGrlTvBTRn4OXIAno=;
 b=VZnhiL8D+3omLpGlu/TlQ3sDpxq/jDwuKlXZlrdFbo2Ab/oaOo6206h9hHknM+LDdh
 hp43yRJJz9pfTF7HbL+M6zVk9beB1HgEiS6K3cudoeXDvqWyQEdyaEvruizhHm7NGIKb
 mvc9nxqbaOBXnfPV9L5Dvl8lxnbkU3s4vj3713Q+GujrgrIBUKJcLm5ZUYcJr+HL9IIe
 URZSdQ24vBYeazh1rTVMLdiOAR+XJmusoJwPFW5vdNe4hlMmgZD9Xqp8cgxE3gnHT1O4
 29VcyWP0HqHKm5ZW1dRSvmcBkw97QtViliyayGAksQKSMWRxvYKivIZwrwG76/7/3mko
 uC6Q==
X-Gm-Message-State: AOAM5307XzIoOpbTT8SMyJ1Ov+l0MYasCZjKmjHO+zHccT2fJvsKHC80
 o1avqLIc3S/AQzVJogByRbq4xNTCIS/EPw==
X-Google-Smtp-Source: ABdhPJxuIsLPY/whcWGfTc+PxBzcIj3ND55InzparmcowxrhCPF4IAfBOtbsfr0lDnaGm8yNydDFNw==
X-Received: by 2002:adf:e54a:: with SMTP id z10mr4278944wrm.1.1610567185269;
 Wed, 13 Jan 2021 11:46:25 -0800 (PST)
Received: from my-little-tumbleweed ([2a01:e0a:20e:d340:922b:34ff:fe95:9aed])
 by smtp.gmail.com with ESMTPSA id
 z63sm4551113wme.8.2021.01.13.11.46.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 13 Jan 2021 11:46:24 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN>
 <87zh1fyxo0.fsf@HIDDEN> <87lfcywhyc.fsf@HIDDEN>
 <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN>
Date: Wed, 13 Jan 2021 20:46:23 +0100
In-Reply-To: <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN> (Dmitry Gutov's
 message of "Wed, 13 Jan 2021 03:06:37 +0200")
Message-ID: <8735z4tyb4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> I'm not a big fan of the 'interactive' argument. It could be replaced
> by using (called-interactively-p 'interactive), though I'm not sure
> how idiomatic that is.

Not necessarily a fan either, but my takeaway from recent discussions on
emacs-devel is that the argument is preferred to called-interactively-p,
which should only be used when a function's arglist is set in stone.

<E1k7A3J-0005gG-4K@HIDDEN>
https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00463.html

<jwvzh6ubtbe.fsf-monnier+emacs@HIDDEN>
https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00472.html

I see a few dozen hits for "&optional \([\w-]+ \)*interactive)" under
lisp/, so it seems to be an established practice.

PS: I've just seen Juri's reponse in bug#45765#26; I'm glad there is a
consensus on the first patch, because after looking at more in-tree
examples of optional INTERACTIVE arguments, I found myself agonizing
over spelling the spec (list nil nil t), '(nil nil t), or "i\ni\np".




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 13 Jan 2021 18:08:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 13 13:08:26 2021
Received: from localhost ([127.0.0.1]:36549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kzkZF-0000XC-U2
	for submit <at> debbugs.gnu.org; Wed, 13 Jan 2021 13:08:26 -0500
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:58241)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kzkZE-0000Wl-7J
 for 45765 <at> debbugs.gnu.org; Wed, 13 Jan 2021 13:08:25 -0500
X-Originating-IP: 91.129.98.64
Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64])
 (Authenticated sender: juri@HIDDEN)
 by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C89891BF213;
 Wed, 13 Jan 2021 18:08:16 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
Organization: LINKOV.NET
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN>
 <87zh1fyxo0.fsf@HIDDEN> <87lfcywhyc.fsf@HIDDEN>
 <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN>
Date: Wed, 13 Jan 2021 20:05:20 +0200
In-Reply-To: <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN> (Dmitry Gutov's
 message of "Wed, 13 Jan 2021 03:06:37 +0200")
Message-ID: <871repko0f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org,
 =?iso-8859-1?Q?K=E9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> 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 Kvin's first patch is the way to go.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 13 Jan 2021 01:06:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 12 20:06:49 2021
Received: from localhost ([127.0.0.1]:33785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kzUcb-0007bu-GC
	for submit <at> debbugs.gnu.org; Tue, 12 Jan 2021 20:06:49 -0500
Received: from mail-ed1-f43.google.com ([209.85.208.43]:45889)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kzUcZ-0007bc-Bs
 for 45765 <at> debbugs.gnu.org; Tue, 12 Jan 2021 20:06:48 -0500
Received: by mail-ed1-f43.google.com with SMTP id r5so78010eda.12
 for <45765 <at> debbugs.gnu.org>; Tue, 12 Jan 2021 17:06:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=VrJONZx7ilfb/XZpm3C+2h+paz66vjTR/X6fcIhLW0g=;
 b=Q3oJhNhCRgbygbuAC4go9Kf2Qf/oDBrrEqSS+ubRxEIXEMlZzLV+uytyb+kiTZyKlZ
 PQ0nB/ggZF3nXsTc056K4CYIUvqvOTPygpkDHhYavGRf+u1wM0GOl1njiWMxa8FYrxM7
 jwz0wVT7DYnPqK6gBjQnhrhgsHKupu3gCUqzsLLQ9sVjy53YKUc0ze6u4pBc6Z34xkTn
 3TIUH3R/FiCmQK+7xIZ6/ZAeVK5pG9QGlzui1fitYHT9dmbn3n6lYzbZI4+PxloR/fAS
 jcbfyZ87PNmPLNkc7V9L72GQZRXAVYPFLmtc7WI2kZrsEJJaZCJrSTWOYfLxrNk0N0MF
 Fm+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=VrJONZx7ilfb/XZpm3C+2h+paz66vjTR/X6fcIhLW0g=;
 b=bbM5bqPR4kQzr97kO2mOLQFM2TblwsC8FQAGnICt2eD7S24TRI+aO1dQHnwwVCd7D/
 RSkmpAe8ksb1iktmWMEinQy+n1CMdmPBhA1OepZimVfPJTXGhAZo/9QvbuTkbrbcf9q/
 WMh5Tyrfd4ZSo7S8skuECrZLpkpbslkQHbTTmN1xhYK2M/x4tRV9qaEbRcv/eTczWTEu
 6L5zVVYHKhFeBkZSuSwRoV/n+WpJGSCIpwXvhCeVGtz0+Y89TWcviHc5BJtxEgIjiLGL
 2CWenCL8yxrM7VEwo14rXkzwmXtEhw+r96oQQmXDnGELudtHD5cvFAeHgnk8P/lY+Fiw
 bFmA==
X-Gm-Message-State: AOAM533knEb6pl9fDwSNWwghB7+VPYaLUuNkSdxMyWYdt7JX4ypDQ4TV
 lkQE0hI5Ks6rShM3HL0XYsDfOSNdeAfNNg==
X-Google-Smtp-Source: ABdhPJzHoFeLBspoLwrwoP2KJ1tcn8xFv9zf6FHirT0G7awBg9k6D+YODhTWG3eIbtUSdGmbPST3PQ==
X-Received: by 2002:a50:fc0d:: with SMTP id i13mr1403319edr.171.1610500001215; 
 Tue, 12 Jan 2021 17:06:41 -0800 (PST)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id f17sm147237edv.5.2021.01.12.17.06.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 12 Jan 2021 17:06:40 -0800 (PST)
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
To: Juri Linkov <juri@HIDDEN>,
 =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN> <87zh1fyxo0.fsf@HIDDEN>
 <87lfcywhyc.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <6e5456e4-a5ac-3e54-2ced-0116a6e7a9dc@HIDDEN>
Date: Wed, 13 Jan 2021 03:06:37 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <87lfcywhyc.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Hi Juri,

On 12.01.2021 20:46, Juri Linkov wrote:
>> 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.

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))))

But if you really like the new version of project-compile, OK.

I'm not a big fan of the 'interactive' argument. It could be replaced by 
using (called-interactively-p 'interactive), though I'm not sure how 
idiomatic that is.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 12 Jan 2021 18:51:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 12 13:51:18 2021
Received: from localhost ([127.0.0.1]:33128 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kzOlB-0003mf-PN
	for submit <at> debbugs.gnu.org; Tue, 12 Jan 2021 13:51:18 -0500
Received: from relay6-d.mail.gandi.net ([217.70.183.198]:37053)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kzOl9-0003mH-QY
 for 45765 <at> debbugs.gnu.org; Tue, 12 Jan 2021 13:51:16 -0500
X-Originating-IP: 91.129.98.64
Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64])
 (Authenticated sender: juri@HIDDEN)
 by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 49BBAC0003;
 Tue, 12 Jan 2021 18:51:07 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: =?iso-8859-1?Q?K=E9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
Organization: LINKOV.NET
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN>
 <87zh1fyxo0.fsf@HIDDEN>
Date: Tue, 12 Jan 2021 20:46:51 +0200
In-Reply-To: <87zh1fyxo0.fsf@HIDDEN> (=?iso-8859-1?Q?=22K=E9vin?= Le
 Gouguec"'s message of "Mon, 11 Jan 2021 22:24:31 +0100")
Message-ID: <87lfcywhyc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 11 Jan 2021 21:24:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 11 16:24:43 2021
Received: from localhost ([127.0.0.1]:58480 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kz4g6-00065K-Te
	for submit <at> debbugs.gnu.org; Mon, 11 Jan 2021 16:24:43 -0500
Received: from mail-wr1-f41.google.com ([209.85.221.41]:33049)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1kz4g3-000653-RE
 for 45765 <at> debbugs.gnu.org; Mon, 11 Jan 2021 16:24:40 -0500
Received: by mail-wr1-f41.google.com with SMTP id t30so281494wrb.0
 for <45765 <at> debbugs.gnu.org>; Mon, 11 Jan 2021 13:24:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=gS0VZLshH8jJJjC0I9qW2f/EMGBUxtjy9oEnk4xg3TI=;
 b=uUMATJSBWF7yE+fhuNJCDL61n/r4ANuUdBuXmbkxSporzTq+c7boU0AqhTHQHqDrcM
 39UUGdV3QqrfKJIX5lUFsw47nfEqKDWfQOviJsqdgZNLzlGFfAgnfVGUkfn/J4Z5MHIy
 +mfAYbk57z/xxMoITVacJCekFxAvHc60RMQDWfqUcEW+n5MGCcgOhDyHTgvFP7IQps4g
 83g/MrfdDz9u+sFbtcInb1DllaTacE/DLDsoKXhygKjKUysRliymgjf/SOHfcIcOs2iL
 oKB7vpOIXSfaaUpmKMW/LK8SFR5P5ok/wC7z8c9K+fO8kfB23ZmBFVC5SxKcKWESW+YK
 DdRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=gS0VZLshH8jJJjC0I9qW2f/EMGBUxtjy9oEnk4xg3TI=;
 b=LhpjXor3D5BmjaM/7jeTUnwR0RTCH9p3eL/RP+QAOgi8aFeQ5rGnfh6uw0g7Y2mMO8
 qBOyIRopcI3bAsaWvDdIXFyoCQQD6gJPWAEgb4YUHPje4/4S3LO30CFP2p1XqpMJHwoi
 VWFLIqEDLrrL8Af6Fgqce4o30WggM4zq32Rz78ba9zTWbAK8sTvcAEuF170zxSch33H4
 eZ/5MRFrN510hUvDkcVXQPCrvU07cFR+wGDBafd5Z69foQdfX/I0HD78eEaNJpQvb2yQ
 AYBxC0xns//CEsXCO+e+YbIUM4EgHlrRXb/rNe8CCUa2O3IOMxVPaDtCCJRUEOP63yYS
 IG9g==
X-Gm-Message-State: AOAM530nUIMnolKZwBEbnuCyjuVPRxQM/q8biDIfjZKqfKDWwYvwJDR0
 S3rpGUYNSEvPvJKAIPvTv8fTTHS+no5Giw==
X-Google-Smtp-Source: ABdhPJwga8KUqbmxfoUEP0hR7r5Sg255XZMzsdeKpHTEjFuEWxuEh3xcxVWJEJrVXd5HlZLWRa6p2w==
X-Received: by 2002:adf:fc48:: with SMTP id e8mr942665wrs.11.1610400273469;
 Mon, 11 Jan 2021 13:24:33 -0800 (PST)
Received: from my-little-tumbleweed ([2a01:e0a:20e:d340:922b:34ff:fe95:9aed])
 by smtp.gmail.com with ESMTPSA id
 r2sm1190864wrn.83.2021.01.11.13.24.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 11 Jan 2021 13:24:32 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
 <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN>
Date: Mon, 11 Jan 2021 22:24:31 +0100
In-Reply-To: <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN> (Dmitry Gutov's
 message of "Mon, 11 Jan 2021 21:13:23 +0200")
Message-ID: <87zh1fyxo0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org, Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Dmitry Gutov <dgutov@HIDDEN> writes:

> On 11.01.2021 20:35, Juri Linkov wrote:
>> 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:
>>    <snip>
>
> Is it really possible to solve this without making project-compile a
> macro of some sort?

Something like this maybe?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Change-default-directory-before-prompting-in-project.patch

From 7d3ffd7f33276949669414ed4908ad8fee35dd93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@HIDDEN>
Date: Sun, 10 Jan 2021 10:43:41 +0100
Subject: [PATCH] Change default-directory before prompting in project-compile

This causes command completion to work from the project root, letting
users complete top-level folders, make targets, etc.

* lisp/progmodes/project.el (project-compile): Simplify using
call-interactively, as done with project(-aysnc)-shell-command.
---
 lisp/progmodes/project.el | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 62c3cf44cb..dade8b4f1c 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -970,20 +970,16 @@ compilation-read-command
 (declare-function compilation-read-command "compile")
 
 ;;;###autoload
-(defun project-compile (command &optional comint)
+(defun project-compile (command &optional comint interactive)
   "Run `compile' in the project root.
-Arguments the same as in `compile'."
-  (interactive
-   (list
-    (let ((command (eval compile-command)))
-      (require 'compile)
-      (if (or compilation-read-command current-prefix-arg)
-	  (compilation-read-command command)
-	command))
-    (consp current-prefix-arg)))
-  (let* ((pr (project-current t))
-         (default-directory (project-root pr)))
-    (compile command comint)))
+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))))
 
 (defun project--read-project-buffer ()
   (let* ((pr (project-current t))
-- 
2.29.2


--=-=-=
Content-Type: text/plain


(Apologies if I misunderstood what Juri asked, or if my suggestion is
buggy)

We can also stick a "\(fn COMMAND &optional COMINT)" in the docstring if
we don't want to advertise the INTERACTIVE argument.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 11 Jan 2021 19:13:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 11 14:13:35 2021
Received: from localhost ([127.0.0.1]:58292 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kz2dD-0002l9-0H
	for submit <at> debbugs.gnu.org; Mon, 11 Jan 2021 14:13:35 -0500
Received: from mail-wr1-f50.google.com ([209.85.221.50]:36655)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kz2dB-0002kx-5u
 for 45765 <at> debbugs.gnu.org; Mon, 11 Jan 2021 14:13:34 -0500
Received: by mail-wr1-f50.google.com with SMTP id t16so933018wra.3
 for <45765 <at> debbugs.gnu.org>; Mon, 11 Jan 2021 11:13:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=BU6mlgqWPXYcSTOgHHBSztzQpSHutM5qakWqSZB4wjc=;
 b=NeWCUnrQDDEkvtcoitRcOXIZtmkpjsxLAOLVveo3gfI1oUk1bQKCQgaNmDByICI4IW
 HoTOn2FQ0ScV50Z9Z8/MgLa7groMrjxic80+oXND7nMwmGq3WjSouKawqye2B0jcQ086
 yrPHQPzLYVFjswrgUc6EnVyrfggKXsvLrZqL1v/zgyUAp2ufUPL9qPDl0Bce2vGyZx+s
 IyHetvMyG0Mx/11ozl1gLoSxh16DVVMIbd4ZXMBnKqZf+1hRQmpPfGyax53l2CQ7sHga
 9rqYXawd4aPXiX4mre+8gt9zOAfYT5LHYO4YpMPL4KivZ0LnSqMK/c9KTPmAn814PQx7
 DtXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=BU6mlgqWPXYcSTOgHHBSztzQpSHutM5qakWqSZB4wjc=;
 b=JEqowGbCwXD0isfE5KabZ3y38HVlg7kqpmYnVXJ/N9RBIZUjL+7MXzTVN1ElZsstX/
 pUz3lV1iiekbMJeS5c+H2g8k2pnqd1mXc4o9OYDLHZeTOrVcwPZnTELVyCYVH5hriwMs
 zPFLwqfm4Jj/DV/eRkKIFSNq/3N4K8EZ/5I9IAO6UiWKa2OfhM2FaVbCHleQxcSWQONB
 4czAZGXwvcRWGE5EBtHD6dRiul+ZWoQBLHvZCpsF1c4jhdy5j4HQGD1Yi7x+P1E/whp7
 brqpEFqsdRHz2CjiM8QXVRt/AB17fT8GHf6IOKFmOkkDK0IxbZzi3kcP5CntVaSE9SBB
 G/ZA==
X-Gm-Message-State: AOAM531j6DPrkPMlR1SYdBrP3S6yq1Av1epvwCzeM+HvqrDeEO+pzu/F
 04Ru/Ka42KXPhkkoyYfqd0S3nAD0ibmA1A==
X-Google-Smtp-Source: ABdhPJyDvOB6qwnImfHQPOe0X3vnHACQaMED+CvQH7Lu5Ec6/3xTUQvR2/dZ5a4ZzsD1stiNT8Wiaw==
X-Received: by 2002:a5d:6708:: with SMTP id o8mr607210wru.64.1610392406868;
 Mon, 11 Jan 2021 11:13:26 -0800 (PST)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id b19sm296531wmj.37.2021.01.11.11.13.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 11 Jan 2021 11:13:26 -0800 (PST)
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
To: Juri Linkov <juri@HIDDEN>,
 =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
References: <87bldx2bmk.fsf@HIDDEN> <87ft37bbp0.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <01a19619-e48a-825f-b459-5b04df402ad6@HIDDEN>
Date: Mon, 11 Jan 2021 21:13:23 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <87ft37bbp0.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 45765
Cc: 45765 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 11.01.2021 20:35, Juri Linkov wrote:
> 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)))

Is it really possible to solve this without making project-compile a 
macro of some sort?

For the above code sample not to exhibit the problem from this report, 
it should use project-current and project-root directly.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Jan 2021 19:01:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 11 14:01:00 2021
Received: from localhost ([127.0.0.1]:58266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kz2R2-0002S8-Cg
	for submit <at> debbugs.gnu.org; Mon, 11 Jan 2021 14:01:00 -0500
Received: from lists.gnu.org ([209.51.188.17]:40344)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1kz2R0-0002Rt-1q
 for submit <at> debbugs.gnu.org; Mon, 11 Jan 2021 14:00:59 -0500
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 <juri@HIDDEN>) id 1kz2Qy-0005Zt-3Y
 for bug-gnu-emacs@HIDDEN; Mon, 11 Jan 2021 14:00:57 -0500
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 <juri@HIDDEN>) id 1kz2Qu-0006Ka-Sv
 for bug-gnu-emacs@HIDDEN; Mon, 11 Jan 2021 14:00:55 -0500
X-Originating-IP: 91.129.98.64
Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64])
 (Authenticated sender: juri@HIDDEN)
 by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 2023AE000C;
 Mon, 11 Jan 2021 19:00:45 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: =?iso-8859-1?Q?K=E9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
Subject: Re: [PATCH] 28.0.50; Change default-directory before prompting in
 project-compile
Organization: LINKOV.NET
References: <87bldx2bmk.fsf@HIDDEN>
Date: Mon, 11 Jan 2021 20:35:23 +0200
In-Reply-To: <87bldx2bmk.fsf@HIDDEN> (=?iso-8859-1?Q?=22K=E9vin?= Le
 Gouguec"'s message of "Sun, 10 Jan 2021 13:57:07 +0100")
Message-ID: <87ft37bbp0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=217.70.183.196; envelope-from=juri@HIDDEN;
 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-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
Cc: bug-gnu-emacs@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> 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)))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at 45765 <at> debbugs.gnu.org:


Received: (at 45765) by debbugs.gnu.org; 11 Jan 2021 00:47:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 10 19:47:36 2021
Received: from localhost ([127.0.0.1]:55252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kylMu-0000RD-A8
	for submit <at> debbugs.gnu.org; Sun, 10 Jan 2021 19:47:36 -0500
Received: from mail-wr1-f47.google.com ([209.85.221.47]:45938)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kylMs-0000R0-Ip
 for 45765 <at> debbugs.gnu.org; Sun, 10 Jan 2021 19:47:35 -0500
Received: by mail-wr1-f47.google.com with SMTP id d26so14651268wrb.12
 for <45765 <at> debbugs.gnu.org>; Sun, 10 Jan 2021 16:47:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=oJgoqzmUXnReWzvj7ZmCtaQi04RaAGT1CPSIZQx7Evg=;
 b=lFCpj/BAvq1yP3QaMdz/5wfR0cAeq7h01TYADmSUDe/rU/d6hsX1WYuHYWqGsvPlrU
 3G+jyBXKU0DNGq6jsp4B+Ii0+a/fqWjLmdriRCfppaJWCm+Xp+2+j1Ivh1yKiyUIzeNJ
 rKqPi6EUNhN/z846dEsClPRYjU42HO3WaXPX6sdlsA0Gc2Fu5ZK4700uRhiI7Esaslvv
 tZfyIqXCJGEMSNJUGwYxO614FrXzOTvyg3Gxdor2AFu0/+Q4ZouK+jBTAm6yNQV/oqcN
 S9njIpRLzYWADHBYQsiuuv6kCeWOacKV7ynON6/YihHQf1bWAVS1H4vXjHskzw66gEEo
 d8kw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=oJgoqzmUXnReWzvj7ZmCtaQi04RaAGT1CPSIZQx7Evg=;
 b=tCFRnFcZWEXSi5bXwPrsHCjI7UN8OuYR8Y2HEuTzzGDbPiJZ3xfltJTOhcfhmjTYu/
 jenmil7aQKsdkkrBQhnsi0GMECQI/y3f1qH3GU3Xbhw4LSCAC1VyfYDyAR5ZKRu3pUgY
 mIM8HzUalNg4ipPomfSF7TWwQCIjMML3+tN+/qksCCJ/Jom1MZC4Be8Ep/fHcZY6jse2
 IG3SQCSl+nyuh91orE3c+lFisbWZn0SHrSrxalbexoYeR79N6yYcU0ktL8DF8DOgc3dl
 VJzk0dZ7tSGVlKtXycxmzx3yO62Qhum7fEpadeKwgul+AwUNRfdcWNUZFthLQMUFSQKG
 LraQ==
X-Gm-Message-State: AOAM532DCemuyHjJuMg2DAW+nw6zEOT9GpeNbWfWR79CQ35/2z6F1v7b
 nzMeFcLbsoL3xx8irmTKIxA=
X-Google-Smtp-Source: ABdhPJyOTNDcNp46ISpb7g3xaln4tHuTfL5Zi/+DaoifdPOgsRA3Rvai1uOfaFGtx8NpvCTmnL3fAg==
X-Received: by 2002:a5d:4ece:: with SMTP id s14mr13545279wrv.427.1610326048676; 
 Sun, 10 Jan 2021 16:47:28 -0800 (PST)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id m21sm19765259wml.13.2021.01.10.16.47.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 10 Jan 2021 16:47:27 -0800 (PST)
Subject: Re: bug#45765: [PATCH] 28.0.50; Change default-directory before
 prompting in project-compile
To: =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>,
 45765 <at> debbugs.gnu.org
References: <87bldx2bmk.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <03e46cb4-b81c-f369-b932-958f5707981a@HIDDEN>
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
MIME-Version: 1.0
In-Reply-To: <87bldx2bmk.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 45765
Cc: Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 Jan 2021 12:57:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 10 07:57:16 2021
Received: from localhost ([127.0.0.1]:53388 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kyaHT-0003zL-WA
	for submit <at> debbugs.gnu.org; Sun, 10 Jan 2021 07:57:16 -0500
Received: from lists.gnu.org ([209.51.188.17]:41352)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1kyaHS-0003zD-4Q
 for submit <at> debbugs.gnu.org; Sun, 10 Jan 2021 07:57:14 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:52750)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <kevin.legouguec@HIDDEN>)
 id 1kyaHR-0000Jq-SE
 for bug-gnu-emacs@HIDDEN; Sun, 10 Jan 2021 07:57:13 -0500
Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:54011)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <kevin.legouguec@HIDDEN>)
 id 1kyaHO-0004v6-Pk
 for bug-gnu-emacs@HIDDEN; Sun, 10 Jan 2021 07:57:13 -0500
Received: by mail-wm1-x329.google.com with SMTP id k10so11542380wmi.3
 for <bug-gnu-emacs@HIDDEN>; Sun, 10 Jan 2021 04:57:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:mime-version;
 bh=/XNALqb9AJIIfM0uAz6pRRZ3l/wDmNdnRViBDEReXzA=;
 b=MxGWEuw7Tw99+BqwDKSfVJWWnmW5vUqLrAPQ2xgABla08UebflIFafMltEPr8igfn1
 zMfD/GCwQ6xoFxUSVUNxbKQ4GG1qNRj7QH1e1XLqahVi89PzBF3fdJw8h24xdZtawtIk
 0x5EP4osU+E7GqfhM7DVI+VAKxtxqPEh896lVMCEYlHO4gbVCF7e9xDRT0uDEqYMppvd
 C3WbtLwHKWFJXfGW8oChu/5ZaWkIXNRF0qSES+UTiNEQQAiobxDP3AJnk1VAzmuFEQqo
 lxLPBgyG1jsJbp18ajL7Pzc798kaBJ2rJn2OuK7MMHIrokX7eNJ30kMKDcZauX+JFfho
 qXyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version;
 bh=/XNALqb9AJIIfM0uAz6pRRZ3l/wDmNdnRViBDEReXzA=;
 b=aLyK48NNbZDSH+TVoPnvWoSJqu9QsEEisFKdMNbTrps7xeESebWvB0aHL89xpS9REx
 rRz69yMraLxRUzaR79I8eVOXh1GzJkKl4HO1pOzBi7H8bmNZb7jd0Uw3Tx5Odvwd24iz
 zzbUmOFIYV7lA/FpJPgVWXkSzLwokCxmRnz2swChg2mjN7Eny1awfgM3ras91FT1R9q/
 lPSA0Nhm8Y5LIjQ4umCRD33eEhe32WPq+sJHwJqNGWipKcuZzVh5DsmWMBLORUoSDqjU
 cfZYJMgAmAaBKndqZzSd6vMLXmQN1Al4ZVT5ifLgui5OCjm3FD6s9/OlrlNyS/EN6urh
 +uEw==
X-Gm-Message-State: AOAM5306D4DJHjx/IqgrebV3Eg9OcnUTmVQMjbiExN10wqlle10ofJSY
 6XNAKpTWCV8aqFjN+bkyRv8=
X-Google-Smtp-Source: ABdhPJzfvGAqBccKVfAMJxWlzLmyKbnZDkNNaID8//OFVOuVbNW9FEZyjWMA8yWlRyIoA550EI+KZg==
X-Received: by 2002:a7b:cc90:: with SMTP id p16mr10396628wma.105.1610283428900; 
 Sun, 10 Jan 2021 04:57:08 -0800 (PST)
Received: from my-little-tumbleweed ([2a01:e0a:20e:d340:922b:34ff:fe95:9aed])
 by smtp.gmail.com with ESMTPSA id
 m8sm19480671wmc.27.2021.01.10.04.57.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 10 Jan 2021 04:57:07 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] 28.0.50; Change default-directory before prompting in
 project-compile
Date: Sun, 10 Jan 2021 13:57:07 +0100
Message-ID: <87bldx2bmk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=2a00:1450:4864:20::329;
 envelope-from=kevin.legouguec@HIDDEN; helo=mail-wm1-x329.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

Hello,

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).

(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've taken a stab at (2), but my patch changes the semantics of COMMAND
for an edge case: for now calling (project-compile nil) from Lisp causes
(compile nil) to be called (which errors out); with my patch,
(project-compile nil) yields a prompt.

This can be solved using called-interactively-p (or using an optional
INTERACTIVE argument); I just don't know if it's worth the hassle?

I haven't given much thought to (3), so I haven't yet figured out how to
avoid prompting twice for the project (on the rare occasions where
prompting is needed).


Thanks for your time.



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Change-default-directory-before-prompting-in-project-1.patch

From 801311cef5a825af93a41cc044b4f753b648a866 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@HIDDEN>
Date: Sun, 10 Jan 2021 10:43:41 +0100
Subject: [PATCH] Change default-directory before prompting in project-compile

This causes command completion to work from the project root, letting
users complete top-level folders, make targets, etc.

* lisp/progmodes/project.el (project-compile): Simplify using
call-interactively, as done with project(-aysnc)-shell-command.
---
 lisp/progmodes/project.el | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 62c3cf44cb..06966f33b7 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -970,20 +970,11 @@ compilation-read-command
 (declare-function compilation-read-command "compile")
 
 ;;;###autoload
-(defun project-compile (command &optional comint)
-  "Run `compile' in the project root.
-Arguments the same as in `compile'."
-  (interactive
-   (list
-    (let ((command (eval compile-command)))
-      (require 'compile)
-      (if (or compilation-read-command current-prefix-arg)
-	  (compilation-read-command command)
-	command))
-    (consp current-prefix-arg)))
-  (let* ((pr (project-current t))
-         (default-directory (project-root pr)))
-    (compile command comint)))
+(defun project-compile ()
+  "Run `compile' in the project root."
+  (interactive)
+  (let ((default-directory (project-root (project-current t))))
+    (call-interactively #'compile)))
 
 (defun project--read-project-buffer ()
   (let* ((pr (project-current t))
-- 
2.29.2


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Change-default-directory-before-prompting-in-project-2.patch

From b1b10d01a83b2b07a27ce6bcf12cf000fabaf22a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= <kevin.legouguec@HIDDEN>
Date: Sun, 10 Jan 2021 13:18:07 +0100
Subject: [PATCH] Change default-directory before prompting in project-compile

This causes command completion to work from the project root, letting
users complete top-level folders, make targets, etc.

* lisp/progmodes/project.el (project-compile): Read command after
binding default-directory to project root.
---
 lisp/progmodes/project.el | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 62c3cf44cb..1e7f6d7c06 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -974,15 +974,17 @@ project-compile
   "Run `compile' in the project root.
 Arguments the same as in `compile'."
   (interactive
-   (list
-    (let ((command (eval compile-command)))
-      (require 'compile)
-      (if (or compilation-read-command current-prefix-arg)
-	  (compilation-read-command command)
-	command))
-    (consp current-prefix-arg)))
-  (let* ((pr (project-current t))
-         (default-directory (project-root pr)))
+   (list nil
+         (consp current-prefix-arg)))
+  ;; Bind `default-directory' before prompting for COMMAND, so that
+  ;; command completion works from the project root.
+  (let ((default-directory (project-root (project-current t)))
+        (command (or command
+                     (let ((command (eval compile-command)))
+                       (require 'compile)
+                       (if (or compilation-read-command current-prefix-arg)
+	                   (compilation-read-command command)
+                         command)))))
     (compile command comint)))
 
 (defun project--read-project-buffer ()
-- 
2.29.2


--=-=-=
Content-Type: text/plain



In GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-01-04 built on my-little-tumbleweed
Repository revision: 2c847902522ae74c9b25b2a3fa60565e0187fd0a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: openSUSE Tumbleweed

Configured using:
 'configure --with-xwidgets --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS JSON
PDUMPER LCMS2

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix

--=-=-=--




Acknowledgement sent to Kévin Le Gouguec <kevin.legouguec@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#45765; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 19 Jan 2021 18:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.