[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: accessing the Linux clipboard...
- Subject: Re: accessing the Linux clipboard...
- From: Paul Lagasse pglagasse@xxxxxxxx
- Date: Sun, 08 Feb 2009 15:15:20 -0500
Carl Distefano wrote:
Occasionally in Xy4 you get a mismatch between the DeFined block
displayed on the screen and the text that is actually DeFined. This
happens in non-eXPanded views; when you switch to eXPanded view, the
actual DeFined block is revealed. It's a rare occurrence under
DOS/Windows; maybe it happens more frequently under Dosemu. I've never
really tried to figure out what triggers it, but you might be able to
avoid it by massaging your DeFine key assignment, perhaps like this:
nn=BX(,e,s,),DOFFDF
Thanks; I'll give it a try. I think that, at least as far as my own
Dosemu setup is concerned, the problem with SAveDef has been pretty
frequent. CoPy does not seem to be affected at all.
If that worked, then you could use SaveDef to send DeFined text to the
clipboard, changing the end-of-line character to Ascii-10 before doing
so, then restoring CrLfs to the DeFined block immediately afterwards
(the following code examples are XYENCoded, and are repeated in
XPLeNCODE further below):
',*',_SaveDef_method'^
'DZ~>0~>
'BXes_1'Q2
'DB'BXch/s_/;~[/~J/'Q2
'BXsad/nv_\xy4\clip\frxy'Q2
'BXch/s_/~J/;~[/'Q2
'BXdo/nv_system_xytonix.sh'Q2~
~~~'^
But if SaveDef isn't salvageable, you could still streamline your
routine. In particular, avoid XyWrite's "clipboard". It's nothing more
than a Save/Get (S/G 1816); if you stuff more than a few KB of text
into it, you'll break the memory bank. Since you're opening your file
"frxy" in the adjacent window, you can use func CP to CoPy the DF
block into the file. Also, rather than CAll... IF... NEw, I'd
simply ERNV (ERase No Verify) the file and use NEw/100 every time (the
"/100" switch forces eXPanded view). It's faster than DeFining
everything and rubbing it out. I'd also add a GOFILE check, so that,
if the file is already open in another window, you can ABort it:
',*',_CoPy_method'^
'DZ~>0~>
'BXes_1'Q2
~
'BXgofile_~'Q2
~)~>'BXab'Q2~
'BXernv_~'Q2
'BXne/100_~'Q2
'CP'TF
'BXch_/;~[/~J/'Q2
'BXst/nv_~'Q2
'BXdo/nv_system_xytonix.sh'Q2'GT~
~~~'^
Here are the two routines again:
XPLeNCODE v2.0
b-gin [UNTITLED]
;*; SaveDef method[cr|lf]
[DZ_]{<}IF{<}VA$DE{>}>0{>}
[BX_]es 1[Q2_]
[DB_][BX_]ch/s /[wC]/{010}/[Q2_]
[BX_]sad/nv \xy4\clip\frxy[Q2_]
[BX_]ch/s /{010}/[wC]/[Q2_]
[BX_]do/nv system xytonix.sh[Q2_]
{<}EX{>}{<}EI{>}{<}PRNothing DeFined{>}{<}EX{>}
[cr|lf]
[cr|lf]
;*; CoPy method[cr|lf]
[DZ_]{<}IF{<}VA$DE{>}>0{>}
[BX_]es 1[Q2_]
[BX_]ernv \xy4\clip\frxy[Q2_]
[BX_]ne/100 \xy4\clip\frxy[Q2_]
[CP_][TF_]
[BX_]ch /[wC]/{010}/[Q2_]
[BX_]st/nv \xy4\clip\frxy[Q2_]
[BX_]do/nv system xytonix.sh[Q2_][GT_]{<}EX{>}
{<}EI{>}{<}PRNothing DeFined{>}{<}EX{>}[cr|lf][cr|lf]
-nd
XPLeNCODE
Again thanks. I guess my "improvements" with respect to saving text to a
macro would run up against the same sort of limitations that Xy4's
clipboard has.
Rather than test out SAD, I'll just adopt your suggestions for CoPy;
it's a case of my knowing for certain what works.
P.S. I wonder if the xytonix.sh script can be tweaked so that input
from "frxy" stops when the EOF char is encountered?
The limitation of my solution, removing the EOF character, is that it
only removes it, so it would not be useful to someone who is using
Document Info. Yr approach would be more universal, but this amateur
doesn't have a solution at present.
I have one issue with my nixtoxy.pm, the current version of which is
encoded below:
XPLeNCODE v2.0
b-gin [UNTITLED]
[BX_]es 1[Q2_]{<}SV01,\xy4\clip\toxy{>}[BX_]do/nv unix xclip{032}
-o -selection c > /home/pgl/data/xy4/clip/toxy[Q2_][BX_]ca/10
0 {<}PV01{>}[Q2_][BX_]ch /{010}/[wC]/[Q2_][BX_]st/nv {<}PV01{
{062}}[Q2_][GT_][BX_]me {<}PV01{>}[Q2_][BX_]es 0[Q2_]
-nd
XPLeNCODE
I discovered that when I use this to insert text into a newly created
UNTITLED file with no text, the UNTITLED file is lost. Otherwise, the
XPL program seems to run OK -- a space or carriage return, or a space
that is inserted and then deleted, is enough to keep the file from being
lost and permit the insertion of the Linux clipboard contents.
Paul Lagasse