[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-users
Subject:    Re: [ jEdit-users ] Close older buffers
From:       "Patrick Wright" <jedit_users () pdoubleya ! com>
Date:       2004-06-29 10:43:19
Message-ID: 1667.62.206.113.162.1088505799.squirrel () 62 ! 206 ! 113 ! 162
[Download RAW message or body]

> Rather than basing this on timestamps wouldn't it be easier to have a
> 'max open buffers' property and use an LRU list to hold lightweight
> buffer reference objects with a listener that would add new elements
> when a buffer was opened, remove them when closed and bump them when
> accessed and a closure for when the capacity was hit that would call
> into the jEdit core and close the buffer?

Robert

What I think we need at this point is some agreement about what we are
trying to accomplish...there may be more than one set of goals.

Max's goal, as I understood it (and agreed with) is that it is easy to
open up lots and lots of Buffers in JEdit, then to periodically close
them. Having to open a list and decide which ones to close is a
distraction. (I regularly close everything and start again.)

One goal is then:
- To manage open buffers such that the only buffers open at any time are
those that I have been using recently.

Your goal would be a little different, which is, try to have no more than
N buffers open at one time, using a LRU/MRU rule when possible to close
other buffers...these might lead to the same behavior, or might not,
depending on timings and usage patterns.

The further questions for the first goal are
- Is "managing" buffers on-request or automatic?
- What defines "using recently"?

There is a separate design/implementation discussion
- should the "management" be in a plugin or in a macro?
- how should the timestamps for "recent use" be made available?

There have been some specific ideas bandied about

1) A macro closes buffers on request, using info from
  a) what is available now
  b) what could be added to core Buffer class
  c) buffer info from existing plugins (patched)
  d) buffer info from new plugin

2) A plugin monitors Buffers and closes them automatically
  a) using timestamps (BufferLocal had this)
  b) using LRU/MRU algorithm


That's my take on where we are right now.

I have a first cut at 1d working locally, need to polish it and then post
a beta for people to play with, because I think the additional timestamps
are all we need to make the macro very flexible (or have more than one
macro) and it will take too much effort to convince people to change
Buffer in the core, and too much work to update the existing BufferZZZ
plugins.


my .02
Patrick



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
-- 
-----------------------------------------------
jEdit Users' List
jEdit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic