mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] My first non-trivial macro


Chronological Thread 
  • From: "David G. Wonnacott" <address@hidden>
  • To: address@hidden
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] My first non-trivial macro
  • Date: Thu, 6 Jul 2006 12:56:37 -0400 (EDT)
  • Hc-host: Message scanned by SMTP2, Networking & Systems, Haverford College, Haverford, PA 19041 [v011]
  • Hc-mailscanner: Found to be clean

Date: Sun, 02 Jul 2006 19:25:34 +0200
From: Henri Lesourd <address@hidden>

David G. Wonnacott wrote:

>However, I am having trouble creating a macro that builds a file name
>and then includes it.

...

What you can do is to rewrite the include as a macro written by
means of a Scheme function (namely, using <extern>), following
the way it is done in the example1 plugin for the Scheme-written
macro for reversing a string (section 3.3.1 of my tutorial). The
tutorial explains also exactly how the directory structure of the
plugin's directory should be.

I've worked my wy through the scheme part of the tutorial, and now
have my files all arranged and have your example1 working quite
nicely. Thanks again for providing this.

...

Just removing the unnecessary example code, and cut and pasting the
Scheme function (reverse-string s) to a function (include-file x)
which reads the content of the file as one big string, and sends
it back as a result to TeXmacs, should be easy (i.e., this is only
a matter of Guile programming). When this function will be working,
the only remaining thing to do will be to add the appropriate macro
<my-include> into the example1.ts stylesheet, following the example
of the <reverse> macro which is already there.

I've got my own scheme function connected to my own macro. It seemed
to me to be a waste to write my own function when TeXmacs already
knows how to include files, and I was hoping to figure out what was,
and am currently playing around with using "Help" to search source
code... I'll let you know if I get anything to work or give up.

Dave W



Archive powered by MHonArc 2.6.19.

Top of page