WeeChat specifications

Case sensitive identifiers

Context

Many identifiers are case insensitive in WeeChat and should not be.

Goals

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:

Out of scope

These identifiers must stay case insensitive:

Changes

These identifiers are currently case insensitive and must become case sensitive:

String comparison functions

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, options

Configuration files, sections and options are made case sensitive.

Functions to update:

Commands, commands parameters, command_runs, aliases and completions

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).

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

Info, info_hashtable, infolist

Name of “info”, “info_hashtable” and “infolist” are made case sensitive.

Functions to update:

Bars and bar items

Name of bar items and all these bar identifiers are made case sensitive:

Functions to update:

Plugins

Plugin names are made case sensitive.

Functions to update:

Functions to get/set properties

The functions used to set object properties are updated to be case sensitive for the property to set (parameter property):

Curl constants and options

Curl constants and options are made case sensitive.

Functions to update:

Hashtables

Hashtable types are made case sensitive.

Functions to update:

Weelist

Weelist positions are made case sensitive.

Functions to update:

Proxies

Proxy options and types are made case sensitive.

Proxy names are made case sensitive in read of infolist “proxy”.

Functions to update:

Buffers

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 in buffers

Input actions (like “q” to close buffer) are made case sensitive.

Functions to update:

Colors

Color names (like blue, red, etc.) and color attributes (bold, underline, etc.) are made case sensitive.

Functions to update:

Filters

Filter names are made case sensitive.

Functions to update:

Hotlist priorities

Hotlist priorities (“low”, “message”, “private”, “highlight”) are made case sensitive.

Functions to update:

Key contexts

Key contexts (“default”, “search”, “cursor”, “mouse”) are made case sensitive.

Functions to update:

Notify tags in line

Notify tags in line (“notify_none”, “notify_message”, etc.) are made case sensitive.

Functions to update:

IRC servers

IRC server names are made case sensitive.

Functions to update:

IRC raw filters

Filters on IRC raw buffer (except command name with m:xxx) are made case sensitive

Functions to update:

API function “prefix”

The prefix parameter in “prefix” API function is made case sensitive.

Functions to update:

Scripts

Script names are made case sensitive.

Functions to update:

Triggers

Trigger names, options, types, return codes and post actions are made case sensitive.

Functions to update:

Xfer

Xfer types and protocols are made case sensitive.

Functions to update:

Planning

The changes must be implemented in this order:

  1. Make case sensitive:
    • configuration files, sections, options
    • aliases
  2. Convert default aliases to lower case
  3. Make case sensitive:
    • commands, commands parameters, hook “command_run”, aliases and completions (except nick)
    • info, info_hashtable, infolist
    • bars, bar items
    • plugins
    • functions to get/set properties
    • Curl constants and options
    • hashtable types
    • weelist position
    • proxy options and types, proxy name in infolist “proxy”
    • buffer types and notify levels, API function buffer_match_list, buffer name in infolist “buffer”
    • input actions in buffers
    • color names and attributes
    • filter names
    • hotlist priorities
    • notify tags in line
    • IRC server names
    • IRC raw filters
    • API function “prefix”
    • script names
    • trigger names, options, types, return codes and post actions
    • xfer types and protocols

References