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#72019: [PATCH] Add project argument to project-kill-buffers Date: Thu, 11 Jul 2024 07:52:56 +0300 Message-ID: <86jzhsmswn.fsf@gnu.org> References: <86ed81o5oc.fsf@gnu.org> <8634ohnwpz.fsf@gnu.org> <86zfqpm9ur.fsf@gnu.org> <86v81dm8te.fsf@gnu.org> <86sewhm5ri.fsf@gnu.org> <5c12905c-370e-419b-8ff1-657341da68cf@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29495"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 72019@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 11 06:54:26 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 1sRlp4-0007Ro-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jul 2024 06:54:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRloq-00036g-G4; Thu, 11 Jul 2024 00:54:12 -0400 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 1sRloo-00036T-RY for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 00:54:10 -0400 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 1sRlog-0000rt-Km for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 00:54:10 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRlog-0004gW-1Q for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 00:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2024 04:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72019 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72019-submit@debbugs.gnu.org id=B72019.172067358717948 (code B ref 72019); Thu, 11 Jul 2024 04:54:02 +0000 Original-Received: (at 72019) by debbugs.gnu.org; 11 Jul 2024 04:53:07 +0000 Original-Received: from localhost ([127.0.0.1]:50715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRlnn-0004fQ-C9 for submit@debbugs.gnu.org; Thu, 11 Jul 2024 00:53:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRlnk-0004ev-Iy for 72019@debbugs.gnu.org; Thu, 11 Jul 2024 00:53:05 -0400 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 1sRlnf-0008PZ-Ot; Thu, 11 Jul 2024 00:52:59 -0400 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=k6h3uckj7zD/TduapC8SkLUzg7PMIHvOdGq3a0HxoFo=; b=QYMH3b2IY4Ov +nuCoFE2d/6zIufooxPh5d0H/S+5bjhOR/lUFo4Fb5mX6hUCVVMLKvERePgU4VOTpeBjv5GTyBl8W HiUBuogs4ivIfRABjDk4SmIc8KHYdWWykCdFcN8ohV/BUAqCpeZKCHSEE3fXdY36gIDldq+LviSYz KNI7E9vppA+Ps2Rh0ku1sqPmBM1XJj9xl3Qwr+blMTinrEUgiDmC/G2SxOirlEc6BCcWEYeFi2teO SFcxcvs0Mb9VHo5tlTQ6S54fERPa2rwdma0HXzDue9rinH3bNHQA+HtxfPjfsN+AJBu0EJxME84A1 tk7RSBOLvgn0QsY/Lu2c9A==; In-Reply-To: <5c12905c-370e-419b-8ff1-657341da68cf@gutov.dev> (message from Dmitry Gutov on Thu, 11 Jul 2024 03:18:46 +0300) 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:288713 Archived-At: > Date: Thu, 11 Jul 2024 03:18:46 +0300 > Cc: 72019@debbugs.gnu.org > From: Dmitry Gutov > > On 10/07/2024 22:00, Eli Zaretskii wrote: > >> Because it is also nicer to explicitly indicate what project the Lisp > >> program is operating on. Going through project-current means there are > >> a number of possible bugs. Lisp programs should pass in the project > >> instance; this is preferred for new project.el-using code. > > If this is the current trend in project.el development, then I have no > > objections to it. I find it a bit surprising that the original > > motivation for this was something completely different, though. > > I don't know if it's going to be a big direction, but the logic seems > sound for a command like this. > > The original choice was more or less arbitrary. The change in the patch > is backward-compatible, so it shouldn't hurt. > > The particular benefit scenario that I can see is this: > > * The project directory has been deleted, but a number of its buffers it > still around. > * So it doesn't seem feasible to compute the project instance > automatically (the project markers are gone, etc). > * But if something has held onto a project object, its method > (project-buffers) might feasibly complete without errors. > > For project-kill-buffers in particular it seems like a real advantage - > getting to clean up buffers belonging to an already deleted project. And > if one step 2 or 3 fails with an error, oh well, it doesn't seem like we > could have done better. My question for this scenario would be: does project.el support it in general? I'd expect quite a few of the functions to rely on the fact that the project directory is there, in which case this is the tip of a very large iceberg. But you know the code and the design much better than I do, so if it makes sense to you, fine.