On Tuesday 16 Dec 2003 5:37 pm, Angus Leeming wrote:

> I don't think that a mechanism exists currently to 'export' a block
> of text to the outside world, or to 'import' a block of text in place
> of an existing block.
>
> Actually, it shouldn't be too hard. How would you identify the
> 'scrap' you want to export? Would you mark (highlight) a block of
> text or would you 'deduce' the block from the position of the cursor?

Deduce I think - a matter of taste I suppose.

> Either way, I can imagine an lfun, "export-scrap", that simply posts
> this block, however identified, to the 'out' pipe of the lyxserver.
>
> Similarly, I can imagine an lfun, "import-scrap <data>" that replaces
> the block, however identified, with <data>.
>
> That is all that LyX needs to do. The rest, opening and closing a
> console/vi session, would be the job of whatever has opened the pipe
> connection with LyX.
>
> Would this fit the bill?

Sounds promising - is there any doc beyond Extended.lyx - I am far from being 
a latex hero, but I'll have a go.  Customization.lyx and 
development/server_monitor.c would be the place to start I suppose.

Functionally :

Lyx would have an extra toolbar button - possibly conditional on exiting a 
noweb document type.

Clicking on this or using an associated key binding would spawn a gvim based 
client if
  the cursor was in a 'scrap' paragraph (scrap in the paragraph type selector 
box) and
  one was not already running (external prog can deal with that)

Then the external program would be fed the scrap down its pipe and become 
active and allow editing.

On exit (? or just on write...) the external program would emit the processed 
scrap from its output pipe and lyx would display it, replacing its previous 
paragraph.

Some complaint or default action would deal with scrap selection changing 
during external edit.

The external program should behave sensibly when lyx exited etc.


Any pointers to docs supporting the lyx side of this kind of thing would be 
useful - an example of a similar facility would be ideal

Reply via email to