On Fri, Mar 15, 2002 at 02:40:35PM +0100, Asger K. Alstrup Nielsen wrote:
> > How does the undo architecture look like? Maybe even one that does not
> > work on the outer paragraph level only, but on smaller scopes if possible?
> 
> Conceptually, you can handle undo by having a stack of documents.

That's what I do in my own stuff until 'things get big'. Of course things
never get big ;-)

> Now, you want smaller scope. I presume this is because you want local
> undo. (You can still do this, just with stacks of paragraphs, but
> ignore that for now.)

[For performance/memory reasons, not for functionality. The stack based
method 'just works'.]

> If you want local undo, you will still run into the problem of
> ownership and references to buffer-wide data:

*gosh*

My point is:

   THERE IS NO NEED TO STORE REFERENCES TO BUFFERWIDE DATA IN THE INSET.

> Consider a paragraph with an inset that references a buffer-wide
> bibliographic entry.
>
> In the next paragraph, there is another inset that also references
> this buffer-wide bibliographic entry.
> 
> Now, you cut the first inset, and then change the bibliographic
> entry.
> 
> If you had local undo, you would then be able to undo the first
> cut, and keep the changing of the bibliographic entry.
> 
> What should the result be after this local undo?

I don't understand you. Maybe one should tell me what "a bibliographic
entry" is. Something that translates to  "\cite{FooBar1998}"?

If so the bibliographic entry stores the key. A string. Just that. Not
the full database. And not a pointer to a database. Never.

Whenever something "interesting" should happen (like looking whether this
key exists in some .bib file), the function gets passed a ref to the
file/database/whatever. 

> It is not the job of the parent paragraph to decide what
> the insets refer to. It is the job of the inset to know
> what it refers to.

It is the job of every inset to pass down to its children stuff it can't
handle by itself...

Andre'

-- 
André Pönitz .............................................. [EMAIL PROTECTED]

Reply via email to