Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does COPYINSERT go through PROCESS.TTY ? #1818

Open
rmkaplan opened this issue Aug 27, 2024 · 2 comments
Open

Why does COPYINSERT go through PROCESS.TTY ? #1818

rmkaplan opened this issue Aug 27, 2024 · 2 comments

Comments

@rmkaplan
Copy link
Contributor

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
Copy link
Member

masinter commented Sep 1, 2024

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
Copy link
Contributor Author

rmkaplan commented Sep 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants