mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Feedback on texmacx


Chronological Thread 
  • From: Michael Lachmann <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Feedback on texmacx
  • Date: Thu, 17 Jun 2010 04:58:48 +0200

You can look a bit back up the list for the discussion. I'm using two
files, I think:
noweb.ts stored in ~/.TeXmacs/styles, and a few key bindings in
~/.TeXmacs/progs/my-init-texmacs.scm

I installed noweb, and maybe that's it. Attached is a sample TeXmacs file.

Tell me if it worked...

Michael

noweb.ts:
--
<TeXmacs|1.0.7.2>

<style|source>

<\body>
<use-package|jsc|tmdoc-traversal|tmdoc-markup|tmdoc-keyboard>

<assign|noweb-fragment|<\macro|name|x>

<\cpp-fragment>

\<less\>\<less\><label|<arg|name>><with|color|red|<arg|name>> \<gtr\>\<gtr\>=

<arg|x>

@
</cpp-fragment>
</macro>>

<assign|noweb-ref|<macro|name|\<less\>\<less\><hlink|<arg|name>| <merge|#|<arg|name>>>\<gtr\>\<gtr\>>>

</body>

<\initial>
<\collection>
<associate|page-type|letter>
</collection>
</initial>

<\references>
<\collection>
</collection>
</references>
--
The key bindings: in ~/.TeXmacs/progs/my-init-texmacs.scm:
--
(kbd-map
("C-1" (make 'noweb-ref))
("C-2" (make 'noweb-fragment))
("C-9" (choose-file (texmacs-save-buffer "verbatim") "save
verbatim file" "verbatim") )
)
--
On 16 June 2010 22:23, Sam Liddicott <address@hidden> wrote:
On 16/06/10 17:18, Michael Lachmann wrote:

On 11 June 2010 18:04, Sam Liddicott <address@hidden> wrote:

I really miss latex's lstlistings. I wrote a literate programming addon for
Lyx (http://www.nongnu.org/newfangle/index.shtml). The weave side was done
entirely in latex macros and based on lstlistings, and the tangle side was
done with a single awk script. I see that texmacs replaces tex mostly (fair
enough, the difficulties in parsing tex drove me to texmacs). I intend to
port the literate programming to texmacs and implement as xslt and guile. I
guess I'll have a lot to do to get lstlistings ported. Mainly it had syntax
highlighting and line counting, but it had some freaky tricks to approximate
per-word grids for fake mono-spacing with variable fonts. (I know about
lp4texmacs).

I've been using texmacs for literate programming over the last year
with a bunch of hacks.
There is a small environment for texmacs to install that makes a new
document class, 'noweb'. The document is exported to verbatim from
within texmacs, and then I run notangle on it to get the various
parts. I haven't implemented a nice make interface as you have. One
nice feature is that because of texmacs' sessions, at the end of the
document I have a shell session and a scheme session that I use to
generate everything. So I don't need to remember how to do stuff.

Inserting a new section is done with ctrl-2, and a link to a prev
section with ctrl-1. It is nice that once that is done you can easily
jump between the different parts of the program.

Syntax highlighting of the different languages has to be hard coded
using cpp for now....

It would really be nice to make it less hacky, add some make
possibility that recognizes changes, and the possibility to reassemble
the document from the files so that you can edit your code in whatever
editor you want....


I'm quite excited by the guile/scheme integration, for once it may mean that
references to other blocks can be expanded, and possibly even edited
in-situ.

But it seems like the main task will be re-writing lstlistings in scheme. I
know how the keywording works in lstlistings, by looking for keywords that
are not in quoted strings, so I think I can do that.

On partially implemented feature in newfangle is automatic contextual
quoting, so that if a chunk of text is included in a line that begins with
// that all the lines have // prefixed; or if a chunk of text with a newline
in is included within a string definition, the newline is replaced with
\n"<literal-newline>"

and so on; but I found this to be difficult with languages like perl where
$a=~m/a/; and $a=~s|a/|b/|; are both regex type stuff and quite hard to
detect where the regex starts and ends; so I can't automatically do such
stuff in perl; but as the Texmacs editor is so great with it's macro editing
I can quite easily have the human markup regexes and so-forth and not need
to automatically detect all of it!

Please could you tell me where to get the literate stuff you have been
doing?

Sam

--
Sam's signature

Attachment: hello.tm
Description: Binary data




Archive powered by MHonArc 2.6.19.

Top of page