all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Dmitry Gutov <dgutov@yandex.ru>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: xref and leaving "temporary" buffers open
Date: Sat, 25 Jul 2015 17:53:32 +0200	[thread overview]
Message-ID: <55B3B0FC.3080004@gmx.at> (raw)
In-Reply-To: <55B3A0B6.6080101@yandex.ru>

 > A distinction between loaded and open buffers might help with that as well.

I have thought about this before and am quite sure it's needed.  I don't
want to see such buffers in the buffer list and don't want to
accidentally switch to them.  Actually, it's what keeping me to use the
preprocessor solution at the moment.

 >> N > 1 means that such a buffer has been visited at least twice so
 >> chances are that it will be visited again in the near future and it
 >> might make sense to keep it around for some time.
 >

 > That may be useful for your eldoc problem, but not so much for
 > xref. In the latter case, the issue is not of opening a particular
 > buffer many times, but of opening many buffers 2 or 3 times.

In the eldoc case this might happen as well.  Over the time buffers pile
up.  And I practically never want to switch to them (which is the only
detail I can supply so far).

 > A cache is a set of buffers. Okay. How is it implemented? Does
 > switch-to-buffer know they're in the cache? Does it take them out of
 > the cache?

All file visiting functions must be aware of it and take it out.  As far
as implementation is concerned we have the usual two choices: Pass an
extra argument (clean but costly) or bind some variable around the calls
that visit the file in the background which is probably the way to go.

 > If I add an option for *every* reasonable way to handle this (which is
 > already a tall order), what could time tell afterwards?

The "*every* reasonable way" solution applies only where such
customizations are cheap to implement and the behavior is not easily
predictable.  As fas as querying the user for whether to revert buffers
I see no problem in doing that.  Personally, I'd never opt for a
solution where I'm asked for each file individually.  But the options
"never auto-revert", "always auto-revert without asking" and "if at
least one file is stale ask whether to auto-revert all" seem all pretty
reasonable to me and I would probably try them out.

 > I think a list of applications is going too far. As long as the
 > cleanup is only performed when Emacs is idle (and has been idle for a
 > while, probably), I think we could could on those applications to
 > reopen buffers as needed. For special faces, we could have a second
 > flag, "do not clean up".

OK with me.  My main concern is that such buffers don't show up in my
buffer lists and so one flag is sufficient.

 > Whether doing cleanup is at all necessary is a matter of opinion, but
 > I guess it might be useful to conserve memory. Maybe that subsystem
 > could be smart enough to only trigger cleanup when the buffers exceed
 > a certain amount of memory, and tries to kill the oldest opened
 > buffers first.

The least recently accessed ones, I suppose.  So somewhere we might want
to maintain a timestamp of the least recently background access of these
buffers.

martin



  reply	other threads:[~2015-07-25 15:53 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 [this message]
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

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=55B3B0FC.3080004@gmx.at \
    --to=rudalics@gmx.at \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.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.