Re: scripting support via lyxserver

2005-02-02 Thread Jean-Marc Lasgouttes
 G == G Milde [EMAIL PROTECTED] writes:

G Feature Request ===

G Could the lfun server-notify take an data argument, that is
G passed on to the lyxserver?

Sure. And what about getting rid of the key binding too? Is it really
useful to the client?

JMarc


Re: scripting support via lyxserver

2005-02-02 Thread G. Milde
On  2.02.05, Jean-Marc Lasgouttes wrote:
  G == G Milde [EMAIL PROTECTED] writes:
 
 G Feature Request ===
 
 G Could the lfun server-notify take an data argument, that is
 G passed on to the lyxserver?
 
 Sure. And what about getting rid of the key binding too? Is it really
 useful to the client?

The keybinding is not really needed. If the code becomes more clear and
concise by removing, please do so.

I thought to keep it for backwards compatibility (however, did actually
anyone use server-notify until now?)

Günter


-- 
G.Milde web.de


Re: scripting support via lyxserver

2005-02-02 Thread Jean-Marc Lasgouttes
 G == G Milde [EMAIL PROTECTED] writes:

G The keybinding is not really needed. If the code becomes more clear
G and concise by removing, please do so.

It does not really change the code. It is just a matter of design of
the lyxsever protocol.

G I thought to keep it for backwards compatibility (however, did
G actually anyone use server-notify until now?)

That's the interesting question, actually :)

JMarc


Re: scripting support via lyxserver

2005-02-02 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes [EMAIL PROTECTED] writes:

 G == G Milde [EMAIL PROTECTED] writes:

| G The keybinding is not really needed. If the code becomes more clear
| G and concise by removing, please do so.

| It does not really change the code. It is just a matter of design of
| the lyxsever protocol.

And that needs some love and care. (read: complete rewrite)

I have that on the agenda... but we must get this CVS thingie released
first.

-- 
Lgb



Re: scripting support via lyxserver

2005-02-02 Thread Jose' Matos
On Tuesday 01 February 2005 15:10, G. Milde wrote:

 These are the first to spring into my mind. There are more to expect. But
 also, they (and the existing ones) must be documented in order to be
 usable.

 My goal is to get for lyx a broad base of user-provided extensions in the
 way we there is for emacs.

  A nice set of goals, if I may say so. :-)

 Sincerely


 Guenter

-- 
José Abílio


Re: scripting support via lyxserver

2005-02-02 Thread Jean-Marc Lasgouttes
> "G" == G Milde <[EMAIL PROTECTED]> writes:

G> Feature Request ===

G> Could the lfun "server-notify" take an data argument, that is
G> passed on to the lyxserver?

Sure. And what about getting rid of the key binding too? Is it really
useful to the client?

JMarc


Re: scripting support via lyxserver

2005-02-02 Thread G. Milde
On  2.02.05, Jean-Marc Lasgouttes wrote:
> > "G" == G Milde <[EMAIL PROTECTED]> writes:
> 
> G> Feature Request ===
> 
> G> Could the lfun "server-notify" take an data argument, that is
> G> passed on to the lyxserver?
> 
> Sure. And what about getting rid of the key binding too? Is it really
> useful to the client?

The keybinding is not really needed. If the code becomes more clear and
concise by removing, please do so.

I thought to keep it for backwards compatibility (however, did actually
anyone use server-notify until now?)

Günter


-- 
G.Milde web.de


Re: scripting support via lyxserver

2005-02-02 Thread Jean-Marc Lasgouttes
> "G" == G Milde <[EMAIL PROTECTED]> writes:

G> The keybinding is not really needed. If the code becomes more clear
G> and concise by removing, please do so.

It does not really change the code. It is just a matter of design of
the lyxsever protocol.

G> I thought to keep it for backwards compatibility (however, did
G> actually anyone use server-notify until now?)

That's the interesting question, actually :)

JMarc


Re: scripting support via lyxserver

2005-02-02 Thread Lars Gullik Bjønnes
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

>> "G" == G Milde <[EMAIL PROTECTED]> writes:
>
| G> The keybinding is not really needed. If the code becomes more clear
| G> and concise by removing, please do so.
>
| It does not really change the code. It is just a matter of design of
| the lyxsever protocol.

And that needs some love and care. (read: complete rewrite)

I have that on the agenda... but we must get this CVS thingie released
first.

-- 
Lgb



Re: scripting support via lyxserver

2005-02-02 Thread Jose' Matos
On Tuesday 01 February 2005 15:10, G. Milde wrote:
>
> These are the first to spring into my mind. There are more to expect. But
> also, they (and the existing ones) must be documented in order to be
> usable.
>
> My goal is to get for lyx a broad base of user-provided extensions in the
> way we there is for emacs.

  A nice set of goals, if I may say so. :-)

> Sincerely
>
>
> Guenter

-- 
José Abílio


Re: scripting support via lyxserver

2005-02-01 Thread G. Milde
On 27.01.05, Jose' Matos wrote:

 This is something that I wanted to do for quite some time. :-)

So did I. That's why I'm glad I did it finally.

   PS: In another movement (no pun John ;-) to help python scripting for lyx 
 the lyx2lyx program has become only a interface to the new LyX.py module.

The main concern of this module is mainly the file format (as it is to be 
 expected from a lyx2lyx evolution), but my goal is make that a more general 
 module. As such the lyx server component will be a nice addition. :-)

IMHO, it would be nice to have a python package for LyX support. This
could comprise 

  Functions and classes for lyx2lyx and tex2lyx   - lyxfiles.py

  Lyxserver communication - lyxclient.py

  A python wrapper for lfuns  - lyxfuns.py
   (using lyxclient.py for now but maybe an 
internal python interface sometimes in the 
future)

  Enhancement modules 
   (word-count, source-editing, external commands 
on the selection, coupling of 2 LyXes, calling 
a BibTeX GUI, ...)

This package should be somewhere in the PYTHONPATH
(/usr/lib/python2.3/site-packages/ on my Debian-testing box)

A set of small executable python scripts (importing from the LyX package)
should go to the PATH
  lyx2lyx
  tex2lyx
  lyx-remote
  lyx-Mx
  lyx-with-pyclient
(there should be a naming contest for the latter three).  
  
  
In order to have a decent scripting/plugin support via the lyxserver, I
have the following 

Feature Request
===

Could the lfun server-notify take an data argument, that is passed on
to the lyxserver? 

   M-x server-notify foobar path 

would then write the line

   NOTIFY:Left:foobar path

to lyxpipe.out


Why?


* Currently, to get a key making something via the lyxclient, 2 bindings at
  2 places are needed. Example

  1. in my.bind   

 \bind  M-w  server-notify# count_words
 
 Sends NOTIFY:M-w
  
  2. in the client (or a configuration file of the client)

 lyxclient.bindings[M-w] = count_words

 Calls count_words() upon notification from key M-w
 
 
* Adding a menu entry would need one more matching binding in the client
  configuration.

* Calling from the minibuffer (M-x prompt) always pretends to come from
  key Left. This allows just one binding.


With the additional data argument, the client can try to map the data to
a function. Binding occures in one place (*.bind and *.ui files) and
using the minibuffer becomes possible.


For serious scripting, some more lfuns are required:

 * a function prompting for input in the minibuffer and returning the
   result.
   
 * a function to get the content of the selection
   (but which format? latex, plain text, lyx source, internal
   representation, ...)
   
 * a function to reinsert this content after some modifications
   (self-insert will not work for math, e.g.)  
   
 * a way to bypass popup dialogues, e.g. push-keypress (or
   simulate-keypress) to simulate a keypress/-release event.

These are the first to spring into my mind. There are more to expect. But
also, they (and the existing ones) must be documented in order to be
usable. 

My goal is to get for lyx a broad base of user-provided extensions in the
way we there is for emacs.

Sincerely
 
 
Guenter 

-- 
G.Milde web.de


Re: scripting support via lyxserver

2005-02-01 Thread G. Milde
On 27.01.05, Jose' Matos wrote:

> This is something that I wanted to do for quite some time. :-)

So did I. That's why I'm glad I did it finally.

>   PS: In another movement (no pun John ;-) to help python scripting for lyx 
> the lyx2lyx program has become only a interface to the new LyX.py module.
>
>The main concern of this module is mainly the file format (as it is to be 
> expected from a lyx2lyx evolution), but my goal is make that a more general 
> module. As such the lyx server component will be a nice addition. :-)

IMHO, it would be nice to have a python package for LyX support. This
could comprise 

  Functions and classes for lyx2lyx and tex2lyx   -> lyxfiles.py

  Lyxserver communication -> lyxclient.py

  A python wrapper for lfuns  -> lyxfuns.py
   (using lyxclient.py for now but maybe an 
internal python interface sometimes in the 
future)

  Enhancement modules 
   (word-count, source-editing, external commands 
on the selection, coupling of 2 LyXes, calling 
a BibTeX GUI, ...)

This package should be somewhere in the PYTHONPATH
(/usr/lib/python2.3/site-packages/ on my Debian-testing box)

A set of small executable python scripts (importing from the LyX package)
should go to the PATH
  lyx2lyx
  tex2lyx
  lyx-remote
  lyx-Mx
  lyx-with-pyclient
(there should be a naming contest for the latter three).  
  
  
In order to have a decent scripting/plugin support via the lyxserver, I
have the following 

Feature Request
===

Could the lfun "server-notify" take an data argument, that is passed on
to the lyxserver? 

   M-x server-notify foobar path 

would then write the line

   NOTIFY:Left:foobar path

to lyxpipe.out


Why?


* Currently, to get a key making something via the lyxclient, 2 bindings at
  2 places are needed. Example

  1. in my.bind   

 \bind  "M-w"  server-notify# count_words
 
 Sends NOTIFY:M-w
  
  2. in the client (or a configuration file of the client)

 lyxclient.bindings["M-w"] = count_words

 Calls count_words() upon notification from key M-w
 
 
* Adding a menu entry would need one more matching binding in the client
  configuration.

* Calling from the minibuffer (M-x prompt) always pretends to come from
  key "Left". This allows just one binding.


With the additional data argument, the client can try to map the data to
a function. Binding occures in one place (*.bind and *.ui files) and
using the minibuffer becomes possible.


For serious scripting, some more lfuns are required:

 * a function prompting for input in the minibuffer and returning the
   result.
   
 * a function to get the content of the selection
   (but which format? latex, plain text, lyx source, internal
   representation, ...)
   
 * a function to reinsert this content after some modifications
   (self-insert will not work for math, e.g.)  
   
 * a way to "bypass" popup dialogues, e.g. push-keypress (or
   simulate-keypress) to simulate a keypress/-release event.

These are the first to spring into my mind. There are more to expect. But
also, they (and the existing ones) must be documented in order to be
usable. 

My goal is to get for lyx a broad base of user-provided extensions in the
way we there is for emacs.

Sincerely
 
 
Guenter 

-- 
G.Milde web.de


Re: scripting support via lyxserver

2005-01-28 Thread Angus Leeming
John Levon wrote:
 Super-glad to see Asger back into the fold. He can be a less hated me!!
He's just got a thicker skin ;-) How the hell are you anyway?
-- 
Angus



Re: scripting support via lyxserver

2005-01-28 Thread John Levon
On Fri, Jan 28, 2005 at 09:01:04AM +, Angus Leeming wrote:

  Super-glad to see Asger back into the fold. He can be a less hated me!!
 He's just got a thicker skin ;-) How the hell are you anyway?

Fine, insanity at work has mitigated into mere eccentricity. I might
even build a recent lyx soon...

john


Re: scripting support via lyxserver

2005-01-28 Thread Angus Leeming
John Levon wrote:
> Super-glad to see Asger back into the fold. He can be a less hated me!!
He's just got a thicker skin ;-) How the hell are you anyway?
-- 
Angus



Re: scripting support via lyxserver

2005-01-28 Thread John Levon
On Fri, Jan 28, 2005 at 09:01:04AM +, Angus Leeming wrote:

> > Super-glad to see Asger back into the fold. He can be a less hated me!!
> He's just got a thicker skin ;-) How the hell are you anyway?

Fine, insanity at work has mitigated into mere eccentricity. I might
even build a recent lyx soon...

john


Re: scripting support via lyxserver

2005-01-27 Thread Jose' Matos
On Friday 21 January 2005 08:28, G. Milde wrote:

 Please find attached my work so far. If you copy lyx.py into the
 pythonpath, pydoc will give you a nice view of the doc strings and
 setup

  Hi Gnter,
I would like to congratulate you for your work with the lyx server via 
the 
python module. This is something that I wanted to do for quite some 
time. :-)

 Generally, the lyxserver seems to be an a sad state mainly because noone
 seems to use it seriously. (Some of my ideas and complaints are to be
 found in examples/lyxtest.py.) If there is interest (and consent that
 this is the right place), I'd like to discuss this issue further.

  Please do.

 Gnter

  PS: In another movement (no pun John ;-) to help python scripting for lyx 
the lyx2lyx program has become only a interface to the new LyX.py module.

   The main concern of this module is mainly the file format (as it is to be 
expected from a lyx2lyx evolution), but my goal is make that a more general 
module. As such the lyx server component will be a nice addition. :-)

-- 
Jos Ablio


Re: scripting support via lyxserver

2005-01-27 Thread John Levon
On Thu, Jan 27, 2005 at 07:03:11PM +, Jose' Matos wrote:

   PS: In another movement (no pun John ;-) to help python scripting for lyx 

Is this a test on whether I'm still listening? :)

Super-glad to see Asger back into the fold. He can be a less hated me!!

john


Re: scripting support via lyxserver

2005-01-27 Thread Jose' Matos
On Friday 21 January 2005 08:28, G. Milde wrote:
>
> Please find attached my work so far. If you copy lyx.py into the
> "pythonpath", pydoc will give you a nice view of the doc strings and
> setup

  Hi GÃnter,
I would like to congratulate you for your work with the lyx server via 
the 
python module. This is something that I wanted to do for quite some 
time. :-)

> Generally, the lyxserver seems to be an a sad state mainly because noone
> seems to use it seriously. (Some of my ideas and complaints are to be
> found in examples/lyxtest.py.) If there is interest (and consent that
> this is the right place), I'd like to discuss this issue further.

  Please do.

> GÃnter

  PS: In another movement (no pun John ;-) to help python scripting for lyx 
the lyx2lyx program has become only a interface to the new LyX.py module.

   The main concern of this module is mainly the file format (as it is to be 
expected from a lyx2lyx evolution), but my goal is make that a more general 
module. As such the lyx server component will be a nice addition. :-)

-- 
Josà AbÃlio


Re: scripting support via lyxserver

2005-01-27 Thread John Levon
On Thu, Jan 27, 2005 at 07:03:11PM +, Jose' Matos wrote:

>   PS: In another movement (no pun John ;-) to help python scripting for lyx 

Is this a test on whether I'm still listening? :)

Super-glad to see Asger back into the fold. He can be a less hated me!!

john


Re: scripting support via lyxserver

2005-01-21 Thread G. Milde
On 19.01.05, Angus Leeming wrote:
 G. Milde wrote:
  Dear LyXers,
  
  IMHO, LyX clearly lacks a decent support for a scripting language. As
  this topic is not new but discussion about which language to choose is
  endless, I tried to set up a script interface via the lyxserver.
 
 Dear Günter, this looks very promising. Why not post to the lyx-devel list
 where I'm sure that the conversation will continue.

Please find attached my work so far. If you copy lyx.py into the
pythonpath, pydoc will give you a nice view of the doc strings and setup

pydoc  -p  port  Start an HTTP server on the given port on the local
 machine.
 
firefox http://localhost:port   Python docs, click on lyx module in 
whereever you placed it

The examples/ subdir lists some, well, examples of what can be done with the
LyXClient class.

Generally, the lyxserver seems to be an a sad state mainly because noone
seems to use it seriously. (Some of my ideas and complaints are to be found
in examples/lyxtest.py.) If there is interest (and consent that this is the
right place), I'd like to discuss this issue further.

Günter

-- 
G.Milde web.de


pyclient.tar.bz2
Description: Binary data


Re: scripting support via lyxserver

2005-01-21 Thread G. Milde
On 19.01.05, Angus Leeming wrote:
> G. Milde wrote:
> > Dear LyXers,
> > 
> > IMHO, LyX clearly lacks a decent support for a scripting language. As
> > this topic is not new but discussion about which language to choose is
> > endless, I tried to set up a script interface via the lyxserver.
> 
> Dear Günter, this looks very promising. Why not post to the lyx-devel list
> where I'm sure that the conversation will continue.

Please find attached my work so far. If you copy lyx.py into the
"pythonpath", pydoc will give you a nice view of the doc strings and setup

pydoc  -p  port  Start an HTTP server on the given port on the local
 machine.
 
firefox http://localhost:port   Python docs, click on lyx module in 
whereever you placed it

The examples/ subdir lists some, well, examples of what can be done with the
LyXClient class.

Generally, the lyxserver seems to be an a sad state mainly because noone
seems to use it seriously. (Some of my ideas and complaints are to be found
in examples/lyxtest.py.) If there is interest (and consent that this is the
right place), I'd like to discuss this issue further.

Günter

-- 
G.Milde web.de


pyclient.tar.bz2
Description: Binary data