/[weechat]/weechat/src/common/completion.c
ViewVC logotype

Diff of /weechat/src/common/completion.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by flashcode, Tue Aug 16 15:02:01 2005 UTC revision 1.28 by flashcode, Sat Sep 3 12:37:22 2005 UTC
# Line 111  completion_build_list (t_completion *com Line 111  completion_build_list (t_completion *com
111      /* WeeChat internal commands */      /* WeeChat internal commands */
112            
113      /* no completion for some commands */      /* no completion for some commands */
114      if ((strcasecmp (completion->base_command, "server") == 0)      if ((ascii_strcasecmp (completion->base_command, "server") == 0)
115          || (strcasecmp (completion->base_command, "save") == 0))          || (ascii_strcasecmp (completion->base_command, "save") == 0))
116      {      {
117          completion_stop (completion);          completion_stop (completion);
118          return;          return;
119      }      }
120      if ((strcasecmp (completion->base_command, "alias") == 0)      if ((ascii_strcasecmp (completion->base_command, "alias") == 0)
121          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
122      {      {
123          for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)          for (ptr_list = index_commands; ptr_list; ptr_list = ptr_list->next_weelist)
# Line 128  completion_build_list (t_completion *com Line 128  completion_build_list (t_completion *com
128          }          }
129          return;          return;
130      }      }
131      if ((strcasecmp (completion->base_command, "buffer") == 0)      if ((ascii_strcasecmp (completion->base_command, "buffer") == 0)
132          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
133      {      {
134          weelist_add (&completion->completion_list,          weelist_add (&completion->completion_list,
# Line 145  completion_build_list (t_completion *com Line 145  completion_build_list (t_completion *com
145                       "notify");                       "notify");
146          return;          return;
147      }      }
148      if ((strcasecmp (completion->base_command, "clear") == 0)      if ((ascii_strcasecmp (completion->base_command, "clear") == 0)
149          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
150      {      {
151          weelist_add (&completion->completion_list,          weelist_add (&completion->completion_list,
# Line 153  completion_build_list (t_completion *com Line 153  completion_build_list (t_completion *com
153                       "-all");                       "-all");
154          return;          return;
155      }      }
156      if ((strcasecmp (completion->base_command, "connect") == 0)      if ((ascii_strcasecmp (completion->base_command, "connect") == 0)
157          || (strcasecmp (completion->base_command, "disconnect") == 0))          || (ascii_strcasecmp (completion->base_command, "disconnect") == 0))
158      {      {
159          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
160          {          {
# Line 173  completion_build_list (t_completion *com Line 173  completion_build_list (t_completion *com
173              return;              return;
174          }          }
175      }      }
176      if (strcasecmp (completion->base_command, "debug") == 0)      if (ascii_strcasecmp (completion->base_command, "debug") == 0)
177      {      {
178          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
179              weelist_add (&completion->completion_list,              weelist_add (&completion->completion_list,
# Line 183  completion_build_list (t_completion *com Line 183  completion_build_list (t_completion *com
183              completion_stop (completion);              completion_stop (completion);
184          return;          return;
185      }      }
186      if ((strcasecmp (completion->base_command, "help") == 0)      if ((ascii_strcasecmp (completion->base_command, "help") == 0)
187          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
188      {      {
189          for (i = 0; weechat_commands[i].command_name; i++)          for (i = 0; weechat_commands[i].command_name; i++)
# Line 201  completion_build_list (t_completion *com Line 201  completion_build_list (t_completion *com
201          }          }
202          return;          return;
203      }      }
204      if (strcasecmp (completion->base_command, "key") == 0)      if (ascii_strcasecmp (completion->base_command, "key") == 0)
205      {      {
206          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
207          {          {
# Line 229  completion_build_list (t_completion *com Line 229  completion_build_list (t_completion *com
229              return;              return;
230          }          }
231      }      }
232      if (((strcasecmp (completion->base_command, "perl") == 0)      if (((ascii_strcasecmp (completion->base_command, "perl") == 0)
233          || (strcasecmp (completion->base_command, "python") == 0))          || (ascii_strcasecmp (completion->base_command, "python") == 0))
234          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
235      {      {
236          weelist_add (&completion->completion_list,          weelist_add (&completion->completion_list,
# Line 247  completion_build_list (t_completion *com Line 247  completion_build_list (t_completion *com
247                       "unload");                       "unload");
248          return;          return;
249      }      }
250      if (strcasecmp (completion->base_command, "set") == 0)      if (ascii_strcasecmp (completion->base_command, "set") == 0)
251      {      {
252          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
253          {          {
# Line 340  completion_build_list (t_completion *com Line 340  completion_build_list (t_completion *com
340              completion_stop (completion);              completion_stop (completion);
341          return;          return;
342      }      }
343      if ((strcasecmp (completion->base_command, "unalias") == 0)      if ((ascii_strcasecmp (completion->base_command, "unalias") == 0)
344          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
345      {      {
346          for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)          for (ptr_alias = weechat_alias; ptr_alias; ptr_alias = ptr_alias->next_alias)
# Line 351  completion_build_list (t_completion *com Line 351  completion_build_list (t_completion *com
351          }          }
352          return;          return;
353      }      }
354      if (strcasecmp (completion->base_command, "window") == 0)      if (ascii_strcasecmp (completion->base_command, "window") == 0)
355      {      {
356          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
357          {          {
# Line 397  completion_build_list (t_completion *com Line 397  completion_build_list (t_completion *com
397      /* IRC commands */      /* IRC commands */
398            
399      /* no completion for some commands */      /* no completion for some commands */
400      if ((strcasecmp (completion->base_command, "admin") == 0)      if ((ascii_strcasecmp (completion->base_command, "admin") == 0)
401          || (strcasecmp (completion->base_command, "die") == 0)          || (ascii_strcasecmp (completion->base_command, "die") == 0)
402          || (strcasecmp (completion->base_command, "info") == 0)          || (ascii_strcasecmp (completion->base_command, "info") == 0)
403          || (strcasecmp (completion->base_command, "join") == 0)          || (ascii_strcasecmp (completion->base_command, "join") == 0)
404          || (strcasecmp (completion->base_command, "links") == 0)          || (ascii_strcasecmp (completion->base_command, "links") == 0)
405          || (strcasecmp (completion->base_command, "list") == 0)          || (ascii_strcasecmp (completion->base_command, "list") == 0)
406          || (strcasecmp (completion->base_command, "lusers") == 0)          || (ascii_strcasecmp (completion->base_command, "lusers") == 0)
407          || (strcasecmp (completion->base_command, "motd") == 0)          || (ascii_strcasecmp (completion->base_command, "motd") == 0)
408          || (strcasecmp (completion->base_command, "oper") == 0)          || (ascii_strcasecmp (completion->base_command, "oper") == 0)
409          || (strcasecmp (completion->base_command, "rehash") == 0)          || (ascii_strcasecmp (completion->base_command, "rehash") == 0)
410          || (strcasecmp (completion->base_command, "restart") == 0)          || (ascii_strcasecmp (completion->base_command, "restart") == 0)
411          || (strcasecmp (completion->base_command, "service") == 0)          || (ascii_strcasecmp (completion->base_command, "service") == 0)
412          || (strcasecmp (completion->base_command, "servlist") == 0)          || (ascii_strcasecmp (completion->base_command, "servlist") == 0)
413          || (strcasecmp (completion->base_command, "squery") == 0)          || (ascii_strcasecmp (completion->base_command, "squery") == 0)
414          || (strcasecmp (completion->base_command, "squit") == 0)          || (ascii_strcasecmp (completion->base_command, "squit") == 0)
415          || (strcasecmp (completion->base_command, "stats") == 0)          || (ascii_strcasecmp (completion->base_command, "stats") == 0)
416          || (strcasecmp (completion->base_command, "summon") == 0)          || (ascii_strcasecmp (completion->base_command, "summon") == 0)
417          || (strcasecmp (completion->base_command, "time") == 0)          || (ascii_strcasecmp (completion->base_command, "time") == 0)
418          || (strcasecmp (completion->base_command, "trace") == 0)          || (ascii_strcasecmp (completion->base_command, "trace") == 0)
419          || (strcasecmp (completion->base_command, "users") == 0)          || (ascii_strcasecmp (completion->base_command, "users") == 0)
420          || (strcasecmp (completion->base_command, "wallops") == 0)          || (ascii_strcasecmp (completion->base_command, "wallops") == 0)
421          || (strcasecmp (completion->base_command, "who") == 0))          || (ascii_strcasecmp (completion->base_command, "who") == 0))
422      {      {
423          completion_stop (completion);          completion_stop (completion);
424          return;          return;
425      }      }
426      if ((strcasecmp (completion->base_command, "away") == 0)      if ((ascii_strcasecmp (completion->base_command, "away") == 0)
427          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
428      {      {
429          if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])          if (cfg_irc_default_msg_away && cfg_irc_default_msg_away[0])
# Line 432  completion_build_list (t_completion *com Line 432  completion_build_list (t_completion *com
432                           cfg_irc_default_msg_away);                           cfg_irc_default_msg_away);
433          return;          return;
434      }      }
435      if ((strcasecmp (completion->base_command, "ctcp") == 0)      if ((ascii_strcasecmp (completion->base_command, "ctcp") == 0)
436          && (completion->base_command_arg == 2))          && (completion->base_command_arg == 2))
437      {      {
438          weelist_add (&completion->completion_list,          weelist_add (&completion->completion_list,
# Line 446  completion_build_list (t_completion *com Line 446  completion_build_list (t_completion *com
446                       "version");                       "version");
447          return;          return;
448      }      }
449      if ((strcasecmp (completion->base_command, "dcc") == 0)      if ((ascii_strcasecmp (completion->base_command, "dcc") == 0)
450          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
451      {      {
452          weelist_add (&completion->completion_list,          weelist_add (&completion->completion_list,
# Line 460  completion_build_list (t_completion *com Line 460  completion_build_list (t_completion *com
460                       "close");                       "close");
461          return;          return;
462      }      }
463      if (strcasecmp (completion->base_command, "invite") == 0)      if (ascii_strcasecmp (completion->base_command, "invite") == 0)
464      {      {
465          /* arg1: nickname */          /* arg1: nickname */
466          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
# Line 486  completion_build_list (t_completion *com Line 486  completion_build_list (t_completion *com
486          }          }
487          return;          return;
488      }      }
489      if (strcasecmp (completion->base_command, "kick") == 0)      if (ascii_strcasecmp (completion->base_command, "kick") == 0)
490      {      {
491          if (completion->base_command_arg != 1)          if (completion->base_command_arg != 1)
492              completion_stop (completion);              completion_stop (completion);
493          return;          return;
494      }      }
495      if (strcasecmp (completion->base_command, "kill") == 0)      if (ascii_strcasecmp (completion->base_command, "kill") == 0)
496      {      {
497          if (completion->base_command_arg != 1)          if (completion->base_command_arg != 1)
498              completion_stop (completion);              completion_stop (completion);
499          return;          return;
500      }      }
501      if (strcasecmp (completion->base_command, "me") == 0)      if (ascii_strcasecmp (completion->base_command, "me") == 0)
502      {      {
503          completion->context = COMPLETION_NICK;          completion->context = COMPLETION_NICK;
504          return;          return;
505      }      }
506      if (strcasecmp (completion->base_command, "notice") == 0)      if (ascii_strcasecmp (completion->base_command, "notice") == 0)
507      {      {
508          if (completion->base_command_arg != 1)          if (completion->base_command_arg != 1)
509              completion_stop (completion);              completion_stop (completion);
510          return;          return;
511      }      }
512      if ((strcasecmp (completion->base_command, "part") == 0)      if ((ascii_strcasecmp (completion->base_command, "part") == 0)
513          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
514      {      {
515          if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])          if (cfg_irc_default_msg_part && cfg_irc_default_msg_part[0])
# Line 518  completion_build_list (t_completion *com Line 518  completion_build_list (t_completion *com
518                           cfg_irc_default_msg_part);                           cfg_irc_default_msg_part);
519          return;          return;
520      }      }
521      if (strcasecmp (completion->base_command, "query") == 0)      if (ascii_strcasecmp (completion->base_command, "query") == 0)
522      {      {
523          if (completion->base_command_arg != 1)          if (completion->base_command_arg != 1)
524              completion_stop (completion);              completion_stop (completion);
525          return;          return;
526      }      }
527      if ((strcasecmp (completion->base_command, "quit") == 0)      if ((ascii_strcasecmp (completion->base_command, "quit") == 0)
528          && (completion->base_command_arg == 1))          && (completion->base_command_arg == 1))
529      {      {
530          if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])          if (cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0])
# Line 533  completion_build_list (t_completion *com Line 533  completion_build_list (t_completion *com
533                           cfg_irc_default_msg_quit);                           cfg_irc_default_msg_quit);
534          return;          return;
535      }      }
536      if (strcasecmp (completion->base_command, "topic") == 0)      if (ascii_strcasecmp (completion->base_command, "topic") == 0)
537      {      {
538          if (completion->base_command_arg == 1)          if (completion->base_command_arg == 1)
539          {          {
# Line 717  completion_command (t_completion *comple Line 717  completion_command (t_completion *comple
717      other_completion = 0;      other_completion = 0;
718      for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)      for (ptr_weelist = index_commands; ptr_weelist; ptr_weelist = ptr_weelist->next_weelist)
719      {      {
720          if (strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)          if (ascii_strncasecmp (ptr_weelist->data, completion->base_word + 1, length) == 0)
721          {          {
722              if ((!completion->word_found) || word_found_seen)              if ((!completion->word_found) || word_found_seen)
723              {              {
# Line 725  completion_command (t_completion *comple Line 725  completion_command (t_completion *comple
725                  for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;                  for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
726                       ptr_weelist2 = ptr_weelist2->next_weelist)                       ptr_weelist2 = ptr_weelist2->next_weelist)
727                  {                  {
728                      if (strncasecmp (ptr_weelist2->data,                      if (ascii_strncasecmp (ptr_weelist2->data,
729                          completion->base_word + 1, length) == 0)                          completion->base_word + 1, length) == 0)
730                          other_completion++;                          other_completion++;
731                  }                  }
# Line 739  completion_command (t_completion *comple Line 739  completion_command (t_completion *comple
739              other_completion++;              other_completion++;
740          }          }
741          if (completion->word_found &&          if (completion->word_found &&
742              (strcasecmp (ptr_weelist->data, completion->word_found) == 0))              (ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
743              word_found_seen = 1;              word_found_seen = 1;
744      }      }
745      if (completion->word_found)      if (completion->word_found)
# Line 765  completion_command_arg (t_completion *co Line 765  completion_command_arg (t_completion *co
765      for (ptr_weelist = completion->completion_list; ptr_weelist;      for (ptr_weelist = completion->completion_list; ptr_weelist;
766           ptr_weelist = ptr_weelist->next_weelist)           ptr_weelist = ptr_weelist->next_weelist)
767      {      {
768          if (strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)          if (ascii_strncasecmp (ptr_weelist->data, completion->base_word, length) == 0)
769          {          {
770              if ((!completion->word_found) || word_found_seen)              if ((!completion->word_found) || word_found_seen)
771              {              {
# Line 773  completion_command_arg (t_completion *co Line 773  completion_command_arg (t_completion *co
773                  for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;                  for (ptr_weelist2 = ptr_weelist->next_weelist; ptr_weelist2;
774                       ptr_weelist2 = ptr_weelist2->next_weelist)                       ptr_weelist2 = ptr_weelist2->next_weelist)
775                  {                  {
776                      if (strncasecmp (ptr_weelist2->data,                      if (ascii_strncasecmp (ptr_weelist2->data,
777                          completion->base_word, length) == 0)                          completion->base_word, length) == 0)
778                          other_completion++;                          other_completion++;
779                  }                  }
# Line 787  completion_command_arg (t_completion *co Line 787  completion_command_arg (t_completion *co
787              other_completion++;              other_completion++;
788          }          }
789          if (completion->word_found &&          if (completion->word_found &&
790              (strcasecmp (ptr_weelist->data, completion->word_found) == 0))              (ascii_strcasecmp (ptr_weelist->data, completion->word_found) == 0))
791              word_found_seen = 1;              word_found_seen = 1;
792      }      }
793      if (completion->word_found)      if (completion->word_found)
# Line 821  completion_nick (t_completion *completio Line 821  completion_nick (t_completion *completio
821      other_completion = 0;      other_completion = 0;
822      for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)      for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
823      {      {
824          if (strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)          if (ascii_strncasecmp (ptr_nick->nick, completion->base_word, length) == 0)
825          {          {
826              if ((!completion->word_found) || word_found_seen)              if ((!completion->word_found) || word_found_seen)
827              {              {
# Line 829  completion_nick (t_completion *completio Line 829  completion_nick (t_completion *completio
829                  for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;                  for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
830                       ptr_nick2 = ptr_nick2->next_nick)                       ptr_nick2 = ptr_nick2->next_nick)
831                  {                  {
832                      if (strncasecmp (ptr_nick2->nick,                      if (ascii_strncasecmp (ptr_nick2->nick,
833                          completion->base_word, length) == 0)                          completion->base_word, length) == 0)
834                          other_completion++;                          other_completion++;
835                  }                  }
# Line 843  completion_nick (t_completion *completio Line 843  completion_nick (t_completion *completio
843              other_completion++;              other_completion++;
844          }          }
845          if (completion->word_found &&          if (completion->word_found &&
846              (strcasecmp (ptr_nick->nick, completion->word_found) == 0))              (ascii_strcasecmp (ptr_nick->nick, completion->word_found) == 0))
847              word_found_seen = 1;              word_found_seen = 1;
848      }      }
849      if (completion->word_found)      if (completion->word_found)

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26