From 98316be40db4317795e75413d2d58ed12fa4978f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 14 Oct 2002 18:24:22 +0000 Subject: [PATCH] $k - first character in CMDCHARS git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2955 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- docs/special_vars.txt | 1 + src/core/expandos.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/special_vars.txt b/docs/special_vars.txt index c56c452f..7b6640ef 100644 --- a/docs/special_vars.txt +++ b/docs/special_vars.txt @@ -62,6 +62,7 @@ $A .. $Z is important. $I channel you were last INVITEd to $J client version text string $K current value of CMDCHARS + $k first character in CMDCHARS $L current contents of the input line $M modes of current channel, if any $N current nickname diff --git a/src/core/expandos.c b/src/core/expandos.c index 7267c214..7f3a9420 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -318,6 +318,17 @@ static char *expando_cmdchars(SERVER_REC *server, void *item, int *free_ret) return (char *) settings_get_str("cmdchars"); } +/* first CMDCHAR */ +static char *expando_cmdchar(SERVER_REC *server, void *item, int *free_ret) +{ + char str[2] = { 0, 0 }; + + str[0] = *settings_get_str("cmdchar"); + + *free_ret = TRUE; + return g_strdup(str); +} + /* modes of current channel, if any */ static char *expando_chanmode(SERVER_REC *server, void *item, int *free_ret) { @@ -585,6 +596,8 @@ void expandos_init(void) "", EXPANDO_NEVER, NULL); expando_create("K", expando_cmdchars, "setup changed", EXPANDO_ARG_NONE, NULL); + expando_create("k", expando_cmdchar, + "setup changed", EXPANDO_ARG_NONE, NULL); expando_create("M", expando_chanmode, "window changed", EXPANDO_ARG_NONE, "window item changed", EXPANDO_ARG_WINDOW,