Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Re: scripts-input works?

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Re: scripts-input works?


Chronological Thread 
  • From: Michael Lachmann <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Re: scripts-input works?
  • Date: Sat, 8 Aug 2009 17:57:56 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=RmMPx49XZYK3WkzSt9wwsGPVFAPZakr11bSzYAQnh+jJ7wtosA2f7xokPH9CacH8ap g7cL8BFs0WFrPKlFdahy7nhInttrZGp5zbJ7J5aHwG2s8xjhkFxe4HYGAP7iTirU7GW/ UkS4UTUp+IQ3lVlPKn189qiJTPLQ6z8VI5ygg=

I'm playing around with the scripts. This is quite a cool feature!

I have a few comments till now...
1. Currently opening and closing a script region (i.e. switching from
viewing the code, and seeing the result) is equivalent to executing
the code. It would be nice to be able to view without executing. Or is
there also a secret key-combination for this?

2. I know that is a bit too much to ask for, but it would be nice to
be able to nest scripts, so that R can produce xypic code, which is
then rendered.

3. Currently, when you are editing a script, C-a goes to the beginning
of the line, not the beginning of the script. So you have to move with
the arrow keys. Not horrible...

4. It would be nice to have a way to open all script regions. They are
really hard to find.

Thanks a lot!!!
Michael

2009/8/7 Joris van der Hoeven <address@hidden>:
> Hi Michael,
>
> Yes, little is needed in order to use other plug-ins for scripting.
> However, since the command-line interface is no longer available
> in that case, it seems quite mandatory to me that menus for basic use
> of the system are added in that case. Look at what has been done for Maxima.
> Of course, this should be further completed ;^)
>
> Best wishes, Joris
>
>
> On Thu, Aug 06, 2009 at 02:18:55PM +0200, Michael Lachmann wrote:
>> Answering my own question. I managed to get scripts to work both with
>> R and with XYPic. Very little hacking is needed, though I'm probably
>> breaking lots of stuff.
>>
>> I edited the files
>> /usr/share/TeXmacs/plugins/xypic/progs/init-xypic.scm
>> and
>> /usr/share/TeXmacs/plugins/xypic/progs/init-r.scm
>>
>> To both I added a line to plugin-configure:
>>
>> (plugin-configure xypic
>>   (:require (url-exists-in-path? "latex"))
>>   (:launch "tm_xypic --texmacs")
>>   (:session "XYpic")
>>   (:scripts "XYpic"))
>>
>> and
>> (plugin-configure r
>>   (:require (url-exists-in-path? "R"))
>>   (:initialize (r-initialize))
>>   (:serializer ,r-serialize)
>>   (:launch "exec tm_r")
>> ;;  (:tab-completion #t)
>>   (:session "R")
>>    (:scripts "R")
>>   )
>>
>> (The added line is the last - (:scripts "name"))
>>
>> Once that is done, in a document, you just select
>> Document->scripts->XYPic (or R), and then hit M-*!
>> Then you enter an expression, and when you want to evaluate it hit C-*
>> To unevaluate it, i.e. see the original expression, hit C-* again.
>>
>> Thus, for R you can enter the expression
>> plot(1:10,10:1);abline(0,1,col=2);v()
>> and then you get a nice graph in the document....
>>
>> If you want both R and XYPic in the same session, it seems you have to
>> select Document->scripts->XYPic before you enter the expression with
>> M-*!, you can not just edit the grey field that says R or XYPic.
>>
>> It is a bit hard to differentiate parts of the text that are output of
>> scripts from parts that are just text (I guess that is the point...).
>> Is there something like varsession for scripts?
>>
>> Michael
>>
>>
>> 2009/8/6 Michael Lachmann <address@hidden>:
>> > Hi!
>> >
>> > I'm trying to insert XYPic generated graphs into a document, while
>> > having the code for the graph hidden.
>> > Looking through the web, I discovered the "hidden" keystroke M-*! and C-*
>> > These are very cool features!!
>> >
>> > But I can not get them to work. Every time I hit C-* I get "XXXX is
>> > not a scripting language",
>> > and it doesn't matter if I leave the original script-input as it was
>> > to begin with, i.e. "scheme", or if I change "scheme" to "python",
>> > "xypic", or "R".
>> > The mailing list seems to indicate that this worked once for python
>> > and gnuplot, and maybe xypic.
>> > Am I doing it wrong? Is this feature currently off? Is there another
>> > way to achieve what I want - i.e. put a nice graph into my document
>> > without the ugly code?
>> >
>> > Thanks!
>> > Michael
>> >
>
>



Archive powered by MHonArc 2.6.19.

Top of Page