From cf38e5245cd08bbf262618260c269536903ad0ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= <mpg@elzevir.fr>
Date: Sat, 6 Nov 2010 04:46:17 +0100
Subject: mcb: slightly more compact messages

---
 luatexbase-mcb.dtx | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

(limited to 'luatexbase-mcb.dtx')

diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index 43182dd..cb04f82 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -693,10 +693,10 @@ function add_to_callback (name,func,description,priority)
 %
 %    \begin{macrocode}
     if callbacktypes[name] == first and (priority ~= 1 or #l ~= 0) then
-        warning("several callbacks registered in callback '%s',\n"
-        .."only the first function will be active.", name)
+        warning("several functions in '%s',\n"
+        .."only one will be active.", name)
     end
-    info("inserting function '%s'\nat position %s in callback list\nfor '%s'",
+    info("inserting '%s'\nat position %s in '%s'",
       description, priority, name)
 end
 %    \end{macrocode}
@@ -738,11 +738,11 @@ function remove_from_callback (name, description)
         end
     end
     if not index then
-        err("unable to remove function '%s'\nfrom '%s'", description, name)
+        err("unable to remove '%s'\nfrom '%s'", description, name)
         return
     end
     table.remove(l, index)
-    info("removing function '%s'\nfrom '%s'", description, name)
+    info("removing '%s'\nfrom '%s'", description, name)
     if table.maxn(l) == 0 then
         callbacklist[name] = nil
         if not lua_callbacks_defaults[name] then
@@ -762,21 +762,19 @@ function reset_callback (name, make_false)
         err("unable to reset:\nno proper callback name passed")
         return
     elseif not callbacktypes[name] then
-        err("reset error: '%s'\nis not a valid callback", name)
+        err("unable to reset '%s':\nis not a valid callback", name)
         return
     end
+    info("resetting callback '%s'", name)
+    callbacklist[name] = nil
     if not lua_callbacks_defaults[name] then
         if make_false == true then
+            info("setting '%s' to false", name)
             register_callback(name, false)
         else
             register_callback(name, nil)
         end
     end
-    local l = callbacklist[name]
-    if l then
-        info("resetting callback list '%s'",name)
-        callbacklist[name] = nil
-    end
 end
 %    \end{macrocode}
 %
@@ -834,7 +832,7 @@ function create_callback(name, ctype, default)
         err("unable to create callback '%s':\ntype '%s' undefined", name, ctype)
         return nil
     end
-    info("creating new callback '%s'", name)
+    info("creating callback '%s'", name)
     lua_callbacks_defaults[name] = default
     callbacktypes[name] = ctype
 end
-- 
cgit v1.2.3

