all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Cc: Philip Kaludercic <philipk@posteo.net>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: [PATCH] Speed up project-kill-buffers
Date: Mon, 17 May 2021 00:58:06 +0300	[thread overview]
Message-ID: <d48214e8-6010-95f0-9109-ee166b421212@yandex.ru> (raw)
In-Reply-To: <86im3i76xa.fsf@stephe-leake.org>

On 16.05.2021 23:36, Stephen Leake wrote:
> Which means you need to provide an option for the times when we want the
> other behavior: C-u kills root and external-roots, plain kills root only.

I wouldn't mind adding an option, but that presents a difficulty.

At the moment, we call `project-current` in each buffer and compare the 
returned value to the "current" project instance. That wouldn't work for 
external roots no matter what option we add because a given file inside 
"external root" can belong (in an "extended" sense) to several projects 
at once, so there's no logical way to obtain the project instance we're 
looking for based on such external file. Right?

A generic like project-contains? I previously mentioned would have a 
problem that every project backend's implementation would have to obey 
such an option, which creates new possibility for bugs and diverging 
behaviors.

If the current project-kill-buffers doesn't work for you (please check; 
IIRC your backend's peculiar behavior might have an upside in this 
case), what we could more easily do is create an option like 
'project-list-buffers-function'. The default would delegate to 
project-current. The alternative could indeed use file-in-directory-p 
(or a string comparison to similar effect) as discussed in this thread, 
providing a different inclusion semantics and improved performance, and 
the third alternative value could enable looking in external roots as well.



  reply	other threads:[~2021-05-16 21:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03  9:43 [PATCH] Speed up project-kill-buffers Philip Kaludercic
2021-05-03 12:46 ` Stefan Monnier
2021-05-03 13:06   ` Philip Kaludercic
2021-05-03 13:24     ` Stefan Monnier
2021-05-03 17:25       ` Philip Kaludercic
2021-05-03 21:12         ` Dmitry Gutov
2021-05-08 12:03       ` Stephen Leake
2021-05-08 12:30         ` Philip Kaludercic
2021-05-08 13:05           ` Philip Kaludercic
2021-05-08 17:01           ` Dmitry Gutov
2021-05-08 17:10         ` Dmitry Gutov
2021-05-16 20:36           ` Stephen Leake
2021-05-16 21:58             ` Dmitry Gutov [this message]
2021-05-19 23:37               ` Stephen Leake
2021-05-20 12:16                 ` Stephen Leake
2021-05-25  1:30                   ` Dmitry Gutov
2021-05-30 17:19                     ` Stephen Leake
2021-05-25  1:24                 ` Dmitry Gutov
2021-05-30 17:51                   ` Stephen Leake
2021-08-09  3:01                     ` Dmitry Gutov
2021-05-03 21:43 ` Dmitry Gutov
2021-05-03 22:45   ` Stefan Monnier
2021-05-03 22:46     ` Dmitry Gutov
2021-05-04  6:25       ` tomas
2021-05-04 10:40         ` Dmitry Gutov
2021-05-04 11:26           ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d48214e8-6010-95f0-9109-ee166b421212@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=philipk@posteo.net \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.