From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#68570: 29.1; recompile might not re-use project-compile's buffer Date: Sat, 20 Jan 2024 16:27:58 +0200 Message-ID: References: <920b0c20-c6ee-4b41-84ec-5adfa06c64a2@jbornemann.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15386"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Pengji Zhang , 68570@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 20 15:29:23 2024 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 1rRCLa-0003mw-6M for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Jan 2024 15:29:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRCLF-0000LP-Lo; Sat, 20 Jan 2024 09:29:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRCLD-0000LH-Op for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 09:29:00 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRCLD-0004Cd-Gm for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 09:28:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRCLF-0001Sf-U8 for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 09:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 14:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68570 X-GNU-PR-Package: emacs Original-Received: via spool by 68570-submit@debbugs.gnu.org id=B68570.17057608965556 (code B ref 68570); Sat, 20 Jan 2024 14:29:01 +0000 Original-Received: (at 68570) by debbugs.gnu.org; 20 Jan 2024 14:28:16 +0000 Original-Received: from localhost ([127.0.0.1]:33194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRCKW-0001RY-2b for submit@debbugs.gnu.org; Sat, 20 Jan 2024 09:28:16 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42335) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRCKS-0001RH-3X for 68570@debbugs.gnu.org; Sat, 20 Jan 2024 09:28:14 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 3AE4A5C00C4; Sat, 20 Jan 2024 09:28:03 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sat, 20 Jan 2024 09:28:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1705760883; x=1705847283; bh=i01UFDZt16gH2XG7gXe6r83kws2CoVK0ZxsCLAV3LHg=; b= GPIxWlXp7pXoPEWGbqM0Cm886YhyKpjUamGeRSjzdx2VyMnMVq7RqPnd1fkoGwDT nzzegGLvHx00Jb8ncYULbD4wM55nRCiA6fec8MuJSASWZMaL7UN918+j7yltMjTh V3mBFDMf9NERk8vYpIVbZ8js2SBfTaZTnRJUPUYWBwx5YZYQVTyNaIT2ZkhFPQgI prb5ldg86tZbUomoE9dw8HJg6s5IWUxvl8CEIiqH8ZOVEibCtabJ6c7ZDhckvVRu SMZCC+4aU7XBn0R5wJPWETWs15nEeEBpfLlKlkxxPUnuaDKlaJ+qk0clq/cFFQks zqUmZbPdPWJhcWftqSUqfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1705760883; x= 1705847283; bh=i01UFDZt16gH2XG7gXe6r83kws2CoVK0ZxsCLAV3LHg=; b=X DfPJ59xDPd3AY0o0lfBvYtrkyjO+AZm4pj4kiiT3WQLeRsIZrTiPQNO+wylGNfGI s6UuCjw+HxgisgC5yTrQJtvWZcd1mHmGS1dVNFLtzM18MnME2qATbnSWNU8S5pbs 0+A7QrvFuLzN3HbDnJxlZhKYUbsfZljihsq7q1fQgU0OvmdIMaGde2fgSa+JIPjQ LmrJDeqjm+qneOpIr4EryVxCpEbCgsF2wn/ccu/PtqPfdMwDdcKpxOhuYDIuPT8C O6X5+GiwoEKDZEKJZCIJ5RZ1+gWTJYkT6qv6IJcKLCC6m3jRSa6M8k5B6xIUaWJf hVHD3xdB4wR2zs36MXjpA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekvddgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnheptdfhuedvtdevleegueelvedvjeevhe ffveevhedvuefftdefhfdvueeggfetgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 20 Jan 2024 09:28:02 -0500 (EST) Content-Language: en-US In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278608 Archived-At: On 19/01/2024 22:19, Pengji Zhang wrote: > I think you meant running `M-x recompile' not in a compilation buffer? > While I agree that is convenient, I suppose it is better to only use > `recompile' in a compilation buffer due to security reasons. > > `compile-command' is marked as a safe local variable assuming that the > user would be prompted to check and confirm the command before running > it. That is the behavior of `compile' but not `recompile'. For > example, create a file '/tmp/test.c' with the following contents: > > /* Local Variables: */ > /* compile-command: "echo 1" */ > /* End: */ > > Then: > - emacs -Q --eval "(require 'compile)" > - C-x C-f /tmp/test.c > - M-x recompile > > So we could run arbitrary commands without any warning or confirmation. It seems like you found a security issue in 'M-x recompile'. It's orthogonal to this feature request, though. > Instead of a `project-recompile' command, it might be better to make > `recompile' find the existing compilation buffer for the current > buffer, and refuse to run the command (or ask for confirmation) if > there is no such buffer. This sounds like a good plan for fixing the above issue. But the step "find the existing compilation buffer for the current buffer" requires compilation-buffer-name-function to be set to an appropriate value. And project-compile only binds it temporarily.