mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Re: literate programming, again. Question about syntax highlighting.


Chronological Thread 
  • From: Michael Lachmann <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Re: literate programming, again. Question about syntax highlighting.
  • Date: Tue, 15 Sep 2009 00:55:02 +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=vco6ZTgHcf8WetZMfyPjhM6hXr2j/03M8sbBikngCRsFxNKhT9zDbbukY3UTvJCUi0 xUrY9qWjEbv2D+BEE0SN55nl45FMixw+6HUq9UBSs6eEJYpF/xpIxhe9qZT0rV6eNnKM Fti1GgjnZ5Sbkgo5gO3Xfgir77L41IhjVNJy8=

You are right. And it should be easier to add different highlight styles.

Sadly, or maybe luckily, I have to convert a complicated piece of code
to literate programming. Or comment it better... I wrote it 2 months
ago, and now I can't make heads or tails of it. And it has to be done
by yesterday....
But, I think literate programming in TeXmacs with your noweb style
already works really well. Good enough for me to use, and better than
anything else I found.

I think that TeXmacs sessions should also have the weaving property. I
often wanted to export a document with many R sessions in it to an R
document without the text. Now I have to copy/paste through all the
snipplets.

I think another very important property is that TeXmacs should be able
to take a document apart into many different files (as is happening
now with noweb), and also do the reverse - put the pieces back into a
document. Of course for that, one needs to write codes in the files
about where each piece came from. I think it is not hard to implement.
With that, one could debug and edit the code externally, and then
reassemble the program back to the document.


thanks again,
Michael


2009/9/14 bytecolor <address@hidden>:
> It's a start you may want to expand upon. noweb.ts should be a package
> instead of a style. \noweb-chunk may be more appropriate. It should
> probably use \code instead \cpp-fragment. Maybe give \noweb-chunk another
> parameter to specify language. Lots of possibilities. Especially if you
> start adding to TeXmacs at the Scheme level. ;)
>
> I read somewere in the docs about indenting. Still foggy on the details.
> One option would be to adapt the Emacs model. C-j calls
> (newline-and-indent) which can call a mode's indent procedure. The indent
> procedure just looks around where the cursor is and determines what the
> indent should be at that point. There is more to it than that but it's
> doable.
>
> --
> bytecolor (S. Edward Dolan)
>
>
> --- On Sun, 9/13/09, Michael Lachmann <address@hidden> wrote:
>
>> From: Michael Lachmann <address@hidden>
>> Subject: Re: [TeXmacs] Re: literate programming, again. Question about
>> syntax  highlighting.
>> To: address@hidden
>> Date: Sunday, September 13, 2009, 8:02 AM
>> Thank you very much, bytecolor
>> (Edward)!
>>
>> This works great!
>> I edited cpp_language.cpp  to add some D keywords.
>>
>> Just a small comment:
>> The way noweb works is that you can have several
>> <<>>= definitions
>> with the same name, and they are just concatenated in
>> order. I guess
>> it is a "feature", though it helps when you break up code
>> into parts.
>> This seems to work correctly in noweb.ts: when you click on
>> the <<>>
>> label, it goes to the first reference of the definition. I
>> don't know
>> if this breaks anything otherwise. I guess one could define
>> a
>> noweb-fragment, and a noweb-fragment-part, if it matters.
>>
>> Michael
>>
>>
>> if anyone is interested, here are the keywords I added to
>> cpp_color_setup_keywords... there are some more though...
>>    ///// D
>>   t("unittest")=c ;
>>   t("import")=c ;
>>   t("assert")=c ;
>>   t("alias")=c ;
>>   t("const")=c ;
>>   t("cast")=c ;
>>   t("foreach")=c ;
>>   t("long")=c ;
>>   t("int")=c ;
>>   t("bool")=c ;
>>   t("real")=c ;
>>   t("char")=c ;
>>   t("ref")=c ;
>>   t("auto")=c ;
>
>
>
>
>
>



Archive powered by MHonArc 2.6.19.

Top of page