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#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running Date: Wed, 2 Nov 2022 00:40:31 +0200 Message-ID: <0ff05982-860b-7338-8bb6-50ac09cc376a@yandex.ru> References: <87sfj8umwb.fsf@posteo.net> <8e31a89d-e35e-6dd0-a8e3-f0b9684c8bfa@yandex.ru> <87v8o3wgq1.fsf@gmail.com> <87ilk2x1si.fsf@gmail.com> <871qqq7l9p.fsf@posteo.net> <87eduqwekz.fsf@gmail.com> <87wn8invbx.fsf@posteo.net> <877d0iw8iq.fsf@gmail.com> <837d0hhlke.fsf@gnu.org> <46ff0065-5645-ef1e-2621-242fb6a73f98@yandex.ru> <87v8o0uxn5.fsf@gmail.com> <787a4362-7ff5-7dbb-9118-16e4bee5f328@yandex.ru> <87edunvhf2.fsf@gmail.com> <6d4d9e72-1bae-4d64-b7c1-c2b9c11e396f@yandex.ru> <87tu3jgdbv.fsf@posteo.net> <87h6zihq3q.fsf@posteo.net> <87bkpqecpv.fsf@posteo.net> <39e79ad3-66df-3aa9-cc3f-c5868bfbc6a2@yandex.ru> <87wn8ecu5s.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23649"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cc: Eli Zaretskii , 58839@debbugs.gnu.org, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 01 23:41:11 2022 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 1opzwU-0005wk-Au for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Nov 2022 23:41:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opzwO-0000hT-K5; Tue, 01 Nov 2022 18:41:04 -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 1opzwN-0000gx-Gh for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 18:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opzwN-00055z-7w for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 18:41:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opzwM-000642-3B for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 18:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2022 22:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58839 X-GNU-PR-Package: emacs Original-Received: via spool by 58839-submit@debbugs.gnu.org id=B58839.166734244323275 (code B ref 58839); Tue, 01 Nov 2022 22:41:02 +0000 Original-Received: (at 58839) by debbugs.gnu.org; 1 Nov 2022 22:40:43 +0000 Original-Received: from localhost ([127.0.0.1]:44411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opzw2-00063L-KK for submit@debbugs.gnu.org; Tue, 01 Nov 2022 18:40:43 -0400 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:39807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opzvz-000637-Ju for 58839@debbugs.gnu.org; Tue, 01 Nov 2022 18:40:40 -0400 Original-Received: by mail-wm1-f51.google.com with SMTP id i5-20020a1c3b05000000b003cf47dcd316so209115wma.4 for <58839@debbugs.gnu.org>; Tue, 01 Nov 2022 15:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=hLYuRGGCo12V3KLBoBAJ+2BiaYkKMr30E+AzaZd+UoI=; b=ligsoTQh6lKjDBzc/gmB2iQJCSQ4BSnd55UyhbY8xB9+EXpFxXY5g1gvge/dHEyq5/ sWFk20imJGkfly3L28JX/LmsNwRnjHz6XPr3M18GJeRDIdUvaUKnvDymojHFmCENHgWP AbV1XqfW8h4GlOBMxeAzIpTgP4OWYNjmT3SeqP9fhle6oFlKwSSoY3YmuWcFjqc423QO cGphsRxYl8i3KtPvsV9WQNZwpfsdW+06Z54zITjeOU7w+vgrGdtu0BY1Ep9mfhRKmm0d iR771SywximHsiNGrJbiMxotA5vOeDQTRqoYqgTo32DZ44SOK4Uy8INM6zroiUaD/uq2 w8nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hLYuRGGCo12V3KLBoBAJ+2BiaYkKMr30E+AzaZd+UoI=; b=y+hXWi+522Ft2etyl6U9cxS/Lpky6tEL7PpD2fv5xRwk5r6YKppqeEkrBvUmQMpmg0 BNsIHeeiUjaZM5O9Jwo+7EpHsmNmNOAk9hxkZk41foNP1uB2mSTOPt7gUCWqKnrxpurT 86RBIhxtkw1KU/b7/Mp0MI6Jp1TFCiNQVAXCIj6EAoR/71LnzPcCCByyudLVmauuqJd4 7KBep9VXbKlQ3WDhZa49ESxWieHC3uUPJKWVoldHNdD99yGFWpG1GLVqN9Vs388WHPbr nytXs/J1AwSm8VoNlGTIARtw4CdzM2pUtHqxvZv8YapQdihUq2bmN4bExCa/wDUwUurL Md6Q== X-Gm-Message-State: ACrzQf1MT0DmutqSMlCBlf4BgE+mqssiTELHFV/t69jjt37GDglQF6nT gkU4u7aM6WR2Fwp0QF8hTHk= X-Google-Smtp-Source: AMsMyM4qbjDPCE6wvHhAV/RrFIOCJBRY2BUfJhDsTX17XDXssUJZytivJboJj/x7l2AG8/AdHQeedg== X-Received: by 2002:a05:600c:3b88:b0:3c6:cef8:8465 with SMTP id n8-20020a05600c3b8800b003c6cef88465mr23287139wms.64.1667342433556; Tue, 01 Nov 2022 15:40:33 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id p125-20020a1c2983000000b003c21ba7d7d6sm22647wmp.44.2022.11.01.15.40.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 15:40:33 -0700 (PDT) Content-Language: en-US In-Reply-To: <87wn8ecu5s.fsf@posteo.net> 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246819 Archived-At: On 01.11.2022 22:10, Philip Kaludercic wrote: > Dmitry Gutov writes: > >> On 01.11.2022 20:44, Philip Kaludercic wrote: >> >>>> Sure, but only after we're ready to drop project.el support for Emacs >>>> older than 29. >>> The functionality can be provided using Compat[0], as is already >>> done for a >>> few core package that are distributed on GNU ELPA (ERC, python-mode). >>> [0] https://elpa.gnu.org/packages/compat.html >> >> I suppose if the performance improvement is shown to be significant, >> we could. I'm a little hesitant to add a new dependency: I haven't >> been following this package, not sure how stable it is. > > I am the maintainer, so I am biased, but stability is a high priority, > which is why the library is extensively tested, where-ever possible: > > https://git.sr.ht/~pkal/compat/tree/master/item/compat-tests.el > > Fun fact, I came up with the idea for this library when working on > project-kill-buffer over two years ago, as a means of extracting the > language out of project.el, as has been done with buffer-match-p. Oh ok. I suppose I don't mind, then. It would be nice to have some benchmark, however, at what number of buffers the optimization brings some perceptible difference (like, the delay is reduced by 50ms at least). >>>>> +(defcustom project-buffer-conditions >>>> >>>> Why not keep considering unknown buffers as part of project by default? >>> What are "unknown buffers"? >> >> Take whatever special buffer belonging to jsonrpc that was the cause >> of this bug report. It can still be useful to be able switch to it >> using project-switch-to-buffer (if, say, one was looking for the >> specific buffer to try to debug a problem with some Eglot feature in >> their project). We don't want to kill it with the rest of the buffers, >> however. Apparently. > > Ah, right. I have to admit that I rarely use project-switch-to-buffer, > so I forgot about that. In that case, project-kill-buffer-conditions > cannot be deprecated, as these are just a subset of the project buffers. There can be other uses for 'project-buffers' as well, like the reimplementation of projectile-ibuffer in another bug report. >>>> We'll just stop killing them on cleanup. >>>> >>>> Otherwise, we'll really need an extensible mechanism for major modes >>>> all around the ecosystem to tag themselves as project-visible. >>> Wouldn't a simple buffer local variable suffice? >> >> I guess it will. Only with a more meaningful name than 'project-owned' >> and some proper documentation. > > Right. Does it have to have a "project-" prefix, or would > "belongs-to-project" (hypothetically) be fine too? Let's keep to the module-prefixing strategy. I think it makes sense, and the rest of the symbols in project.el are named that way. >>>>> + '(and (or buffer-file-name >>>>> + (derived-mode . compilation-mode) >>>>> + (derived-mode . dired-mode) >>>>> + (derived-mode . diff-mode) >>>>> + (derived-mode . comint-mode) >>>>> + (derived-mode . eshell-mode) >>>>> + (derived-mode . change-log-mode)) >>>>> + project-includes-buffer-p) >>>>> + "A buffer predicate for matching what buffers belong to a project." >>>>> + :type 'buffer-predicate) >>>> >>>> Let's not forget Xref, Occur, VC-Dir, Log-View. Maybe some others. >>> This is my point, I think João is right that this ought to be an >>> enumeration of major modes that are related to projects. As this is a >>> user option, users can add or remove whatever modes they disagree on and >>> that behaviour would ideally be propagated to all projects. >> >> Being to customize it is a good thing. >> >> But either we provide a reasonably complete list which we regularly >> update, or we say its completeness is up to the user. > > I would want to argue that the complete list is preferable. Then we'll have to keep updating it from time to time. >> And in the latter case, as soon as the user customizes the var, they >> stop getting any updates we might make to it later (to the default >> value). >> >> And if we take the strict "whitelist" approach, I'm pretty sure the >> list will require updating in the future, it will never be complete. > > Which is fair, but which can also be combined with (unfinished)