Interlisp / medley

The main repo for the Medley Interlisp project. Wiki, Issues are here. Other repositories include maiko (the VM implementation) and Interlisp.github.io (web site sources)
https://Interlisp.org
MIT License
376 stars 19 forks source link

Why does COPYINSERT go through PROCESS.TTY ? #1818

Open rmkaplan opened 2 months ago

rmkaplan commented 2 months ago

I have been trying to debug the problem that @pamoroso reported in #1806 (\TEDIT.COPYINSERTFN doesn't exist).

There were several glitches and misunderstandings about the COPYINSERT protocols. But there is something in the definition of COPYINSERT that makes this difficult and doesn't make sense to me. Maybe somebody can explain...

COPYINSERT identifies the target window of the current TTY process by (WFROMDS (PROCESS.TTY (TTY.PROCESS))). WFROMDS has a special kludge for Tedit that actually doesn't do the right thing in this case. The reason is that PROCESS.TTY returns the backing display stream of the Tedit textstream instead of the textstream itself, WFROMDS doesn't see that that stream has an associated window, and so it creates one on the fly and tries to do the insertion there.

COPYINSERT works for Tedit if it is changed so that it gets the target window more directly by (PROCESSPROP (TTY.PROCESS) 'WINDOW). This avoids going down to any backing display stream for Tedit or anything else, stays at the level of the TTY process (in this case the Tedit process) and its window.

Is there any reason not to make this change? Is there a better way of cleaning this up?

masinter commented 2 months ago

Is there any reason not to make this change? Is there a better way of cleaning this up?

I don't think these questions can be answered easily. Does TTY.PROCESS always return a process that has a WINDOW processprop? When does COPYINSERT get called, by what?

rmkaplan commented 2 months ago

COPYINSERT gets called by various applications (TEDIT, Sketch, CLIPBOARD, SPY ,,,) to insert something (an image object or string) into the window that currently has the TTY. It has always caused an error if it can't get to a window.

On Sep 1, 2024, at 12:16 PM, Larry Masinter @.***> wrote:

Is there any reason not to make this change? Is there a better way of cleaning this up?

I don't think these questions can be answered easily. Does TTY.PROCESS always return a process that has a WINDOW processprop? When does COPYINSERT get called, by what?

— Reply to this email directly, view it on GitHub https://github.com/Interlisp/medley/issues/1818#issuecomment-2323465733, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQSTUJOW5NJTXZNG5Z2RNZTZUNRX7AVCNFSM6AAAAABNGXMGP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGQ3DKNZTGM. You are receiving this because you authored the thread.