From 8918b4798de4c6efdd0e24d0419f080496e5545e Mon Sep 17 00:00:00 2001
From: Elie Roux <elie.roux@telecom-bretagne.eu>
Date: Sun, 9 Jun 2013 10:04:24 +0200
Subject: It can be normal for a function to return false

---
 luatexbase-mcb.dtx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index b0ae1c9..3740e06 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -572,7 +572,7 @@ local function listhandler (name)
         for _, f in ipairs(callbacklist[name]) do
             ret = f.func(head, ...)
             if ret == false then
-                warning("function '%s' returned false\nin callback '%s'",
+                log("function '%s' returned false\nin callback '%s'",
                     f.description, name)
                 break
             end
-- 
cgit v1.2.3


From c4eb95663d8e14360fc564279757de46eeecdc6f Mon Sep 17 00:00:00 2001
From: Elie Roux <elie.roux@telecom-bretagne.eu>
Date: Sun, 9 Jun 2013 10:21:58 +0200
Subject: In simple callbacks, we stop on a false return

(so that we can truely disable hyphenation)
---
 luatexbase-mcb.dtx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index 3740e06..6d23eb8 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -572,7 +572,7 @@ local function listhandler (name)
         for _, f in ipairs(callbacklist[name]) do
             ret = f.func(head, ...)
             if ret == false then
-                log("function '%s' returned false\nin callback '%s'",
+                log("function '%s' returned false in callback '%s'",
                     f.description, name)
                 break
             end
@@ -611,14 +611,22 @@ local function firsthandler (name)
 end
 %    \end{macrocode}
 %
-%    Handler for |simple| callbacks.
+%    Handler for |simple| callbacks. If a function returns false, we return
+%    this value, without going through other functions.
 %
 %    \begin{macrocode}
 local function simplehandler (name)
     return function(...)
+        local ret = true
         for _, f in ipairs(callbacklist[name]) do
-            f.func(...)
+            ret = f.func(...)
+            if ret == false then
+                log("function '%s' returned false in callback '%s'",
+                    f.description, name)
+                return false
+            end
         end
+        return ret
     end
 end
 %    \end{macrocode}
-- 
cgit v1.2.3


From e5e304e814386f9882c5990c248347717eac6d26 Mon Sep 17 00:00:00 2001
From: Elie Roux <elie.roux@telecom-bretagne.eu>
Date: Sun, 9 Jun 2013 10:29:27 +0200
Subject: Adding a test

---
 luatexbase-mcb.dtx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index 6d23eb8..a09cd81 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -988,7 +988,7 @@ end
 %    \begin{macrocode}
 function add_hyphenate()
     luatexbase.add_to_callback('hyphenate', function(head, tail)
-            texio.write_nl("I'm a dummy hyphenate")
+            texio.write_nl("I'm a dummy (false) hyphenate") return false
         end,
         'dummy hyphenate')
     luatexbase.add_to_callback('hyphenate', function(head, tail)
-- 
cgit v1.2.3


From fdcabcdf8a4736657d6e0ddcc852e8e2abb8ea8a Mon Sep 17 00:00:00 2001
From: Elie Roux <elie.roux@telecom-bretagne.eu>
Date: Sun, 9 Jun 2013 10:48:59 +0200
Subject: Bumping date and refreshing callback list

---
 luatexbase-mcb.dtx | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index a09cd81..a032e26 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -266,12 +266,12 @@ See the aforementioned source file(s) for copyright and licensing information.
 % Some callbacks have a calling convention that varies depending on the
 % version of \luatex used. This package \emph{does not} try to track the type
 % of the callbacks in every possible version of \luatex. The types are based
-% on the last stable beta version (0.60.2 at the time this doc is written).
+% on the last stable beta version (0.76 at the time this doc is written).
 %
 % However, for callbacks that have the same calling convention for every
 % version of \luatex, this package should work with the same range of \luatex
-% version as other packages in the \pk{luatexbase} bundle (currently, 0.25.4
-% to 0.60.2).
+% version as other packages in the \pk{luatexbase} bundle (currently, 0.70
+% to 0.76).
 %
 %    \section{Implementation}
 %
@@ -332,7 +332,7 @@ See the aforementioned source file(s) for copyright and licensing information.
     \let\x\ProvidesPackage
   \fi
 \expandafter\endgroup
-\x{luatexbase-mcb}[2013/05/11 v0.6 Callback management for LuaTeX]
+\x{luatexbase-mcb}[2013/06/08 v0.7 Callback management for LuaTeX]
 %    \end{macrocode}
 %
 %    Make sure \luatex is used.
@@ -396,8 +396,8 @@ luatexbase          = luatexbase or { }
 local luatexbase    = luatexbase
 local err, warning, info, log = luatexbase.provides_module({
     name          = "luatexbase-mcb",
-    version       = 0.6,
-    date          = "2013/05/11",
+    version       = 0.7,
+    date          = "2013/06/08",
     description   = "register several functions in a callback",
     author        = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang",
     copyright     = "Hans Hagen, Elie Roux, Manuel Pegourie-Gonnard and Philipp Gesang",
@@ -442,7 +442,7 @@ local types = {
 %    \end{macrocode}
 %
 %    Now, list all predefined callbacks with their current type, based on the
-%    LuaTeX manual version 0.60.2.
+%    LuaTeX manual version 0.76.
 %
 %    \begin{macrocode}
 local callbacktypes = callbacktypes or {
@@ -473,9 +473,10 @@ local callbacktypes = callbacktypes or {
 %
 %    \begin{macrocode}
     open_read_file     = first,
+    reader             = list,
+    close              = simple,
     read_font_file     = first,
     read_vf_file       = first,
-    read_ocp_file      = first,
     read_map_file      = first,
     read_enc_file      = first,
     read_sfd_file      = first,
@@ -491,6 +492,7 @@ local callbacktypes = callbacktypes or {
 %    \begin{macrocode}
     process_input_buffer  = data,
     process_output_buffer = data,
+    process_jobname       = list,
     token_filter          = first,
 %    \end{macrocode}
 %
@@ -513,6 +515,7 @@ local callbacktypes = callbacktypes or {
 %    Section 4.1.5: information reporting callbacks.
 %
 %    \begin{macrocode}
+    pre_dump          = simple,
     start_run         = simple,
     stop_run          = simple,
     start_page_number = simple,
@@ -520,7 +523,13 @@ local callbacktypes = callbacktypes or {
     show_error_hook   = simple,
 %    \end{macrocode}
 %
-%    Section 4.1.6: font-related callbacks.
+%    Section 4.1.6: PDF-related callbacks.
+%
+%    \begin{macrocode}
+    finish_pdffile   = simple,
+%    \end{macrocode}
+%
+%    Section 4.1.7: font-related callbacks.
 %
 %    \begin{macrocode}
     define_font = first,
-- 
cgit v1.2.3


From ac1bab46625d787b09d6dc403e8632b8f2f7970b Mon Sep 17 00:00:00 2001
From: Elie Roux <elie.roux@telecom-bretagne.eu>
Date: Sun, 9 Jun 2013 10:59:58 +0200
Subject: Logging is just spoiling logs when done with hyphenate callback...

---
 luatexbase-mcb.dtx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index a032e26..d9fb995 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -626,12 +626,10 @@ end
 %    \begin{macrocode}
 local function simplehandler (name)
     return function(...)
-        local ret = true
+        local ret
         for _, f in ipairs(callbacklist[name]) do
             ret = f.func(...)
             if ret == false then
-                log("function '%s' returned false in callback '%s'",
-                    f.description, name)
                 return false
             end
         end
-- 
cgit v1.2.3

