completion-sorting.diff
changeset 54 8688a72eb1ac
parent 53 577410087c82
equal deleted inserted replaced
53:577410087c82 54:8688a72eb1ac
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent c6fafa6e6be9e56ad327450b2d7f01f2a8505a5e
     2 # Parent 88836b149cfab6e695f70b3c7e52fe8b99b09900
     3 Make completion sorting order configurable
     3 Make completion sorting order configurable
     4 
     4 
     5   * Use allocated plain array for categories
     5   * Use allocated plain array for categories
     6   * Use callbacks for dynamic completions (private for now)
     6   * Use callbacks for dynamic completions (private for now)
     7   * Add compl_set_flags() to allow user to set completion order
     7   * Add compl_set_flags() to allow user to set completion order
     8   * Bump api to 24-24
     8   * Bump api to 24-24
     9 
     9 
    10 diff -r c6fafa6e6be9 mcabber/ChangeLog.api
    10 diff -r 88836b149cfa mcabber/ChangeLog.api
    11 --- a/mcabber/ChangeLog.api	Thu Oct 18 21:48:25 2012 +0300
    11 --- a/mcabber/ChangeLog.api	Sat Oct 20 18:02:25 2012 +0300
    12 +++ b/mcabber/ChangeLog.api	Thu Oct 18 21:48:47 2012 +0300
    12 +++ b/mcabber/ChangeLog.api	Sat Oct 20 18:27:46 2012 +0300
    13 @@ -1,3 +1,10 @@
    13 @@ -1,3 +1,10 @@
    14 +dev (24)
    14 +dev (24)
    15 + * MQ patch completion-sorting.diff
    15 + * MQ patch completion-sorting.diff
    16 + * Change compl_add_category() to accept flags arg
    16 + * Change compl_add_category() to accept flags arg
    17 + * Define MCABBER_API_HAVE_COMPL_FLAGS
    17 + * Define MCABBER_API_HAVE_COMPL_FLAGS
    19 +  -- Myhailo Danylenko, 2012-10-18
    19 +  -- Myhailo Danylenko, 2012-10-18
    20 +
    20 +
    21  dev (23)
    21  dev (23)
    22   * Changeset 8dc418af3e72
    22   * Changeset 8dc418af3e72
    23     Add buddy_(get|set)activeresource() functions
    23     Add buddy_(get|set)activeresource() functions
    24 diff -r c6fafa6e6be9 mcabber/mcabber/api.h
    24 diff -r 88836b149cfa mcabber/mcabber/api.h
    25 --- a/mcabber/mcabber/api.h	Thu Oct 18 21:48:25 2012 +0300
    25 --- a/mcabber/mcabber/api.h	Sat Oct 20 18:02:25 2012 +0300
    26 +++ b/mcabber/mcabber/api.h	Thu Oct 18 21:48:47 2012 +0300
    26 +++ b/mcabber/mcabber/api.h	Sat Oct 20 18:27:46 2012 +0300
    27 @@ -4,12 +4,15 @@
    27 @@ -4,12 +4,15 @@
    28  #include <glib.h>
    28  #include <glib.h>
    29  #include <mcabber/config.h> // For MCABBER_BRANCH
    29  #include <mcabber/config.h> // For MCABBER_BRANCH
    30  
    30  
    31 -#define MCABBER_API_VERSION 23
    31 -#define MCABBER_API_VERSION 23
    40 +// compl_new_category accepts flags argument
    40 +// compl_new_category accepts flags argument
    41 +#define MCABBER_API_HAVE_COMPL_FLAGS 1
    41 +#define MCABBER_API_HAVE_COMPL_FLAGS 1
    42  
    42  
    43  extern const gchar *mcabber_branch;
    43  extern const gchar *mcabber_branch;
    44  extern const guint mcabber_api_version;
    44  extern const guint mcabber_api_version;
    45 diff -r c6fafa6e6be9 mcabber/mcabber/compl.c
    45 diff -r 88836b149cfa mcabber/mcabber/compl.c
    46 --- a/mcabber/mcabber/compl.c	Thu Oct 18 21:48:25 2012 +0300
    46 --- a/mcabber/mcabber/compl.c	Sat Oct 20 18:02:25 2012 +0300
    47 +++ b/mcabber/mcabber/compl.c	Thu Oct 18 21:48:47 2012 +0300
    47 +++ b/mcabber/mcabber/compl.c	Sat Oct 20 18:27:46 2012 +0300
    48 @@ -2,7 +2,7 @@
    48 @@ -2,7 +2,7 @@
    49   * compl.c      -- Completion system
    49   * compl.c      -- Completion system
    50   *
    50   *
    51   * Copyright (C) 2005-2010 Mikael Berthe <mikael@lilotux.net>
    51   * Copyright (C) 2005-2010 Mikael Berthe <mikael@lilotux.net>
    52 - * Copyright (C) 2009,2010 Myhailo Danylenko <isbear@ukrpost.net>
    52 - * Copyright (C) 2009,2010 Myhailo Danylenko <isbear@ukrpost.net>
    53 + * Copyright (C) 2009-2012 Myhailo Danylenko <isbear@ukrpost.net>
    53 + * Copyright (C) 2009-2012 Myhailo Danylenko <isbear@ukrpost.net>
    54   *
    54   *
    55   * This program is free software; you can redistribute it and/or modify
    55   * This program is free software; you can redistribute it and/or modify
    56   * it under the terms of the GNU General Public License as published by
    56   * it under the terms of the GNU General Public License as published by
    57 @@ -47,82 +47,148 @@
    57 @@ -47,82 +47,150 @@
    58    GSList *next;         // pointer to next completion to try
    58    GSList *next;         // pointer to next completion to try
    59  } compl;
    59  } compl;
    60  
    60  
    61 +typedef GSList *(*compl_handler_t) (void); // XXX userdata? *dynlist?
    61 +typedef GSList *(*compl_handler_t) (void); // XXX userdata? *dynlist?
    62 +
    62 +
   108 +  for (cel = compl; cel; cel = cel->next)
   108 +  for (cel = compl; cel; cel = cel->next)
   109 +    cel->data = g_strdup(cel->data);
   109 +    cel->data = g_strdup(cel->data);
   110 +  compl = g_slist_append(compl, g_strdup("list"));
   110 +  compl = g_slist_append(compl, g_strdup("list"));
   111 +  return compl;
   111 +  return compl;
   112 +}
   112 +}
   113 +  
   113 +
   114 +static inline void register_builtin_cat(guint c, compl_handler_t dynamic) {
   114 +static inline void register_builtin_cat(guint c, compl_handler_t dynamic) {
   115 +  Categories[c-1].flags   = COMPL_CAT_BUILTIN | COMPL_CAT_ACTIVE;
   115 +  Categories[c-1].flags   = COMPL_CAT_BUILTIN | COMPL_CAT_ACTIVE;
   116 +  Categories[c-1].words   = NULL;
   116 +  Categories[c-1].words   = NULL;
   117 +  Categories[c-1].dynamic = dynamic;
   117 +  Categories[c-1].dynamic = dynamic;
   118 +  if (dynamic != NULL) {
   118 +  if (dynamic != NULL) {
   120 +  }
   120 +  }
   121  }
   121  }
   122  
   122  
   123  void compl_init_system(void)
   123  void compl_init_system(void)
   124  {
   124  {
       
   125 +  num_categories = COMPL_MAX_ID;
   125 +#ifdef MODULES_ENABLE
   126 +#ifdef MODULES_ENABLE
   126 +  num_categories = 64; // XXX
   127 +  num_categories = ((num_categories / 16) + 1) * 16;
   127 +#else
       
   128 +  num_categories = COMPL_MODULE;
       
   129 +#endif
   128 +#endif
   130 +  Categories = g_new(category, num_categories);
   129 +  Categories = g_new0(category, num_categories);
   131 +
   130 +
   132    // Builtin completion categories:
   131    // Builtin completion categories:
   133 -  register_builtin_cat(COMPL_CMD);
   132 -  register_builtin_cat(COMPL_CMD);
   134 -  register_builtin_cat(COMPL_JID);
   133 -  register_builtin_cat(COMPL_JID);
   135 -  register_builtin_cat(COMPL_URLJID);
   134 -  register_builtin_cat(COMPL_URLJID);
   186 -// as it is likely to change in future.
   185 -// as it is likely to change in future.
   187 -guint compl_new_category(void)
   186 -guint compl_new_category(void)
   188 +guint compl_new_category(guint flags)
   187 +guint compl_new_category(guint flags)
   189  {
   188  {
   190 -  const guint maxcat = 8 * sizeof (registered_cats);
   189 -  const guint maxcat = 8 * sizeof (registered_cats);
   191    guint i = 0;
   190 -  guint i = 0;
   192 -  while ((registered_cats >> i) & 1 && i < maxcat)
   191 -  while ((registered_cats >> i) & 1 && i < maxcat)
   193 -    i++;
   192 -    i++;
   194 -  if (i >= maxcat)
   193 -  if (i >= maxcat)
   195 -    return 0;
   194 -    return 0;
   196 -  else {
   195 -  else {
   197 -    guint64 id = 1 << i;
   196 -    guint64 id = 1 << i;
   198 -    registered_cats |= id;
   197 -    registered_cats |= id;
   199 -    return i+1;
   198 -    return i+1;
   200 +  for (; i < num_categories; i++)
   199 +  guint i;
       
   200 +  for (i = 0; i < num_categories; i++)
   201 +    if (!(Categories[i].flags & COMPL_CAT_ACTIVE))
   201 +    if (!(Categories[i].flags & COMPL_CAT_ACTIVE))
   202 +      break;
   202 +      break;
   203 +  if (i >= num_categories ) {
   203 +  if (i >= num_categories ) {
       
   204 +    guint j;
   204 +    if (num_categories > G_MAXUINT - 16) {
   205 +    if (num_categories > G_MAXUINT - 16) {
   205 +      scr_log_print(LPRINT_LOGNORM, "Warning: Too many "
   206 +      scr_log_print(LPRINT_LOGNORM, "Warning: Too many "
   206 +                    "completion categories!");
   207 +                    "completion categories!");
   207 +      return 0;
   208 +      return 0;
   208 +    }
   209 +    }
   209 +    num_categories += 16;
   210 +    num_categories += 16;
   210 +    Categories = g_renew(category, Categories, num_categories);
   211 +    Categories = g_renew(category, Categories, num_categories);
       
   212 +    for (j = i+1; j < num_categories; j++)
       
   213 +      Categories[j].flags = 0;
   211    }
   214    }
   212 +  Categories[i].flags = COMPL_CAT_ACTIVE | (flags & COMPL_CAT_USERFLAGS);
   215 +  Categories[i].flags = COMPL_CAT_ACTIVE | (flags & COMPL_CAT_USERFLAGS);
   213 +  Categories[i].words = NULL;
   216 +  Categories[i].words = NULL;
   214 +  return i+1;
   217 +  return i+1;
   215  }
   218  }
   226 -                  "Invalid category.");
   229 -                  "Invalid category.");
   227 +  GSList *wel;
   230 +  GSList *wel;
   228 +
   231 +
   229 +  if (!compl) {
   232 +  if (!compl) {
   230 +    scr_log_print(LPRINT_DEBUG, "Error: compl_del_category() - "
   233 +    scr_log_print(LPRINT_DEBUG, "Error: compl_del_category() - "
   231 +                                "Invalid category.");
   234 +                                "Invalid category (0).");
   232      return;
   235      return;
   233    }
   236    }
   234 -  id--;
   237 -  id--;
   235 -  registered_cats &= ~(1<<id);
   238 -  registered_cats &= ~(1<<id);
   236 +
   239 +
   248 +    g_free (wel -> data);
   251 +    g_free (wel -> data);
   249 +  g_slist_free (Categories[compl].words);
   252 +  g_slist_free (Categories[compl].words);
   250  }
   253  }
   251  #endif
   254  #endif
   252  
   255  
   253 @@ -136,12 +202,15 @@
   256 @@ -136,12 +204,15 @@
   254  guint new_completion(const char *prefix, GSList *compl_cat, const gchar *suffix)
   257  guint new_completion(const char *prefix, GSList *compl_cat, const gchar *suffix)
   255  {
   258  {
   256    compl *c;
   259    compl *c;
   257 +  guint  ret_len = 0;
   260 +  guint  ret_len = 0;
   258    GSList *sl_cat;
   261    GSList *sl_cat;
   259    gint (*cmp)(const char *s1, const char *s2, size_t n);
   262    gint (*cmp)(const char *s1, const char *s2, size_t n);
   260    size_t len = strlen(prefix);
   263    size_t len = strlen(prefix);
   261  
   264  
   262    if (InputCompl) { // This should not happen, but hey...
   265    if (InputCompl) { // This should not happen, but hey...
   263 -    cancel_completion();
   266 -    cancel_completion();
   264 +    scr_log_print(LPRINT_DEBUG, "Warinng: new_completion() - "
   267 +    scr_log_print(LPRINT_DEBUG, "Warning: new_completion() - "
   265 +                                "Previous completion exists!");
   268 +                                "Previous completion exists!");
   266 +    done_completion();
   269 +    done_completion();
   267    }
   270    }
   268  
   271  
   269    if (settings_opt_get_int("completion_ignore_case"))
   272    if (settings_opt_get_int("completion_ignore_case"))
   270 @@ -160,14 +229,15 @@
   273 @@ -160,14 +231,15 @@
   271            compval = g_strdup_printf("%s%s", word+len, suffix);
   274            compval = g_strdup_printf("%s%s", word+len, suffix);
   272          else
   275          else
   273            compval = g_strdup(word+len);
   276            compval = g_strdup(word+len);
   274 -        c->list = g_slist_insert_sorted(c->list, compval,
   277 -        c->list = g_slist_insert_sorted(c->list, compval,
   275 -                                        (GCompareFunc)g_ascii_strcasecmp);
   278 -                                        (GCompareFunc)g_ascii_strcasecmp);
   285 -  return g_slist_length(c->list);
   288 -  return g_slist_length(c->list);
   286 +  return ret_len;
   289 +  return ret_len;
   287  }
   290  }
   288  
   291  
   289  //  done_completion();
   292  //  done_completion();
   290 @@ -222,35 +292,46 @@
   293 @@ -222,35 +294,46 @@
   291  
   294  
   292  /* Categories functions */
   295  /* Categories functions */
   293  
   296  
   294 +static gint compl_sort_forward(gconstpointer a, gconstpointer b)
   297 +static gint compl_sort_forward(gconstpointer a, gconstpointer b)
   295 +{
   298 +{
   320 -  category *cat;
   323 -  category *cat;
   321    char *nword;
   324    char *nword;
   322  
   325  
   323    if (!categ) {
   326    if (!categ) {
   324 -    scr_log_print(LPRINT_LOGNORM, "Error: compl_add_category_word() - "
   327 -    scr_log_print(LPRINT_LOGNORM, "Error: compl_add_category_word() - "
       
   328 -                  "Invalid category.");
   325 +    scr_log_print(LPRINT_DEBUG, "Error: compl_add_category_word() - "
   329 +    scr_log_print(LPRINT_DEBUG, "Error: compl_add_category_word() - "
   326                    "Invalid category.");
   330 +                  "Invalid category (0).");
   327      return;
   331      return;
   328    }
   332    }
   329 -
   333  
   330 +  
       
   331    categ--;
   334    categ--;
   332 -  catv = 1UL << categ;
   335 -  catv = 1UL << categ;
   333 -
   336  
   334 -  // Look for category
   337 -  // Look for category
   335 -  for (sl_cat=Categories; sl_cat; sl_cat = g_slist_next(sl_cat)) {
   338 -  for (sl_cat=Categories; sl_cat; sl_cat = g_slist_next(sl_cat)) {
   336 -    if (catv == ((category*)sl_cat->data)->flag)
   339 -    if (catv == ((category*)sl_cat->data)->flag)
   337 -      break;
   340 -      break;
   338 +  
       
   339 +  if ((categ >= num_categories) ||
   341 +  if ((categ >= num_categories) ||
   340 +      !(Categories[categ].flags & COMPL_CAT_ACTIVE)) {
   342 +      !(Categories[categ].flags & COMPL_CAT_ACTIVE)) {
   341 +    scr_log_print(LPRINT_DEBUG, "Error: compl_add_category_word() - "
   343 +    scr_log_print(LPRINT_DEBUG, "Error: compl_add_category_word() - "
   342 +                  "Not existing category.");
   344 +                  "Category does not exist.");
   343 +    return;
   345 +    return;
   344    }
   346    }
   345 -  if (!sl_cat) {   // Category not found, let's create it
   347 -  if (!sl_cat) {   // Category not found, let's create it
   346 -    cat = g_new0(category, 1);
   348 -    cat = g_new0(category, 1);
   347 -    cat->flag = catv;
   349 -    cat->flag = catv;
   349 -  } else
   351 -  } else
   350 -    cat = (category*)sl_cat->data;
   352 -    cat = (category*)sl_cat->data;
   351  
   353  
   352    // If word is not space-terminated, we add one trailing space
   354    // If word is not space-terminated, we add one trailing space
   353    for (nword = (char*)word; *nword; nword++)
   355    for (nword = (char*)word; *nword; nword++)
   354 @@ -262,59 +343,64 @@
   356 @@ -262,59 +345,64 @@
   355      nword = g_strdup(word);
   357      nword = g_strdup(word);
   356    }
   358    }
   357  
   359  
   358 -  if (g_slist_find_custom(cat->words, nword, (GCompareFunc)g_strcmp0) != NULL)
   360 -  if (g_slist_find_custom(cat->words, nword, (GCompareFunc)g_strcmp0) != NULL)
   359 -    return;
   361 -    return;
   386 +  GSList *wel;
   388 +  GSList *wel;
   387    char *nword;
   389    char *nword;
   388  
   390  
   389    if (!categ) {
   391    if (!categ) {
   390 -    scr_log_print(LPRINT_LOGNORM, "Error: compl_del_category_word() - "
   392 -    scr_log_print(LPRINT_LOGNORM, "Error: compl_del_category_word() - "
       
   393 -                  "Invalid category.");
   391 +    scr_log_print(LPRINT_DEBUG, "Error: compl_del_category_word() - "
   394 +    scr_log_print(LPRINT_DEBUG, "Error: compl_del_category_word() - "
   392                    "Invalid category.");
   395 +                  "Invalid category (0).");
   393      return;
   396      return;
   394    }
   397    }
   395  
   398  
   396    categ--;
   399    categ--;
   397 -  catv = 1UL << categ;
   400 -  catv = 1UL << categ;
   401 -    if (catv == ((category*)sl_cat->data)->flag)
   404 -    if (catv == ((category*)sl_cat->data)->flag)
   402 -      break;
   405 -      break;
   403 +  if ((categ >= num_categories) ||
   406 +  if ((categ >= num_categories) ||
   404 +      !(Categories[categ].flags & COMPL_CAT_ACTIVE)) {
   407 +      !(Categories[categ].flags & COMPL_CAT_ACTIVE)) {
   405 +    scr_log_print(LPRINT_DEBUG, "Error: compl_del_category_word() - "
   408 +    scr_log_print(LPRINT_DEBUG, "Error: compl_del_category_word() - "
   406 +                  "Not existing category.");
   409 +                  "Category does not exist.");
   407 +    return;
   410 +    return;
   408    }
   411    }
   409 -  if (!sl_cat) return;   // Category not found, finished!
   412 -  if (!sl_cat) return;   // Category not found, finished!
   410 -
   413 -
   411 -  cat = (category*)sl_cat->data;
   414 -  cat = (category*)sl_cat->data;
   443 -  }
   446 -  }
   444 +  g_free (nword);
   447 +  g_free (nword);
   445  }
   448  }
   446  
   449  
   447  //  compl_get_category_list()
   450  //  compl_get_category_list()
   448 @@ -323,48 +409,28 @@
   451 @@ -323,48 +411,28 @@
   449  // whole list after use.
   452  // whole list after use.
   450  GSList *compl_get_category_list(guint categ, guint *dynlist)
   453  GSList *compl_get_category_list(guint categ, guint *dynlist)
   451  {
   454  {
   452 -  guint64 cat_flags;
   455 -  guint64 cat_flags;
   453 -  GSList *sl_cat;
   456 -  GSList *sl_cat;
   454 -
   457 -
   455    if (!categ) {
   458    if (!categ) {
   456 -    scr_log_print(LPRINT_LOGNORM, "Error: compl_get_category_list() - "
   459 -    scr_log_print(LPRINT_LOGNORM, "Error: compl_get_category_list() - "
       
   460 -                  "Invalid category.");
   457 +    scr_log_print(LPRINT_DEBUG, "Error: compl_get_category_list() - "
   461 +    scr_log_print(LPRINT_DEBUG, "Error: compl_get_category_list() - "
   458                    "Invalid category.");
   462 +                  "Invalid category (0).");
   459      return NULL;
   463      return NULL;
   460    }
   464    }
   461  
   465  
   462 -  *dynlist = FALSE;
   466 -  *dynlist = FALSE;
   463 -  cat_flags = 1UL << (categ - 1);
   467 -  cat_flags = 1UL << (categ - 1);
   490 -    compl = g_slist_append(compl, g_strdup("list"));
   494 -    compl = g_slist_append(compl, g_strdup("list"));
   491 -    return compl;
   495 -    return compl;
   492 +  if ((categ > num_categories) ||
   496 +  if ((categ > num_categories) ||
   493 +      !(Categories[categ].flags & COMPL_CAT_ACTIVE)) {
   497 +      !(Categories[categ].flags & COMPL_CAT_ACTIVE)) {
   494 +    scr_log_print(LPRINT_DEBUG, "Error: compl_get_category_list() - "
   498 +    scr_log_print(LPRINT_DEBUG, "Error: compl_get_category_list() - "
   495 +                  "Not existing category.");
   499 +                  "Category does not exist.");
   496 +    return NULL;
   500 +    return NULL;
   497    }
   501    }
   498  
   502  
   499 -  *dynlist = FALSE;
   503 -  *dynlist = FALSE;
   500 -  return NULL;
   504 -  return NULL;
   506 +    return Categories[categ].words;
   510 +    return Categories[categ].words;
   507 +  }
   511 +  }
   508  }
   512  }
   509  
   513  
   510  /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2:  For Vim users... */
   514  /* vim: set expandtab cindent cinoptions=>2\:2(0 sw=2 ts=2:  For Vim users... */
   511 diff -r c6fafa6e6be9 mcabber/mcabber/compl.h
   515 diff -r 88836b149cfa mcabber/mcabber/compl.h
   512 --- a/mcabber/mcabber/compl.h	Thu Oct 18 21:48:25 2012 +0300
   516 --- a/mcabber/mcabber/compl.h	Sat Oct 20 18:02:25 2012 +0300
   513 +++ b/mcabber/mcabber/compl.h	Thu Oct 18 21:48:47 2012 +0300
   517 +++ b/mcabber/mcabber/compl.h	Sat Oct 20 18:27:46 2012 +0300
   514 @@ -28,9 +28,15 @@
   518 @@ -27,10 +27,18 @@
       
   519  #define COMPL_OTR         20
   515  #define COMPL_OTRPOLICY   21
   520  #define COMPL_OTRPOLICY   21
   516  #define COMPL_MODULE      22
   521  #define COMPL_MODULE      22
   517  
   522 +/* private */
       
   523 +#define COMPL_MAX_ID      22
       
   524 +
   518 +void compl_init_system(void); /* private */
   525 +void compl_init_system(void); /* private */
   519 +
   526  
   520  #ifdef MODULES_ENABLE
   527  #ifdef MODULES_ENABLE
   521 -void  compl_init_system(void);
   528 -void  compl_init_system(void);
   522 -guint compl_new_category(void);
   529 -guint compl_new_category(void);
   523 +#define COMPL_FLAGS_SORT     0x00
   530 +#define COMPL_FLAGS_SORT     0x00
   524 +#define COMPL_FLAGS_REVERSE  0x10
   531 +#define COMPL_FLAGS_REVERSE  0x10
   527 +
   534 +
   528 +guint compl_new_category(guint flags);
   535 +guint compl_new_category(guint flags);
   529  void  compl_del_category(guint id);
   536  void  compl_del_category(guint id);
   530  #endif
   537  #endif
   531  
   538  
   532 diff -r c6fafa6e6be9 mcabber/mcabber/main.c
   539 diff -r 88836b149cfa mcabber/mcabber/main.c
   533 --- a/mcabber/mcabber/main.c	Thu Oct 18 21:48:25 2012 +0300
   540 --- a/mcabber/mcabber/main.c	Sat Oct 20 18:02:25 2012 +0300
   534 +++ b/mcabber/mcabber/main.c	Thu Oct 18 21:48:47 2012 +0300
   541 +++ b/mcabber/mcabber/main.c	Sat Oct 20 18:27:46 2012 +0300
   535 @@ -364,13 +364,13 @@
   542 @@ -364,13 +364,13 @@
   536    }
   543    }
   537  
   544  
   538    /* Initialize command system, roster and default key bindings */
   545    /* Initialize command system, roster and default key bindings */
   539 +  compl_init_system();
   546 +  compl_init_system();
   545  #ifdef MODULES_ENABLE
   552  #ifdef MODULES_ENABLE
   546 -  compl_init_system();
   553 -  compl_init_system();
   547    modules_init();
   554    modules_init();
   548  #endif
   555  #endif
   549    /* Initialize charset */
   556    /* Initialize charset */
   550 diff -r c6fafa6e6be9 mcabber/modules/beep/beep.c
   557 diff -r 88836b149cfa mcabber/modules/beep/beep.c
   551 --- a/mcabber/modules/beep/beep.c	Thu Oct 18 21:48:25 2012 +0300
   558 --- a/mcabber/modules/beep/beep.c	Sat Oct 20 18:02:25 2012 +0300
   552 +++ b/mcabber/modules/beep/beep.c	Thu Oct 18 21:48:47 2012 +0300
   559 +++ b/mcabber/modules/beep/beep.c	Sat Oct 20 18:27:46 2012 +0300
   553 @@ -89,7 +89,7 @@
   560 @@ -89,7 +89,7 @@
   554  static void beep_init(void)
   561  static void beep_init(void)
   555  {
   562  {
   556    /* Create completions */
   563    /* Create completions */
   557 -  beep_cid = compl_new_category();
   564 -  beep_cid = compl_new_category();