[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



Assume that the Programmer's Apprentice is running as an independent process
with its own little window and stack group and such. There is a queue of 
requests which the apprentice looks at to decide what to do. When empty, the
apprentice sits bored. From Zwei I know how to submit things to the queue
in a way that the Apprentice will find them. I do not, however, know how to
let the apprentice talk to Zwei in order to have the results put into an
Emacs buffer.

In particular, I need the following function:

  (ZWEI:UPDATE-DISPLAY-OF-INTERVAL-IF-EXPOSED interval)

  Given any interval, if any Zwei editing window is exposed which is displaying
  the given interval, ask that the display of the interval be updated if necessary
  because changes have been made to the interval by an asynchronous process.

This is because the Programmer's Apprentice can find the relevant interval
just fine from the ZWEI:ZMACS-BUFFERS property of functions. Having found the
interval, it can delete the old definition and insert a new one in its place.
If Zwei is displaying the interval at the time, it does not show the modification
unless the guy types Control-L or Clear-Screen or whatever.

Also, there is potential for timing errors when I do this updating of the
interval. If Zwei is simultaneously hacking that interval, one or both may
lose. It would be nice if there were a way I could get a lock on an interval\n from another process so that Zwei would momentarily block on modifying that
interval until the Programmer's Apprentice had freed the lock.

I expect some real problems in making this all work without lossage, but
I think it is important to look into these kinds of tasks. It seems, in the
abstract, like just the right thing -- to have the Programmer's Apprentice
be able to be modifying one part of the buffer while I am off modifying another
part. That's sort of what an apprentice is all about.

I would appreciate any ideas/comments on this problem and/or the mode of
interaction I am describing. Getting something powerful like this to work is 
currently a priority issue with the Programmer's Apprentice project. 

Thanks,
 -kmp