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>, emacs-devel@gnu.org
Subject: Re: xref and leaving "temporary" buffers open
Date: Sat, 25 Jul 2015 18:51:57 +0300	[thread overview]
Message-ID: <55B3B09D.2040706@yandex.ru> (raw)
In-Reply-To: <864mkscpt2.fsf@stephe-leake.org>

On 07/25/2015 04:47 PM, Stephen Leake wrote:

> Better for xref to cache the info it gathered from the buffer (assuming
> that's significantly smaller, and faster to access, than the buffer).

Whatever the format of that info, it probably won't work between 
invocations of xref commands with slightly different inputs.

And xref-query-replace is currently implemented via the same mechanism 
as what query-replace-regexp uses, which means it needs to visit every 
buffer in a normal way anyway.

>> This should be made customizable.
>
> Yes. Also provide flush- or refresh-cache functions.

These seem to be separate issues. We might ask the user whether to 
revert an "open" buffer (not one in the cache).

And regarding refresh-cache, I'd rather each application that needs a 
buffer from the cache reverted only the buffers it needs. Maybe the new 
function that opens and cached that kind of buffers (like 
find-file-in-cache), would even do that automatically.

> One use case would be "goto buffer in project", that completes only on
> buffers visiting files that belong to a project (in the xref "project"
> sense). The buffers could have a property "projects" that was a list of
> some project name/id/root directory.

So far, this could be implemented via an arbitrary buffer-local 
variable. Or just simply looping through (buffer-list) and checking 
buffer-file-name against the project-directories; that should be fast 
enough, with reasonable number of open buffers.

> Another use case (that I've actually implemented differently) is
> deleting all buffers that were fetched by a front end to git as part of
> reviewing a commit (they display old versions of files).

Don't you think vc-revision-other-window provides a reasonable solution, 
by adding a suffix to a buffer's name? If that's not enough (for 
instance, if we want to delete them all later, and matching names to 
.*\.~.+~ is not precise enough, we could use a buffer-local var as well).

> Functions for deleting some buffers based on such buffer properties
> would also be useful. In the projects case, the buffer would not
> actually be deleted until there was only one project property left.

What if the user opened it using switch-to-buffer, not using "goto 
buffer in project"? Then it wouldn't have this property set, right?



      parent reply	other threads:[~2015-07-25 15:51 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-25  0:47 xref and leaving "temporary" buffers open Dmitry Gutov
2015-07-25  7:27 ` Eli Zaretskii
2015-07-25 13:26   ` Dmitry Gutov
2015-07-25 14:07     ` Eli Zaretskii
2015-07-25 14:24       ` Dmitry Gutov
2015-07-25 14:36         ` Eli Zaretskii
2015-07-25 15:09           ` Dmitry Gutov
2015-07-25 15:27             ` Eli Zaretskii
2015-07-25 16:07               ` Dmitry Gutov
2015-07-25 16:15                 ` Eli Zaretskii
2015-07-25 16:28                   ` Dmitry Gutov
2015-07-25 16:38                     ` Eli Zaretskii
2015-07-25 17:03                       ` Dmitry Gutov
2015-07-25 18:17                         ` martin rudalics
2015-07-25 18:30                           ` Dmitry Gutov
2015-07-27 17:34                             ` Nix
2015-07-28 13:30                               ` Dmitry Gutov
2015-07-29 15:02                                 ` Nix
2015-07-25  8:28 ` martin rudalics
2015-07-25 13:36   ` Dmitry Gutov
2015-07-25 14:12     ` martin rudalics
2015-07-25 14:44       ` Dmitry Gutov
2015-07-25 15:53         ` martin rudalics
2015-07-25 20:12           ` Dmitry Gutov
2015-07-26 11:27             ` martin rudalics
2015-07-26 13:50               ` Dmitry Gutov
2015-07-27 16:02                 ` martin rudalics
2015-07-28 12:57                   ` Dmitry Gutov
2015-07-28 13:16                     ` martin rudalics
2015-07-28 13:35                       ` Dmitry Gutov
2015-07-28 15:10                         ` martin rudalics
2015-07-28 15:18                           ` Dmitry Gutov
2015-07-28 15:40                             ` martin rudalics
2015-07-28 19:13                               ` Dmitry Gutov
2015-07-28 23:48                     ` Stefan Monnier
2015-07-29  1:42                       ` Dmitry Gutov
2015-07-30 21:41                         ` Stefan Monnier
2015-08-03  2:12                           ` Dmitry Gutov
2015-08-03  6:47                             ` martin rudalics
2015-08-03 10:10                               ` Dmitry Gutov
2015-08-03 10:45                                 ` martin rudalics
2015-08-03 10:50                             ` Stefan Monnier
2015-07-26 19:00             ` Stephen Leake
2015-07-26 19:11               ` Dmitry Gutov
2015-07-27 16:02               ` martin rudalics
2015-07-28  1:32                 ` Stephen Leake
2015-07-25 13:47   ` Stephen Leake
2015-07-25 14:19     ` martin rudalics
2015-07-25 15:51     ` Dmitry Gutov [this message]

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=55B3B09D.2040706@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --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.