From c9b715ef8332f82ec94a3eff2c60dd6273639f75 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 21 Jan 2014 17:00:18 +0200 Subject: beta 2014.01.21 15:48 --- context/data/scite/scite-context.properties | 49 ++++++++++++++------- context/data/scite/scite-ctx.properties | 19 +++++--- scripts/context/lua/mtx-context.lua | 9 ++-- scripts/context/stubs/source/mtxrun_dll.c | 20 ++++++--- scripts/context/stubs/unix/mtxrunjit | 2 + tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4081 -> 4094 bytes tex/context/base/context.mkiv | 2 +- tex/context/base/core-uti.lua | 2 +- tex/context/base/status-files.pdf | Bin 24816 -> 24814 bytes tex/context/base/status-lua.pdf | Bin 233039 -> 233039 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 12 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 scripts/context/stubs/unix/mtxrunjit diff --git a/context/data/scite/scite-context.properties b/context/data/scite/scite-context.properties index caf230de7..bc1af717c 100644 --- a/context/data/scite/scite-context.properties +++ b/context/data/scite/scite-context.properties @@ -115,9 +115,11 @@ name.metafun.console=$(name.context.console) name.example.console=$(name.context.console) name.context.mtxrun=mtxrun --autogenerate +name.context.mtxrunjit=mtxrunjit --autogenerate name.context.check=$(name.context.mtxrun) --script check name.context.run=$(name.context.mtxrun) --script context $(name.flag.pdfopen) +name.context.runjit=$(name.context.mtxrunjit) --script context $(name.flag.pdfopen) name.context.texshow=$(name.context.mtxrun) texshow name.context.purge=$(name.context.mtxrun) --context --purge --all name.context.showcase=$(name.context.mtxrun) --launch showcase.pdf @@ -162,20 +164,20 @@ import scite-ctx # hard coded compile / build / go -command.compile.$(file.patterns.context)=$(name.context.check) $(FileNameExt) -command.compile.$(file.patterns.metafun)= -command.compile.$(file.patterns.example)=$(name.example.xmlcheck) $(FileNameExt) -command.compile.*.fo=$(name.example.xmlcheck) $(FileNameExt) +command.build.$(file.patterns.context)=$(name.context.check) $(FileNameExt) +command.build.$(file.patterns.metafun)= +command.build.$(file.patterns.example)=$(name.example.xmlcheck) $(FileNameExt) +command.build.*.fo=$(name.example.xmlcheck) $(FileNameExt) -command.build.$(file.patterns.context)=$(name.context.run) $(FileNameExt) -command.build.$(file.patterns.metafun)=$(name.context.mtxrun) --script context $(name.flag.pdfopen) $(FileNameExt) -command.build.$(file.patterns.example)=$(name.context.run) --forcexml $(FileNameExt) -command.build.*.fo=$(name.context.run) $(name.flag.pdfopen) --forcexml --use=foxet $(FileNameExt) +command.compile.$(file.patterns.context)=$(name.context.run) $(FileNameExt) +command.compile.$(file.patterns.metafun)=$(name.context.run) $(name.flag.pdfopen) $(FileNameExt) +command.compile.$(file.patterns.example)=$(name.context.run) --forcexml $(FileNameExt) +command.compile.*.fo=$(name.context.run) $(name.flag.pdfopen) --forcexml --use=foxet $(FileNameExt) -command.build.subsystem.$(file.patterns.context)=1 -command.build.subsystem.$(file.patterns.metafun)=1 -command.build.subsystem.$(file.patterns.example)=1 -command.build.subsystem.*.fo=1 +command.compile.subsystem.$(file.patterns.context)=1 +command.compile.subsystem.$(file.patterns.metafun)=1 +command.compile.subsystem.$(file.patterns.example)=1 +command.compile.subsystem.*.fo=1 if PLAT_WIN command.go.$(file.patterns.context)=$(FileName).pdf @@ -218,6 +220,24 @@ command.1.subsystem.$(file.patterns.context)=1 command.1.subsystem.$(file.patterns.metafun)=1 command.1.subsystem.$(file.patterns.example)=1 +command.name.29.*=Run with jit +command.subsystem.29.*=1 +command.29.$(file.patterns.context)=$(name.context.runjit) $(FileNameExt) +command.29.$(file.patterns.metafun)=$(name.context.runjit) $(FileNameExt) --metapost +command.29.$(file.patterns.exmaple)=$(name.context.runjit) $(FileNameExt) --xml +command.groupundo.29.*=yes +command.save.before.29.*=2 +command.shortcut.29.*=Alt+F12 + +command.name.30.*=Run with jit +command.subsystem.30.*=1 +command.30.$(file.patterns.context)=$(name.context.runjit) $(FileNameExt) +command.30.$(file.patterns.metafun)=$(name.context.runjit) $(FileNameExt) --metapost +command.30.$(file.patterns.exmaple)=$(name.context.runjit) $(FileNameExt) --xml +command.groupundo.30.*=yes +command.save.before.30.*=2 +command.shortcut.30.*=Alt+F7 + # 2 : pdf viewing command.name.2.$(file.patterns.context)=View PDF File with GhostScript @@ -337,10 +357,9 @@ highlight.indentation.guides=1 # Editor: keys user.shortcuts=\ -F12|IDM_COMPILE|\ -Ctrl+F12|IDM_BUILD|\ +F12|IDM_BUILD|\ +Ctrl+F12|IDM_COMPILE|\ Shift+F12|IDM_GO|\ -Alt+F12|IDM_STOPEXECUTE|\ os.x.home.end.keys=0 diff --git a/context/data/scite/scite-ctx.properties b/context/data/scite/scite-ctx.properties index d56ae653d..acbb33c0b 100644 --- a/context/data/scite/scite-ctx.properties +++ b/context/data/scite/scite-ctx.properties @@ -69,14 +69,19 @@ ctx.spellcheck.wordsize.uk=4 ctx.spellcheck.wordsize.nl=4 ctx.helpinfo=\ - Shift + F11 pop up menu with ctx options|\ + Shift + F11 pop up menu with ctx options|\ |\ - Ctrl + B check spelling|\ - Ctrl + M wrap text (auto indent)|\ - Ctrl + R reset spelling results|\ - Ctrl + I insert template|\ - Ctrl + E open log file|\ - Ctrl + + toggle strip + Ctrl + B check spelling|\ + Ctrl + M wrap text (auto indent)|\ + Ctrl + R reset spelling results|\ + Ctrl + I insert template|\ + Ctrl + E open log file|\ + Ctrl + + toggle strip|\ + |\ + F7 / F12 check (or process)|\ + Ctrl + F7 / F12 process|\ + Alt + F7 / F12 process with jit|\ + shift + F7 / F12 launch command.name.21.$(file.patterns.context)=CTX Action List command.subsystem.21.$(file.patterns.context)=3 diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 4c6672051..9b620603e 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -87,14 +87,17 @@ scripts.context = scripts.context or { } -- for the moment here -if getargument("jit") or getargument("jiton") then +if jit then -- already luajittex + setargument("engine","luajittex") + setargument("jit",nil) +elseif getargument("jit") or getargument("jiton") then -- relaunch luajittex -- bonus shortcut, we assume than --jit also indicates the engine -- although --jit and --engine=luajittex are independent setargument("engine","luajittex") end -local engine_new = getargument("engine") or directives.value("system.engine") -local engine_old = environment.ownbin +local engine_new = file.nameonly(getargument("engine") or directives.value("system.engine")) +local engine_old = file.nameonly(environment.ownbin) local function restart(engine_old,engine_new) local command = format("%s --luaonly %q %s --redirected",engine_new,environment.ownname,environment.reconstructcommandline()) diff --git a/scripts/context/stubs/source/mtxrun_dll.c b/scripts/context/stubs/source/mtxrun_dll.c index 400ed6778..dc312a145 100644 --- a/scripts/context/stubs/source/mtxrun_dll.c +++ b/scripts/context/stubs/source/mtxrun_dll.c @@ -55,7 +55,6 @@ return 1; \ } -char texlua_name[] = "texlua"; // just a bare name, luatex strips the rest anyway static char cmdline[MAX_CMD]; static char dirpath[MAX_PATH]; static char progname[MAX_PATH]; @@ -73,6 +72,7 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] ) char *s, *luatexfname, *argstr, **lua_argv; int k, quoted, lua_argc; int passprogname = 0; + unsigned char is_jit=0; // directory of this module/executable @@ -93,6 +93,14 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] ) s = progname; if ( s = strrchr(s, '.') ) *s = '\0'; // remove file extension part + /* check "jit" : strlen("jit") = 3 */ + if (strncmp(s + strlen(s) - 3, "jit", 3) == 0) { + is_jit = 1; + *(s+strlen(s)-2) = "\0" ; + } else { + is_jit = 0; + } + // script path strcpy( scriptpath, dirpath ); @@ -122,7 +130,7 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] ) if ( !SearchPath( getenv( "PATH" ), // path to search (optional) - "texlua.exe", // file name to search + (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search NULL, // file extension to add (optional) MAX_PATH, // output buffer size luatexpath, // output buffer pointer @@ -130,7 +138,7 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] ) ) if ( !SearchPath( dirpath, // path to search (optional) - "texlua.exe", // file name to search + (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search NULL, // file extension to add (optional) MAX_PATH, // output buffer size luatexpath, // output buffer pointer @@ -151,7 +159,8 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] ) lua_argv = (char **)malloc( (argc + 4) * sizeof(char *) ); if ( lua_argv == NULL ) DIE( "out of memory\n" ); - lua_argv[lua_argc=0] = texlua_name; + lua_argv[lua_argc=0] = (is_jit ? "luajittex.exe":"luatex.exe"); + lua_argv[++lua_argc] = "--luaonly"; lua_argv[++lua_argc] = scriptpath; // script to execute if (passprogname) { lua_argv[++lua_argc] = "--script"; @@ -170,7 +179,8 @@ __declspec(dllexport) int dllrunscript( int argc, char *argv[] ) // we are still here, so no luatex.dll; spawn texlua.exe instead - strcpy( luatexfname, "texlua.exe" ); + strcpy( luatexfname,(is_jit ? "luajittex.exe":"luatex.exe")); + strcpy( cmdline, " --luaonly " ); strcpy( cmdline, "\"" ); strcat( cmdline, luatexpath ); strcat( cmdline, "\" \"" ); diff --git a/scripts/context/stubs/unix/mtxrunjit b/scripts/context/stubs/unix/mtxrunjit new file mode 100644 index 000000000..171721497 --- /dev/null +++ b/scripts/context/stubs/unix/mtxrunjit @@ -0,0 +1,2 @@ +#!/bin/sh +luajittex --luaonly $(dirname $0)/mtxrun "$@" diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 622050993..7fdbb59d2 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.01.21 10:58} +\newcontextversion{2014.01.21 15:48} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index f473d88cb..efc48c711 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index aea4994d3..63e9de509 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.01.21 10:58} +\edef\contextversion{2014.01.21 15:48} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua index ef792c1d8..1c230cead 100644 --- a/tex/context/base/core-uti.lua +++ b/tex/context/base/core-uti.lua @@ -323,7 +323,7 @@ if jit then local saved = watts_per_core * runtime * kg_per_watt_per_second / speedup_by_other_engine local saved = used_wood_factor * runtime -- return format("%s seconds, %i processed pages, %i shipped pages, %.3f pages/second, %f kg tree saved by using luajittex",runtime,pages,shipped,persecond,saved) - return format("%s seconds, %i processed pages, %i shipped pages, %.3f pages/second, %f g tree saved by using luajittex",runtime,pages,shipped,persecond,saved*1000) + return format("%s seconds, %i processed pages, %i shipped pages, %.3f pages/second, %f mg tree saved by using luajittex",runtime,pages,shipped,persecond,saved*1000*1000) else return format("%s seconds, %i processed pages, %i shipped pages, %.3f pages/second",runtime,pages,shipped,persecond) end diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index b44d09fb0..719368b3a 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index 4afc9b492..de843069b 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index caeccce65..609f3db9c 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/21/14 10:58:12 +-- merge date : 01/21/14 15:48:23 do -- begin closure to overcome local limits and interference -- cgit v1.2.3