From d73d5ea6abf0cbfd963844def345296dc0003305 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg@phi-gamma.net>
Date: Sun, 31 Mar 2013 16:05:07 +0200
Subject: circumvent coupling of pre_lbrk and hpack filters in Context

---
 tex/context/third/enigma/enigma.lua | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

(limited to 'tex/context')

diff --git a/tex/context/third/enigma/enigma.lua b/tex/context/third/enigma/enigma.lua
index ce2bc3d..b10b067 100644
--- a/tex/context/third/enigma/enigma.lua
+++ b/tex/context/third/enigma/enigma.lua
@@ -68,6 +68,7 @@ libraries.
 \stopparagraph
 --ichd]]--
 
+local get_debug_info               = debug.getinfo
 local ioread                       = io.read
 local iowrite                      = io.write
 local mathfloor                    = math.floor
@@ -1556,9 +1557,15 @@ local new_callback = function (machine, name)
     mod_5              = 0
     if format_is_context == true then
       head = c
-    else
-      head = a
+      local cbk_env = get_debug_info(4) -- no getenv in lua 5.2
+      --inspect(cbk_env)
+      if cbk_env.func == nodes.processors.pre_linebreak_filter then
+        -- how weird is that?
+        return aux(head)
+      end
+      return head
     end
+    head = a
     return aux(head)
   end
 
-- 
cgit v1.2.3