[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] Re: A first step towards a clean spec of LP mode for t
Re: [Texmacs-dev] Re: A first step towards a clean spec of LP mode for texmacs
Sat, 18 Feb 2006 21:18:25 +0100
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)
I have refreshed my Scheme and wrote some code (see attached
Consider this as a first draft. Feel free to criticize my style but
don't be too harsh (this is the first Scheme code I have ever written!
Some code could probably be optimized for speed. Right now, I'm just
looking for functionalities.
This Scheme code runs with guile but is currently independant of
TeXmacs (start it with "guile -s lp-code.scm").
David MENTRE <address@hidden> writes:
>> The way I see it right now the objectives are to create
>> 1) overloaded load-save functions for source files with tm-comments
I haven't look at TeXmacs API yet.
Partially done for load/save functions. This code raises two points:
1. When reading from source, how we should distinguish between
commented TeXmacs lines and source comments? In attached code, I
consider commented TeXmacs lines all lines that start with a comment
on first character. For example:
;<TeXMacs|1.06> <--- TeXmacs line
; <--- code line
(define ....) <--- code line
Should we use a more specific delimiter, like ";tm"?
2. Right now, I represent parsed code as a list of pairs, the right
hand side being 'tm or 'code depending on line content. That should
be rewritten to work with TeXmacs data structure. E.g.:
'((tm . "<TeXmacs|1.0.6")
(tm . "<style|generic>")
(tm . "<\\body>")
(tm . "<tag|;>")
(code . "(define (hello-world) (display \"Hello world!\"))")
(code . "")
(tm . "</body>")
>> 2) an import function for plain source files (treating comments as
>> plain text) - 2) will share a lot of code with 1)
Not done yet.
>> 3) a database of commenting syntax (simply as a scheme file)
First attempt provided. We will need to refactor it, for example to
handle languages which have several kinds of comment.
>> 4) create style files that format verbatim blocks nicely (or do we
>> use the <code> tag as is in TeXmacs?)
We could start with the <code> tag.
>> 4) create convenience functions that split/join verbatim blocks
>> (how would you want the user interface for this one to be like?)
A right-click->"Split code line here" would be nice. I don't know if it
can be done easily however.
 I read the R5RS report, found at:
pub 1024D/A3AD7A2A 2004-10-03 David MENTRE <address@hidden>
5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A
Description: Text document