From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Devlin Newsgroups: gmane.emacs.bugs Subject: bug#58933: 28.2; project-buffers should take an optional filter Date: Fri, 4 Nov 2022 13:11:07 -0400 Message-ID: References: <0EDC4306-3724-468F-8F0D-0470304A538D@toadstyle.org> <0540bf68-7419-f679-ef1c-fb4d8e978a4b@yandex.ru> <45027bdd-37ec-5a9e-0cb9-79f6d5df23fa@yandex.ru> <87fsezusgg.fsf@posteo.net> <3AF36AF3-F7A4-4BEC-A5C2-E6F2C151EE26@toadstyle.org> <87h6ze7in5.fsf@posteo.net> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.51\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_25885192-7A75-407B-A049-F802D752036E" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13355"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58933-done@debbugs.gnu.org, Dmitry Gutov To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 04 18:12:20 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 1or0Es-0003G0-MY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Nov 2022 18:12:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1or0Ee-0007DM-Nt; Fri, 04 Nov 2022 13:12: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 1or0Ec-0007Cg-Iw for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2022 13:12:02 -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 1or0Ec-0000RG-Au for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2022 13:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1or0Ec-0004m8-62 for bug-gnu-emacs@gnu.org; Fri, 04 Nov 2022 13:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Nov 2022 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58933 X-GNU-PR-Package: emacs Original-Received: via spool by 58933-done@debbugs.gnu.org id=D58933.166758188818309 (code D ref 58933); Fri, 04 Nov 2022 17:12:02 +0000 Original-Received: (at 58933-done) by debbugs.gnu.org; 4 Nov 2022 17:11:28 +0000 Original-Received: from localhost ([127.0.0.1]:54708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1or0E3-0004lE-H0 for submit@debbugs.gnu.org; Fri, 04 Nov 2022 13:11:28 -0400 Original-Received: from mail-qk1-f170.google.com ([209.85.222.170]:34674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1or0Dz-0004kw-LI for 58933-done@debbugs.gnu.org; Fri, 04 Nov 2022 13:11:25 -0400 Original-Received: by mail-qk1-f170.google.com with SMTP id 8so3468091qka.1 for <58933-done@debbugs.gnu.org>; Fri, 04 Nov 2022 10:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20210112.gappssmtp.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=JRyuEL/41MfYYwVGNBnybzGtlzFVvuSO9Oe/5y88ZQg=; b=SPxqdngVgKhl8aOvMfAg+d+1jZWa2KSQoqZDpIznPXkfd19JAaFyZQa624n9d81wUm CCrfZOy2GI7Vs/Pq0RG1O5+LQJ7Pv4HaomYiL4l5Ar+n4O+QeUSHxnns+eWsCneuYC4F vA1J4bsN2gngaLguo6zf7gR+epKlZbW8eSGALkfxNkMXDcv+R+Gvf+QgO4DCndGviAI+ NENXf6CMCZ6CHKtvrApS9Fw+brXAforwXvwDAU9FuoNr5QD2CNRkcOW7qsBuntSRh0hM UdQ7m2dE8KyXWU6gYbwJw/mV5umnBcqPHgItP5k2TnI1vW7TrOV4tulIPZ8fjTUs/85K 8rug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JRyuEL/41MfYYwVGNBnybzGtlzFVvuSO9Oe/5y88ZQg=; b=LJrBf2t6nU30gy61Mb8hwOQ2h2l4bYB0GC0PrlMSaC3yNcL6Rd5806tNNuxGs+uzDf EBq0m3GSfnv5rmTbD2c5XFz4WWUrv23iVOKHxgVX2b9+iYeODTRSFFfkw/BxyK4yD+Qd vMtwa9bHHenIiB9ASkQ3zo3mDP3XkowRc/N30oi+IInN3vlpxv78nrtDyofv3XGX2iEC Gcc6qfWaxTs1MBwlynEpezjvBpmCtp1diBRM9N/jwbVgo5co6LRw26CpZj+HQNBkWRta majvT99eyiyLyWoNOVp+wTBR9nziXWwcWAcS42jWczthop8rEpDR6B68EDZ34pkZ0NFA j/ag== X-Gm-Message-State: ACrzQf0eMRBZpFzXdRNGY1pcF/qhQoLvVJojo+C/P5kmlW+xKEBzILUt GfYKjavrtYwuTMfvsddS35e1/KKQ9myNQxCuEmU= X-Google-Smtp-Source: AMsMyM4PmhJV6uFJTSHsZUh8D96BuXa++E2jo6luG3gMyBaZvhskiION6AQKeP4SDIY4rDrcGG/XbA== X-Received: by 2002:a05:620a:56b:b0:6fa:3110:5aa8 with SMTP id p11-20020a05620a056b00b006fa31105aa8mr19558428qkp.343.1667581878163; Fri, 04 Nov 2022 10:11:18 -0700 (PDT) Original-Received: from smtpclient.apple (pool-173-56-106-162.nycmny.ftas.verizon.net. [173.56.106.162]) by smtp.gmail.com with ESMTPSA id u32-20020a05622a19a000b00398a7c860c2sm2852953qtc.4.2022.11.04.10.11.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2022 10:11:17 -0700 (PDT) In-Reply-To: <87h6ze7in5.fsf@posteo.net> X-Mailer: Apple Mail (2.3731.300.51) 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:247100 Archived-At: --Apple-Mail=_25885192-7A75-407B-A049-F802D752036E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Nov 4, 2022, at 1:07 PM, Philip Kaludercic = wrote: >=20 > Sean Devlin > writes: >=20 >> Hi folks, >>=20 >>> On Nov 4, 2022, at 2:47 AM, Philip Kaludercic > wrote: >>>=20 >>> Dmitry Gutov = > writes: >>>=20 >>>> On 02.11.2022 16:17, Sean Devlin wrote: >>>>> Hi Dmitry, >>>>>=20 >>>>>> On Nov 1, 2022, at 7:38 PM, Dmitry Gutov = wrote: >>>>>>=20 >>>>>> Hi Sean, >>>>>>=20 >>>>>> On 01.11.2022 00:04, Sean Devlin wrote: >>>>>>=20 >>>>>>> Project.el provides a function project-buffers that returns a = list of >>>>>>> buffers associated with the given project. The list is = unfiltered, >>>>>>> meaning any program using it will have to do some work to pick = out the >>>>>>> buffers of interest. It would be useful if the function had an = optional >>>>>>> argument to do this work. >>>>>>> Project.el already has a function project--buffer-check that = validates a >>>>>>> buffer against a list of conditions. Maybe it should be wired = into >>>>>>> project-buffers to do the job of filtering? >>>>>> There is also 'match-buffers' and 'buffer-match-p' in the core >>>>>> Emacs starting with Emacs 29 (should also be available with the >>>>>> 'compat' package). >>>>>>=20 >>>>>> What do you think about these alternatives? >>>>> Thanks for the pointer=E2=80=94I wasn=E2=80=99t aware of these = functions. (I=E2=80=99m still on 28.2.) >>>>> It looks like these do fit the bill. For example, it looks like I >>>>> could write: >>>>> (match-buffers condition (project-buffers project)) >>>>> I can=E2=80=99t see these functions in my local installation of = compat >>>>> (056e3cc), but maybe definitions from Emacs 29 haven=E2=80=99t = been added >>>>> yet? In any case, I=E2=80=99m happy to wait a little bit. >>>>=20 >>>> Right, I'm not seeing it in there either. Perhaps it'll get there >>>> after Emacs 29 is released. >>>=20 >>> Right, Emacs 29 support is under development, but hasn't been = completed >>> yet: = https://git.sr.ht/~pkal/compat/tree/emacs-29.1/item/compat-29.el. >>>=20 >>>> Philip, is that the plan? >>>=20 >>> The plan is to be ready by the time Emacs 29 is released. If = possible >>> and I get to it, it might also be released earlier, but at the very >>> least I'll be waiting for the feature freeze later this month. >>=20 >> That sounds good to me. I have a workaround in the meantime, so I=E2=80= =99m >> happy to wait for the new release.=20 >=20 > I don't know what your workaround is, but since both functions > (buffer-match-p, match-buffers) are self-contained, you can also just > copy the current implementation into your local configuration. Right now, I=E2=80=99m using project--buffer-check, which does a very = similar thing. Your suggestion might be better, so I don=E2=80=99t need = to rely on a project.el-internal function. I=E2=80=99ll take a look. = Thanks again! >=20 >> Thanks both for your help, and feel >> free to close this at your discretion. >=20 > OK, done :) --Apple-Mail=_25885192-7A75-407B-A049-F802D752036E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Nov = 4, 2022, at 1:07 PM, Philip Kaludercic <philipk@posteo.net> = wrote:

Sean Devlin = <spd@toadstyle.org> writes:

Hi = folks,

On Nov 4, 2022, at 2:47 AM, = Philip Kaludercic <philipk@posteo.net> = wrote:

Dmitry Gutov <dgutov@yandex.ru <mailto:dgutov@yandex.ru>> = writes:

On 02.11.2022 16:17, Sean = Devlin wrote:
Hi Dmitry,

On Nov 1, 2022, at 7:38 PM, Dmitry = Gutov<dgutov@yandex.ru>  wrote:

Hi Sean,

On = 01.11.2022 00:04, Sean Devlin wrote:

Project.el provides a function project-buffers that = returns a list of
buffers associated with the given project. The list = is unfiltered,
meaning any program using it will have to do some work = to pick out the
buffers of interest. It would be useful if the = function had an optional
argument to do this work.
Project.el = already has a function project--buffer-check that validates a
buffer = against a list of conditions. Maybe it should be wired = into
project-buffers to do the job of = filtering?
There is also 'match-buffers' and = 'buffer-match-p' in the core
Emacs starting with Emacs 29 (should = also be available with the
'compat' package).

What do you = think about these alternatives?
Thanks for the = pointer=E2=80=94I wasn=E2=80=99t aware of these functions. (I=E2=80=99m = still on 28.2.)
It looks like these do fit the bill. For example, it = looks like I
could write:
(match-buffers condition = (project-buffers project))
I can=E2=80=99t see these functions in my = local installation of compat
(056e3cc), but maybe definitions from = Emacs 29 haven=E2=80=99t been added
yet? In any case, I=E2=80=99m = happy to wait a little bit.

Right, I'm not seeing it = in there either. Perhaps it'll get there
after Emacs 29 is = released.

Right, Emacs 29 support is under = development, but hasn't been completed
yet: = https://git.sr.ht/~pkal/compat/tree/emacs-29.1/item/compat-29.el.

<= blockquote type=3D"cite">Philip, is that the = plan?

The plan is to be ready by the time Emacs 29 = is released.  If possible
and I get to it, it might also be = released earlier, but at the very
least I'll be waiting for the = feature freeze later this month.

That sounds good to = me. I have a workaround in the meantime, so I=E2=80=99m
happy to wait = for the new release. 

I don't know what your workaround is, but = since both functions
(buffer-match-p, match-buffers) are self-contained, you can = also just
copy the current = implementation into your local configuration.

Right now, I=E2=80=99m = using project--buffer-check, which does a very similar thing. Your = suggestion might be better, so I don=E2=80=99t need to rely on a = project.el-internal function. I=E2=80=99ll take a look. Thanks = again!


           &= nbsp;           &nb= sp;          Thanks = both for your help, and feel
free to close this at your = discretion.

OK, = done :)

= --Apple-Mail=_25885192-7A75-407B-A049-F802D752036E--