method mode_key_bindings =
      match mode with
        None -> []
      | Some m -> m#key_bindings