Many identifiers are case insensitive in WeeChat and should not be.
Purpose of this specification is to make many identifiers case sensitive in data objects managed by the user, API and internal functions.
Changes proposed in this specification will also fix the following issues:
These identifiers must stay case insensitive:
These identifiers are currently case insensitive and must become case sensitive:
q
to close)q
to close, etc.)q
to close)color_name
, example: bold
, reset
, etc.)q
to close)prefix
, example: error
, network
, etc.)irc
vs Irc
)q
to close, etc.)q
to close, etc.)When a comparison needs to be case sensitive instead of case insensitive, the call to the function must be replaced with another, in WeeChat core:
Function | Replacement |
---|---|
string_charcasecmp |
string_charcmp |
string_strcasecmp |
string_strcmp or strcmp |
string_strncasecmp |
string_strncmp |
string_strcmp_ignore_chars |
Same function with case_sensitive = 1 |
string_strcasestr |
strstr |
string_match |
Same function with case_sensitive = 1 |
string_match_list |
Same function with case_sensitive = 1 |
When a comparison needs to be case sensitive instead of case insensitive, the call to the function must be replaced with another, in WeeChat plugins:
Function | Replacement |
---|---|
weechat_string_charcasecmp |
weechat_string_charcmp |
weechat_strcasecmp |
weechat_strcmp or strcmp |
weechat_strncasecmp |
weechat_strncmp |
weechat_strcmp_ignore_chars |
Same function with case_sensitive = 1 |
weechat_strcasestr |
strstr |
weechat_string_match |
Same function with case_sensitive = 1 |
weechat_string_match_list |
Same function with case_sensitive = 1 |
Configuration files, sections and options are made case sensitive.
Functions to update:
Commands, commands parameters, hook “command_run”, aliases and completions (except nick) are made case sensitive.
Functions to update:
That means for example /test -o
and /test -O
(upper case parameter) would have different meaning, -o
and -O
being two different options for the command /test
.
Regarding commands, a new alias /AWAY
could be defined to be away on all servers, like this:
/alias add AWAY /allserv /away
So that /away
and /AWAY
(the new alias) are two separate commands,
with separate completion: the completion of /aw
is /away
(only this one),
and the completion of /AW
is /AWAY
(only this one).
Default aliases are now in lower case by default.
WeeChat automatically converts all aliases from upper to lower case on upgrade, the following messages are displayed:
Alias converted to lower case: "AAWAY" => "aaway"
Alias converted to lower case: "ANICK" => "anick"
Alias converted to lower case: "BEEP" => "beep"
Alias converted to lower case: "BYE" => "bye"
Alias converted to lower case: "C" => "c"
Alias converted to lower case: "CHAT" => "chat"
Alias converted to lower case: "CL" => "cl"
Alias converted to lower case: "CLOSE" => "close"
Alias converted to lower case: "EXIT" => "exit"
Alias converted to lower case: "IG" => "ig"
Alias converted to lower case: "J" => "j"
Alias converted to lower case: "K" => "k"
Alias converted to lower case: "KB" => "kb"
Alias converted to lower case: "LEAVE" => "leave"
Alias converted to lower case: "M" => "m"
Alias converted to lower case: "MSGBUF" => "msgbuf"
Alias converted to lower case: "MUB" => "mub"
Alias converted to lower case: "N" => "n"
Alias converted to lower case: "Q" => "q"
Alias converted to lower case: "REDRAW" => "redraw"
Alias converted to lower case: "SAY" => "say"
Alias converted to lower case: "SIGNOFF" => "signoff"
Alias converted to lower case: "T" => "t"
Alias converted to lower case: "UB" => "ub"
Alias converted to lower case: "UMODE" => "umode"
Alias converted to lower case: "V" => "v"
Alias converted to lower case: "W" => "w"
Alias converted to lower case: "WC" => "wc"
Alias converted to lower case: "WI" => "wi"
Alias converted to lower case: "WII" => "wii"
Alias converted to lower case: "WM" => "wm"
Alias converted to lower case: "WW" => "ww"
Nick completion remains case insensitive, that means if there are nicks “Nick” and “Nick_away”, typing “ni” with Tab will complete to partial completion “Nick” and typing “_” and Tab again will complete to “Nick_away”.
Partial completion is not converted to lower case any more, this fixes the issue #398 and Savannah bug #32213.
That means when partial completion is enabled (/set weechat.completion.partial_completion_other on
), the result is the following:
Nicks in channel | Input text | Old completion | New completion |
---|---|---|---|
{Andrew} and {Andrew}_Mobile |
{a or {A |
{andrew} |
{Andrew} |
NickName and NickToto |
ni or Ni |
nick |
Nick |
Name of “info”, “info_hashtable” and “infolist” are made case sensitive.
Functions to update:
Name of bar items and all these bar identifiers are made case sensitive:
Functions to update:
Plugin names are made case sensitive.
Functions to update:
weechat.plugin.extension
)weechat.plugin.extension
)The functions used to set object properties are updated to be case sensitive for the property to set (parameter property
):
Hashtable types are made case sensitive.
Functions to update:
Weelist positions are made case sensitive.
Functions to update:
Proxy options and types are made case sensitive.
Proxy names are made case sensitive in read of infolist “proxy”.
Functions to update:
Buffer types and notify levels are made case sensitive.
API function buffer_match_list
is made case sensitive.
Buffer names are made case sensitive in read of infolist “buffer”.
Functions to update:
Input actions (like “q” to close buffer) are made case sensitive.
Functions to update:
Color names (like blue
, red
, etc.) and color attributes (bold
, underline
, etc.) are made case sensitive.
Functions to update:
Filter names are made case sensitive.
Functions to update:
Hotlist priorities (“low”, “message”, “private”, “highlight”) are made case sensitive.
Functions to update:
Key contexts (“default”, “search”, “cursor”, “mouse”) are made case sensitive.
Functions to update:
Notify tags in line (“notify_none”, “notify_message”, etc.) are made case sensitive.
Functions to update:
IRC server names are made case sensitive.
Functions to update:
Filters on IRC raw buffer (except command name with m:xxx
) are made case sensitive
Functions to update:
The prefix parameter in “prefix” API function is made case sensitive.
Functions to update:
Script names are made case sensitive.
Functions to update:
Trigger names, options, types, return codes and post actions are made case sensitive.
Functions to update:
Xfer types and protocols are made case sensitive.
Functions to update:
The changes must be implemented in this order: