1 # Case sensitive identifiers
3 - Author:
[Sébastien Helleu](https://github.com/flashcode)
4 - License: CC BY-NC-SA
4.0
5 - Created on:
2022-
12-
21
6 - Last updated:
2023-
01-
27
7 - Issue:
[#1872](https://github.com/weechat/weechat/issues/1872): case sensitive identifiers
9 - Target WeeChat version:
3.9
13 Many identifiers are case insensitive in WeeChat and should not be.
17 Purpose of this specification is to make many identifiers case sensitive in
18 data objects managed by the user, API and internal functions.
20 Changes proposed in this specification will also fix the following issues:
22 - [#398](https://github.com/weechat/weechat/issues/398): autocomplete wrong case
23 - [#32213](https://savannah.nongnu.org/bugs/?32213): completion problems with uppercase letters
27 These identifiers must stay case insensitive:
29 - hook config (check if option is matching hook mask)
30 - hooks hsignal and signal (check if signal is matching hook signal masks)
31 - hook line (check if buffer is matching hook mask)
33 - hook print (check if prefix or message displayed is contained in hook message)
34 - buffer matching condition in filters
35 - system signal name ("kill", "term", "usr1", etc.)
37 - nicklist: groups and nicks
39 - weelist data (used to keep list sorted)
44 - relay: IRC commands relayed
45 - relay: IRC commands ignored
46 - filters on trigger monitor buffer
50 These identifiers are currently case insensitive and must become case sensitive:
52 - configuration (files, sections, options)
63 - completions (except nick completions)
64 - infolist variable name
65 - weelist position (beginning/end/sort)
68 - /secure buffer input (
`q` to close)
70 - /color buffer input (
`q` to close, etc.)
71 - custom bar item option ("conditions", "content")
75 - bar conditions ("active", "inactive", "nicklist")
77 - buffer types ("formatted", "free")
78 - buffer notify levels (none, highlight, etc.)
80 - user buffer input (
`q` to close)
81 - function gui_color_get_custom (parameter
`color_name`, example:
`bold`,
`reset`, etc.)
83 - hotlist priorities ("low", "message", "private", "highlight")
84 - key contexts ("default", "search", "cursor", "mouse")
85 - notify tags in line ("notify_none", "notify_message", etc.)
88 - IRC raw buffer input (
`q` to close)
90 - API function prefix (parameter
`prefix`, example:
`error`,
`network`, etc.)
92 - plugin name (eg:
`irc` vs
`Irc`)
93 - relay buffer input (
`q` to close, etc.)
94 - relay compression (off/zlib/zstd)
98 - trigger return codes
99 - trigger post actions
100 - xfer buffer input (
`q` to close, etc.)
102 - xfer protocols (none/dcc)
103 - functions to set object properties
105 ### String comparison functions
107 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:
109 Function | Replacement
110 ---------------------------- | ---------------------------------------
111 `string_charcasecmp` |
`string_charcmp`
112 `string_strcasecmp` |
`string_strcmp` or
`strcmp`
113 `string_strncasecmp` |
`string_strncmp`
114 `string_strcmp_ignore_chars` | Same function with
`case_sensitive` =
1
115 `string_strcasestr` |
`strstr`
116 `string_match` | Same function with
`case_sensitive` =
1
117 `string_match_list` | Same function with
`case_sensitive` =
1
119 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:
121 Function | Replacement
122 ----------------------------- | ---------------------------------------
123 `weechat_string_charcasecmp` |
`weechat_string_charcmp`
124 `weechat_strcasecmp` |
`weechat_strcmp` or
`strcmp`
125 `weechat_strncasecmp` |
`weechat_strncmp`
126 `weechat_strcmp_ignore_chars` | Same function with
`case_sensitive` =
1
127 `weechat_strcasestr` |
`strstr`
128 `weechat_string_match` | Same function with
`case_sensitive` =
1
129 `weechat_string_match_list` | Same function with
`case_sensitive` =
1
131 ### Configuration files, sections, options
133 Configuration files, sections and options are made case sensitive.
138 - config_file_config_find_pos
139 - config_file_section_find_pos
140 - config_file_search_section
141 - config_file_option_find_pos
142 - config_file_new_option
143 - config_file_search_option
144 - config_file_search_section_option
145 - config_file_string_boolean_is_valid
146 - config_file_string_to_boolean
147 - config_file_option_set
148 - config_file_read_internal
150 ### Commands, commands parameters, command_runs, aliases and completions
152 Commands, commands parameters, hook "command_run", aliases and completions (except nick) are made case sensitive.
156 - hook_command_search
158 - hook_command_run_exec
159 - hook_completion_exec
161 - hook_add_to_infolist_type
164 - gui_completion_word_compare_cb
165 - gui_completion_search_command
166 - gui_completion_list_add
167 - gui_completion_complete
170 - all command callbacks (core and plugins)
172 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`.
174 Regarding commands, a new alias
`/AWAY` could be defined to be away on all servers, like this:
177 /alias add AWAY /allserv /away
180 So that
`/away` and
`/AWAY` (the new alias) are two separate commands,
181 with separate completion: the completion of
`/aw` is
`/away` (only this one),
182 and the completion of
`/AW` is
`/AWAY` (only this one).
184 Nick completion remains case insensitive, that means if there are nicks "Nick"
185 and "Nick_away", typing "ni" with Tab will complete to partial completion "Nick"
186 and typing "_" and Tab again will complete to "Nick_away".
188 Partial completion is not converted to lower case any more, this fixes the issue
189 [#398](https://github.com/weechat/weechat/issues/398) and Savannah bug
190 [#32213](https://savannah.nongnu.org/bugs/?32213).
192 That means when partial completion is enabled (
`/set weechat.completion.partial_completion_other on`), the result is the following:
194 Nicks in channel | Input text | Old completion | New completion
195 -------------------------------- | ------------ | -------------- | --------------
196 `{Andrew}` and
`{Andrew}_Mobile` |
`{a` or
`{A` |
`{andrew}` |
`{Andrew}`
197 `NickName` and
`NickToto` |
`ni` or
`Ni` |
`nick` |
`Nick`
199 ### Info, info_hashtable, infolist
201 Name of "info", "info_hashtable" and "infolist" are made case sensitive.
206 - hook_info_get_hashtable
208 - infolist_search_var
215 ### Bars and bar items
217 Name of bar items and all these bar identifiers are made case sensitive:
228 - gui_bar_item_custom_search_option
229 - gui_bar_item_custom_search_with_option_name
230 - gui_bar_search_option
231 - gui_bar_search_type
232 - gui_bar_search_position
233 - gui_bar_check_conditions
235 - gui_bar_search_with_option_name
236 - gui_bar_default_items
241 Plugin names are made case sensitive.
245 - command_plugin_list
246 - gui_layout_buffer_get_number
248 - plugin_check_extension_allowed (option
`weechat.plugin.extension`)
249 - plugin_check_autoload (option
`weechat.plugin.extension`)
252 ### Functions to get/set properties
254 The functions used to set object properties are updated to be case sensitive for the property to set (parameter
`property`):
256 - config_file_option_get_string
257 - config_file_option_get_pointer
258 - hashtable_get_integer
259 - hashtable_get_string
260 - hashtable_set_pointer
265 - gui_buffer_get_integer
266 - gui_buffer_get_string
267 - gui_buffer_get_pointer
269 - gui_buffer_set_pointer
270 - gui_completion_get_string
271 - gui_nicklist_group_get_integer
272 - gui_nicklist_group_get_string
273 - gui_nicklist_group_get_pointer
274 - gui_nicklist_group_set
275 - gui_nicklist_nick_get_integer
276 - gui_nicklist_nick_get_string
277 - gui_nicklist_nick_get_pointer
278 - gui_nicklist_nick_set
279 - gui_window_get_integer
280 - gui_window_get_pointer
282 ### Curl constants and options
284 Curl constants and options are made case sensitive.
288 - weeurl_search_constant
289 - weeurl_search_option
293 Hashtable types are made case sensitive.
301 Weelist positions are made case sensitive.
309 Proxy options and types are made case sensitive.
311 Proxy names are made case sensitive in read of infolist "proxy".
315 - proxy_search_option
317 - plugin_api_infolist_proxy_cb
321 Buffer types and notify levels are made case sensitive.
323 API function
`buffer_match_list` is made case sensitive.
325 Buffer names are made case sensitive in read of infolist "buffer".
329 - gui_buffer_search_type
330 - gui_buffer_search_notify
331 - gui_buffer_match_list
332 - plugin_api_infolist_buffer_cb
334 ### Input actions in buffers
336 Input actions (like "q" to close buffer) are made case sensitive.
340 - secure_buffer_input_cb
341 - gui_color_buffer_input_cb
342 - gui_buffer_user_input_cb
344 - relay_buffer_input_cb
345 - xfer_buffer_input_cb
349 Color names (like
`blue`,
`red`, etc.) and color attributes (
`bold`,
`underline`, etc.) are made case sensitive.
354 - gui_color_get_custom
358 Filter names are made case sensitive.
362 - gui_filter_find_pos
364 ### Hotlist priorities
366 Hotlist priorities ("low", "message", "private", "highlight") are made case sensitive.
370 - gui_hotlist_search_priority
374 Key contexts ("default", "search", "cursor", "mouse") are made case sensitive.
378 - gui_key_search_context
380 ### Notify tags in line
382 Notify tags in line ("notify_none", "notify_message", etc.) are made case sensitive.
386 - gui_line_set_notify_level
390 IRC server names are made case sensitive.
394 - irc_command_exec_all_servers
397 - irc_ignore_check_server
398 - irc_info_infolist_irc_server_cb
399 - irc_info_infolist_irc_notify_cb
400 - irc_server_casesearch (function removed)
404 Filters on IRC raw buffer (except command name with
`m:xxx`) are made case sensitive
408 - irc_raw_message_match_filter
410 ### API function "prefix"
412 The prefix parameter in "prefix" API function is made case sensitive.
420 Script names are made case sensitive.
424 - plugin_script_search
425 - plugin_script_find_pos
429 Trigger names, options, types, return codes and post actions are made case sensitive.
433 - trigger_command_trigger
434 - trigger_search_option
435 - trigger_search_hook_type
436 - trigger_search_return_code
437 - trigger_search_post_action
442 Xfer types and protocols are made case sensitive.
447 - xfer_search_protocol
451 The changes must be implemented in this order:
453 1. Make case sensitive:
454 - configuration files, sections, options
456 2. Convert default aliases to lower case
457 3. Make case sensitive:
458 - commands, commands parameters, hook "command_run", aliases and completions (except nick)
459 - info, info_hashtable, infolist
462 - functions to get/set properties
463 - Curl constants and options
466 - proxy options and types, proxy name in infolist "proxy"
467 - buffer types and notify levels, API function buffer_match_list, buffer name in infolist "buffer"
468 - input actions in buffers
469 - color names and attributes
472 - notify tags in line
475 - API function "prefix"
477 - trigger names, options, types, return codes and post actions
478 - xfer types and protocols
482 - Source of this specification:
[https://github.com/weechat/specs.weechat.org/blob/main/specs/2023-001-case-sensitive-identifiers.md](https://github.com/weechat/specs.weechat.org/blob/main/specs/2023-001-case-sensitive-identifiers.md)