From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter =?utf-8?Q?M=C3=BCnster?= Newsgroups: gmane.emacs.help Subject: Re: two-mode: make-local-variable and cpu consumption Date: Mon, 3 Mar 2008 22:36:34 +0100 Message-ID: <20080303213634.GA23462@gaston.couberia.bzh> References: <20080224192529.GA945@gaston.couberia.bzh> <47C4305C.5040002@gmail.com> <20080303202956.GB25919@gaston.couberia.bzh> <47CC619C.5030507@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1204580236 16183 80.91.229.12 (3 Mar 2008 21:37:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Mar 2008 21:37:16 +0000 (UTC) Cc: Emacs Users To: "Lennart Borgman (gmail)" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 03 22:37:41 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JWILo-0001P0-HQ for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Mar 2008 22:37:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWILH-000706-6d for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Mar 2008 16:37:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWIKw-0006xy-QN for help-gnu-emacs@gnu.org; Mon, 03 Mar 2008 16:36:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWIKs-0006pG-1P for help-gnu-emacs@gnu.org; Mon, 03 Mar 2008 16:36:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWIKr-0006p7-V4 for help-gnu-emacs@gnu.org; Mon, 03 Mar 2008 16:36:37 -0500 Original-Received: from smtp27.orange.fr ([80.12.242.96]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JWIKr-00017a-I2 for help-gnu-emacs@gnu.org; Mon, 03 Mar 2008 16:36:37 -0500 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2722.orange.fr (SMTP Server) with ESMTP id D0CDE1C0008E for ; Mon, 3 Mar 2008 20:34:35 +0100 (CET) Original-Received: from gaston.couberia.bzh (ARennes-358-1-19-78.w90-49.abo.wanadoo.fr [90.49.110.78]) by mwinf2722.orange.fr (SMTP Server) with ESMTP id AD53B1C00087; Mon, 3 Mar 2008 20:34:35 +0100 (CET) X-ME-UUID: 20080303193435710.AD53B1C00087@mwinf2722.orange.fr Original-Received: by gaston.couberia.bzh (Postfix, from userid 1000) id E2427305A5; Mon, 3 Mar 2008 22:36:34 +0100 (CET) Mail-Followup-To: "Lennart Borgman (gmail)" , Emacs Users Content-Disposition: inline In-Reply-To: <47CC619C.5030507@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52028 Archived-At: 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/