[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: two-mode: make-local-variable and cpu consumption
From: |
Peter Münster |
Subject: |
Re: two-mode: make-local-variable and cpu consumption |
Date: |
Mon, 3 Mar 2008 22:36:34 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
On Mon, Mar 03 2008, Lennart Borgman (gmail) wrote:
> Yes, it is bit complex. However that is normally nothing you see as a user.
> But I see it, I am still struggling with some problems with refontification
> after changes... ;-)
>
> Could you perhaps send me an example of a file with those two modes?
% engine=luatex
\startluacode
-- here is lua-mode
local function sort_table(s1, s2)
local function cmp(a, b)
if s2 ~= "" and a[s1] == b[s1] then
return a[s2] < b[s2]
else
return a[s1] < b[s1]
end
end
if s1 ~= "" then
table.sort(thirddata.inifile.t, cmp)
end
end
\stopluacode
\starttext
% here is context-mode
\startitemize
\item bla bla bla
\item bla bla bla
\item bla bla bla
\item bla bla bla
\stopitemize
\startMPcode
% here is metapost-mode
path p;
p := ((0,0)--(1,0)--(1,2)--(-0.5,2)--(-0.5,1)--(0,1)--cycle) scaled 1cm;
draw p;
\stopMPcode
\stoptext
>> (setq default-mode (list "PDFConTeXt-en" 'context-mode))
>> (setq second-modes (list (list "Lua" "\\startlua" "\\stoplua" 'lua-mode)
>> (list "MP" "\\startMP" "\\stopMP" 'metapost-mode)))
>
> What markup does two-modes expect to see in the buffer then?
The main markup is ConTeXt, inside \startlua...\stoplua it's lua and inside
\startMP...\stopMP it's metapost.
Cheers, Peter
--
http://pmrb.free.fr/contact/