]> git.decadent.org.uk Git - ion3.git/blob - debian/patches/101_ignore-mising-keys.diff
Suppressed warnings for missing keys for non-critical key bindings
[ion3.git] / debian / patches / 101_ignore-mising-keys.diff
1 --- trunk.orig/etc/cfg_menu.lua
2 +++ trunk/etc/cfg_menu.lua
3 @@ -9,14 +9,14 @@
4  
5  defbindings("WMenu", {
6      bdoc("Close the menu."),
7 -    kpress("Escape", "WMenu.cancel(_)"),
8 +    kpress("Escape", "WMenu.cancel(_)", nil, true),
9      kpress("Control+G", "WMenu.cancel(_)"),
10      kpress("Control+C", "WMenu.cancel(_)"),
11      kpress("Left", "WMenu.cancel(_)"),
12      
13      bdoc("Activate current menu entry."),
14      kpress("Return",  "WMenu.finish(_)"),
15 -    kpress("KP_Enter", "WMenu.finish(_)"),
16 +    kpress("KP_Enter", "WMenu.finish(_)", nil, true),
17      kpress("Control+M", "WMenu.finish(_)"),
18      kpress("Right", "WMenu.finish(_)"),
19      
20 --- trunk.orig/etc/cfg_query.lua
21 +++ trunk/etc/cfg_query.lua
22 @@ -17,8 +17,8 @@
23      bdoc("Go to end/beginning."),
24      kpress("Control+E", "WEdln.eol(_)"),
25      kpress("Control+A", "WEdln.bol(_)"),
26 -    kpress("End", "WEdln.eol(_)"),
27 -    kpress("Home", "WEdln.bol(_)"),
28 +    kpress("End", "WEdln.eol(_)", nil, true),
29 +    kpress("Home", "WEdln.bol(_)", nil, true),
30      
31      bdoc("Skip one word forward/backward."),
32      kpress("Control+X", "WEdln.skip_word(_)"),
33 @@ -26,7 +26,7 @@
34  
35      bdoc("Delete next character."),
36      kpress("Control+D", "WEdln.delete(_)"),
37 -    kpress("Delete", "WEdln.delete(_)"),
38 +    kpress("Delete", "WEdln.delete(_)", nil, true),
39      
40      bdoc("Delete previous character."),
41      kpress("BackSpace", "WEdln.backspace(_)"),
42 @@ -87,21 +87,21 @@
43      bdoc("Close the query and execute bound action."),
44      kpress("Control+M", "WEdln.finish(_)"),
45      kpress("Return", "WEdln.finish(_)"),
46 -    kpress("KP_Enter", "WEdln.finish(_)"),
47 +    kpress("KP_Enter", "WEdln.finish(_)", nil, true),
48  })
49  
50  
51  defbindings("WInput", {
52      bdoc("Close the query/message box, not executing bound actions."),
53 -    kpress("Escape", "WInput.cancel(_)"),
54 +    kpress("Escape", "WInput.cancel(_)", nil, true),
55      kpress("Control+G", "WInput.cancel(_)"),
56      kpress("Control+C", "WInput.cancel(_)"),
57      
58      bdoc("Scroll the message or completions up/down."),
59      kpress("Control+U", "WInput.scrollup(_)"),
60      kpress("Control+V", "WInput.scrolldown(_)"),
61 -    kpress("Page_Up", "WInput.scrollup(_)"),
62 -    kpress("Page_Down", "WInput.scrolldown(_)"),
63 +    kpress("Page_Up", "WInput.scrollup(_)", nil, true),
64 +    kpress("Page_Down", "WInput.scrolldown(_)", nil, true),
65  })
66  
67  
68 --- trunk.orig/ioncore/conf-bindings.c
69 +++ trunk/ioncore/conf-bindings.c
70 @@ -55,7 +55,7 @@
71  
72  
73  bool ioncore_parse_keybut(const char *str, uint *mod_ret, uint *ksb_ret,
74 -                          bool button, bool init_any)
75 +                          bool button, bool init_any, bool quiet_absent)
76  {
77      char *str2, *p, *p2;
78      int keysym=NoSymbol, i;
79 @@ -94,7 +94,8 @@
80                  break;
81              }
82              if(XKeysymToKeycode(ioncore_g.dpy, keysym)==0){
83 -                warn_obj(str, TR("Could not convert keysym to keycode."));
84 +                if(!quiet_absent)
85 +                    warn_obj(str, TR("Could not convert keysym to keycode."));
86                  break;
87              }
88              *ksb_ret=keysym;
89 @@ -256,6 +257,7 @@
90      ExtlFn func;
91      bool wr=FALSE;
92      int area=0;
93 +    bool extra;
94      
95      if(!extl_table_gets_s(tab, "action", &action_str)){
96          warn(TR("Binding type not set."));
97 @@ -277,9 +279,12 @@
98          if(!extl_table_gets_s(tab, "kcb", &ksb_str))
99              goto fail;
100  
101 +        if(!extl_table_gets_b(tab, "extra", &extra))
102 +            extra=FALSE;
103 +
104          if(!ioncore_parse_keybut(ksb_str, &mod, &ksb,
105                                   (action!=BINDING_KEYPRESS && action!=-1), 
106 -                                 init_any)){
107 +                                 init_any, extra)){
108              goto fail;
109          }
110      }
111 --- trunk.orig/ioncore/ioncore_bindings.lua
112 +++ trunk/ioncore/ioncore_bindings.lua
113 @@ -125,9 +125,12 @@
114  -- Creates a binding description table for the action of pressing a key given 
115  -- by \var{keyspec} (with possible modifiers) to the function \var{cmd}.
116  -- The \var{guard} controls when the binding can be called.
117 +-- The \var{extra} flag signals whether the binding is a non-critical extra
118 +-- binding.  If this is true and a named key does not exist, the binding will
119 +-- be quietly ignored.
120  -- For more informationp see Section \ref{sec:bindings}.
121 -function ioncore.kpress(keyspec, cmd, guard)
122 -    return putcmd(cmd, guard, {action = "kpress", kcb = keyspec})
123 +function ioncore.kpress(keyspec, cmd, guard, extra)
124 +    return putcmd(cmd, guard, {action = "kpress", kcb = keyspec, extra = extra})
125  end
126  
127  --DOC
128 --- trunk.orig/ioncore/conf-bindings.h
129 +++ trunk/ioncore/conf-bindings.h
130 @@ -19,6 +19,6 @@
131  
132  extern bool ioncore_parse_keybut(const char *str, 
133                                   uint *mod_ret, uint *ksb_ret,
134 -                                 bool button, bool init_any);
135 +                                 bool button, bool init_any, bool quiet_absent);
136  
137  #endif /* ION_IONCORE_CONF_BINDINGS_H */
138 --- trunk.orig/etc/cfg_ioncore.lua
139 +++ trunk/etc/cfg_ioncore.lua
140 @@ -284,7 +284,7 @@
141  
142  defbindings("WMoveresMode", {
143      bdoc("Cancel the resize mode."),
144 -    kpress("AnyModifier+Escape","WMoveresMode.cancel(_)"),
145 +    kpress("AnyModifier+Escape","WMoveresMode.cancel(_)", nil, true),
146  
147      bdoc("End the resize mode."),
148      kpress("AnyModifier+Return","WMoveresMode.finish(_)"),