From 44681b6bd22a913716a6b014558206064e90a59f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 20 Jul 2008 22:46:12 +0000 Subject: [PATCH] Suppressed warnings for missing keys for non-critical key bindings closes: #488673 --- debian/patches/101_ignore-mising-keys.diff | 148 +++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 149 insertions(+) create mode 100644 debian/patches/101_ignore-mising-keys.diff diff --git a/debian/patches/101_ignore-mising-keys.diff b/debian/patches/101_ignore-mising-keys.diff new file mode 100644 index 0000000..9e37c8d --- /dev/null +++ b/debian/patches/101_ignore-mising-keys.diff @@ -0,0 +1,148 @@ +--- trunk.orig/etc/cfg_menu.lua ++++ trunk/etc/cfg_menu.lua +@@ -9,14 +9,14 @@ + + defbindings("WMenu", { + bdoc("Close the menu."), +- kpress("Escape", "WMenu.cancel(_)"), ++ kpress("Escape", "WMenu.cancel(_)", nil, true), + kpress("Control+G", "WMenu.cancel(_)"), + kpress("Control+C", "WMenu.cancel(_)"), + kpress("Left", "WMenu.cancel(_)"), + + bdoc("Activate current menu entry."), + kpress("Return", "WMenu.finish(_)"), +- kpress("KP_Enter", "WMenu.finish(_)"), ++ kpress("KP_Enter", "WMenu.finish(_)", nil, true), + kpress("Control+M", "WMenu.finish(_)"), + kpress("Right", "WMenu.finish(_)"), + +--- trunk.orig/etc/cfg_query.lua ++++ trunk/etc/cfg_query.lua +@@ -17,8 +17,8 @@ + bdoc("Go to end/beginning."), + kpress("Control+E", "WEdln.eol(_)"), + kpress("Control+A", "WEdln.bol(_)"), +- kpress("End", "WEdln.eol(_)"), +- kpress("Home", "WEdln.bol(_)"), ++ kpress("End", "WEdln.eol(_)", nil, true), ++ kpress("Home", "WEdln.bol(_)", nil, true), + + bdoc("Skip one word forward/backward."), + kpress("Control+X", "WEdln.skip_word(_)"), +@@ -26,7 +26,7 @@ + + bdoc("Delete next character."), + kpress("Control+D", "WEdln.delete(_)"), +- kpress("Delete", "WEdln.delete(_)"), ++ kpress("Delete", "WEdln.delete(_)", nil, true), + + bdoc("Delete previous character."), + kpress("BackSpace", "WEdln.backspace(_)"), +@@ -87,21 +87,21 @@ + bdoc("Close the query and execute bound action."), + kpress("Control+M", "WEdln.finish(_)"), + kpress("Return", "WEdln.finish(_)"), +- kpress("KP_Enter", "WEdln.finish(_)"), ++ kpress("KP_Enter", "WEdln.finish(_)", nil, true), + }) + + + defbindings("WInput", { + bdoc("Close the query/message box, not executing bound actions."), +- kpress("Escape", "WInput.cancel(_)"), ++ kpress("Escape", "WInput.cancel(_)", nil, true), + kpress("Control+G", "WInput.cancel(_)"), + kpress("Control+C", "WInput.cancel(_)"), + + bdoc("Scroll the message or completions up/down."), + kpress("Control+U", "WInput.scrollup(_)"), + kpress("Control+V", "WInput.scrolldown(_)"), +- kpress("Page_Up", "WInput.scrollup(_)"), +- kpress("Page_Down", "WInput.scrolldown(_)"), ++ kpress("Page_Up", "WInput.scrollup(_)", nil, true), ++ kpress("Page_Down", "WInput.scrolldown(_)", nil, true), + }) + + +--- trunk.orig/ioncore/conf-bindings.c ++++ trunk/ioncore/conf-bindings.c +@@ -55,7 +55,7 @@ + + + bool ioncore_parse_keybut(const char *str, uint *mod_ret, uint *ksb_ret, +- bool button, bool init_any) ++ bool button, bool init_any, bool quiet_absent) + { + char *str2, *p, *p2; + int keysym=NoSymbol, i; +@@ -94,7 +94,8 @@ + break; + } + if(XKeysymToKeycode(ioncore_g.dpy, keysym)==0){ +- warn_obj(str, TR("Could not convert keysym to keycode.")); ++ if(!quiet_absent) ++ warn_obj(str, TR("Could not convert keysym to keycode.")); + break; + } + *ksb_ret=keysym; +@@ -256,6 +257,7 @@ + ExtlFn func; + bool wr=FALSE; + int area=0; ++ bool extra; + + if(!extl_table_gets_s(tab, "action", &action_str)){ + warn(TR("Binding type not set.")); +@@ -277,9 +279,12 @@ + if(!extl_table_gets_s(tab, "kcb", &ksb_str)) + goto fail; + ++ if(!extl_table_gets_b(tab, "extra", &extra)) ++ extra=FALSE; ++ + if(!ioncore_parse_keybut(ksb_str, &mod, &ksb, + (action!=BINDING_KEYPRESS && action!=-1), +- init_any)){ ++ init_any, extra)){ + goto fail; + } + } +--- trunk.orig/ioncore/ioncore_bindings.lua ++++ trunk/ioncore/ioncore_bindings.lua +@@ -125,9 +125,12 @@ + -- Creates a binding description table for the action of pressing a key given + -- by \var{keyspec} (with possible modifiers) to the function \var{cmd}. + -- The \var{guard} controls when the binding can be called. ++-- The \var{extra} flag signals whether the binding is a non-critical extra ++-- binding. If this is true and a named key does not exist, the binding will ++-- be quietly ignored. + -- For more informationp see Section \ref{sec:bindings}. +-function ioncore.kpress(keyspec, cmd, guard) +- return putcmd(cmd, guard, {action = "kpress", kcb = keyspec}) ++function ioncore.kpress(keyspec, cmd, guard, extra) ++ return putcmd(cmd, guard, {action = "kpress", kcb = keyspec, extra = extra}) + end + + --DOC +--- trunk.orig/ioncore/conf-bindings.h ++++ trunk/ioncore/conf-bindings.h +@@ -19,6 +19,6 @@ + + extern bool ioncore_parse_keybut(const char *str, + uint *mod_ret, uint *ksb_ret, +- bool button, bool init_any); ++ bool button, bool init_any, bool quiet_absent); + + #endif /* ION_IONCORE_CONF_BINDINGS_H */ +--- trunk.orig/etc/cfg_ioncore.lua ++++ trunk/etc/cfg_ioncore.lua +@@ -284,7 +284,7 @@ + + defbindings("WMoveresMode", { + bdoc("Cancel the resize mode."), +- kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"), ++ kpress("AnyModifier+Escape","WMoveresMode.cancel(_)", nil, true), + + bdoc("End the resize mode."), + kpress("AnyModifier+Return","WMoveresMode.finish(_)"), diff --git a/debian/patches/series b/debian/patches/series index 6de1150..dfa21ca 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +101_ignore-mising-keys.diff 201_build-config.diff 205_ion-lock.diff 206_use-x-terminal-emulator.diff -- 2.39.2