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#66993: [PATCH] project.el: avoid asking user about project-list-file lock Date: Wed, 8 Nov 2023 15:20:39 +0200 Message-ID: <9cd0def6-67de-5e0e-9ab3-a917c34a238b@gutov.dev> References: <7089f7f2-3000-75fe-768a-dd12d979d81c@gutov.dev> <83pm0k1l9k.fsf@gnu.org> 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="40710"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: sbaugh@janestreet.com, 66993@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 14:21:41 2023 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 1r0iV0-000AMX-PG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 14:21:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0iUm-0000ek-AI; Wed, 08 Nov 2023 08:21:24 -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 1r0iUl-0000eZ-DC for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 08:21:23 -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 1r0iUl-0007vv-4o for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 08:21:23 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0iVN-0006Gf-KZ for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 08:22: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: Wed, 08 Nov 2023 13:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66993 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66993-submit@debbugs.gnu.org id=B66993.169944968824030 (code B ref 66993); Wed, 08 Nov 2023 13:22:01 +0000 Original-Received: (at 66993) by debbugs.gnu.org; 8 Nov 2023 13:21:28 +0000 Original-Received: from localhost ([127.0.0.1]:44212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0iUq-0006FW-Fq for submit@debbugs.gnu.org; Wed, 08 Nov 2023 08:21:28 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:34481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0iUo-0006FI-6Z for 66993@debbugs.gnu.org; Wed, 08 Nov 2023 08:21:27 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7124A5C0459; Wed, 8 Nov 2023 08:20:42 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 08 Nov 2023 08:20:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :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:sender:subject:subject:to:to; s=fm2; t= 1699449642; x=1699536042; bh=taCsCUF/21zzdir9q69DGGwNr3suY8b6leP S3iYf//0=; b=lEz4e6Kv8zspGyeGpK6kVctjPmR+WlfkJ1D9Y7bQ59rra2njwtN 1ShR8y+/r4f8bqfHuFip7zuYwIHx5HwLzg/1QwkCx5dN7wLSdiCmUrt7X37kY2HS prs0KEdUSXC8xyYsTgUwlezjDIKhQ/8A2f9Diz8CiDW9/GXUmXaw0wWEuJZiqPLv IKfMGO2UlQAB+D3iTcixDAG4NgRnts7Mvo2Mr7vwrzVjJWErZqKH09d8qqNl3J6R pavLBO5YRyW32P7WQR1/QCPNE6cXb0Oh3HhFwFYJ5uzE4YAsTsvtE+mq9Vf1EUnu hom6kkoGQm7rDwfVoH9KPJF0vrlG2xFZqvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1699449642; x=1699536042; bh=taCsCUF/21zzdir9q69DGGwNr3suY8b6leP S3iYf//0=; b=m9g7laFpOYileLxYJvHuUj4GpCYqTYFhJMdmR69tCPs6v5DvG/7 2WualS62njkSHFvt4auG1Nl6cwZibDHcGswdeWOJ9fgP6di/NU1IP1l+Z7i23W9e 8F9Q+5lLn8Bv9sd9+1uAet+0SYZD/stpGkz1tLeJbBtL1/1cw+OyVjMbl8XWz9DZ i+CPrtYWoRGwCCl74X1jsOBX8511xPyQRcoCgnMtO1a8fkgrH3N7ubUiU8yv6sak TIbciHN512MmpI1a/WMdE41aW4lCk/vkJUTmWeBGQAWrUEGmHI2b98qJYeU9dzpx tKz71X68DZMVtB/DCl873DbCfGiSLdAvLhg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudduledghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Nov 2023 08:20:41 -0500 (EST) Content-Language: en-US In-Reply-To: <83pm0k1l9k.fsf@gnu.org> 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:273985 Archived-At: On 08/11/2023 14:29, Eli Zaretskii wrote: >> Date: Wed, 8 Nov 2023 02:24:13 +0200 >> From: Dmitry Gutov >> >> Anyway, maybe an implementation like this (totally untested)? >> >> Or the warning could be skipped entirely. >> >> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >> index a6426c08840..e544dfefa73 100644 >> --- a/lisp/progmodes/project.el >> +++ b/lisp/progmodes/project.el >> @@ -1719,7 +1719,9 @@ project--write-project-list >> (expand-file-name name))))) >> project--list) >> (current-buffer))) >> - (write-region nil nil filename nil 'silent)))) >> + (let ((noninteractive t)) >> + (with-demoted-errors "Failed to save file list: %S" >> + (write-region nil nil filename nil 'silent)))))) > Isn't the cure worse than the disease? we are in effect disregarding > all errors that prevent us from saving the file. If ask-user-about-lock signaled a specific error rather than just (error ...), we could catch only that one. > If those errors are > not important, why save the list to the file at all? It's not hugely important that the list is up-to-date at all times. I haven't encountered the conflicts myself, though. Maybe some other solution could be preferable. Michael's suggestion sounds pretty efficient, for example.