From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66993: [PATCH] project.el: avoid asking user about project-list-file lock Date: Thu, 09 Nov 2023 18:52:19 +0200 Message-ID: <83bkc2zx6k.fsf@gnu.org> References: <83sf5g1lko.fsf@gnu.org> <9d460f36-6035-da54-3abc-12171ac8977f@gutov.dev> <83jzqs1hhx.fsf@gnu.org> <57c079bf-e3a3-db45-c45a-ad6925335e2f@gutov.dev> <83il6c1ct3.fsf@gnu.org> <83fs1g19vn.fsf@gnu.org> <83bkc416q3.fsf@gnu.org> <835y2b1lnp.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27705"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 66993@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 09 17:53:34 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 1r18He-0006vt-1c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Nov 2023 17:53:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r18HU-000399-F7; Thu, 09 Nov 2023 11:53: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 1r18HT-00038X-0a for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 11:53: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 1r18HS-0003Jd-Of for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 11:53:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r18I5-0005T9-U2 for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 11:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2023 16:54: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.169954879820968 (code B ref 66993); Thu, 09 Nov 2023 16:54:01 +0000 Original-Received: (at 66993) by debbugs.gnu.org; 9 Nov 2023 16:53:18 +0000 Original-Received: from localhost ([127.0.0.1]:48651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r18HN-0005S8-Vd for submit@debbugs.gnu.org; Thu, 09 Nov 2023 11:53:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r18HG-0005Rq-Pe for 66993@debbugs.gnu.org; Thu, 09 Nov 2023 11:53:16 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r18GX-00034J-TN; Thu, 09 Nov 2023 11:52:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IkIPxOT7SPIhmlQU/a63n8ASMVduINakZFNNbcIotWc=; b=HUTklabC0hNl 31/IOpKUJwIa2QZoyfpoOQrAGks3yzyotqaw+AS20PpPILKuIr3fBbK+922dLrTwMQUyu9Q64wVyb cTgvKgppGJRG9kyGBOEj5pOivrv9RbcgbDegUTLU1V7r4h7ynB9DbXWHSm9XAoKdh5fddsVAjQynO YgVXGdFqJ5v1sG8q8OoCjktfdRhPXDphITJwDQoqIQuOnmYseAo5Ouq0NZjZ00PqvzHsDx+pBRTrL M0+wau6riulKjEJqc3ew7ohrFeWa3pK0dESggcIQ5lC54mwzdu1fL8+Uhcb9U4YUtefA+vYFFhjMT P8uixQxXEUBRIW/XmNdfPw==; In-Reply-To: (message from Spencer Baugh on Thu, 09 Nov 2023 11:38:26 -0500) 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:274061 Archived-At: > From: Spencer Baugh > Cc: dmitry@gutov.dev, 66993@debbugs.gnu.org > Date: Thu, 09 Nov 2023 11:38:26 -0500 > > > That's one way, yes. Another one is to use define-error to define a > > new error type for this case. > > Instead of defining a new error type, how about just signaling > file-locked instead? e.g. the following patch: > > diff --git a/lisp/userlock.el b/lisp/userlock.el > index 61f061d3e54..e4d23c56249 100644 > --- a/lisp/userlock.el > +++ b/lisp/userlock.el > @@ -67,7 +67,7 @@ ask-user-about-lock > (message (substitute-command-keys > "%s locked by %s: (\\`s', \\`q', \\`p', \\`?')? ") > short-file short-opponent) > - (if noninteractive (error "Cannot resolve lock conflict in batch mode")) > + (if noninteractive (signal 'file-locked (list file opponent))) > (let ((tem (let ((inhibit-quit t) > (cursor-in-echo-area t)) > (prog1 (downcase (read-char)) Please show the result of this change on what Emacs prints in batch mode when this error is signaled.