Skip to content

Commit

Permalink
buflist: format and translate command line by line (issue #2005)
Browse files Browse the repository at this point in the history
  • Loading branch information
flashcode committed Oct 17, 2023
1 parent 05b160b commit cfa5f33
Showing 1 changed file with 86 additions and 85 deletions.
171 changes: 86 additions & 85 deletions src/plugins/buflist/buflist-command.c
Expand Up @@ -107,91 +107,92 @@ buflist_command_init ()
"enable|disable|toggle"
" || bar"
" || refresh [<item>[,<item>...]]",
N_(" enable: enable buflist\n"
"disable: disable buflist\n"
" toggle: toggle buflist\n"
" bar: add the \"buflist\" bar\n"
"refresh: force the refresh of some bar items (if no item is given, "
"all bar items used are refreshed, according to option "
"buflist.look.use_items)\n"
"\n"
"The lines with buffers are displayed using string evaluation "
"(see /help eval for the format), with these options:\n"
" - buflist.look.display_conditions: conditions to display a "
"buffer in the list\n"
" - buflist.format.buffer: format for a buffer which is not "
"current buffer\n"
" - buflist.format.buffer_current: format for the current buffer\n"
"\n"
"The following variables can be used in these options:\n"
" - bar item data (see hdata \"bar_item\" in API doc for a "
"complete list), for example:\n"
" - ${bar_item.name}\n"
" - window data, where the bar item is displayed (there's no "
"window in root bars, see hdata \"window\" in API doc for a "
"complete list), for example:\n"
" - ${window.number}\n"
" - ${window.buffer.full_name}\n"
" - buffer data (see hdata \"buffer\" in API doc for a complete "
"list), for example:\n"
" - ${buffer.number}\n"
" - ${buffer.name}\n"
" - ${buffer.full_name}\n"
" - ${buffer.short_name}\n"
" - ${buffer.nicklist_nicks_count}\n"
" - irc_server: IRC server data, defined only on an IRC buffer "
"(see hdata \"irc_server\" in API doc)\n"
" - irc_channel: IRC channel data, defined only on an IRC channel "
"buffer (see hdata \"irc_channel\" in API doc)\n"
" - extra variables added by buflist for convenience:\n"
" - ${format_buffer}: the evaluated value of option "
"buflist.format.buffer; this can be used in option "
"buflist.format.buffer_current to just change the background color "
"for example\n"
" - ${current_buffer}: a boolean (\"0\" or \"1\"), \"1\" if "
"this is the current buffer; it can be used in a condition: "
"${if:${current_buffer}?...:...}\n"
" - ${merged}: a boolean (\"0\" or \"1\"), \"1\" if the "
"buffer is merged with at least another buffer; it can be used "
"in a condition: ${if:${merged}?...:...}\n"
" - ${format_number}: indented number with separator "
"(evaluation of option buflist.format.number)\n"
" - ${number}: indented number, for example \" 1\" if there "
"are between 10 and 99 buffers; for merged buffers, this variable "
"is set with number for the first buffer and spaces for the next "
"buffers with same number\n"
" - ${number2}: indented number, for example \" 1\" if there "
"are between 10 and 99 buffers\n"
" - ${number_displayed}: \"1\" if the number is displayed, "
"otherwise \"0\"\n"
" - ${indent}: indentation for name (channel, private and list "
"buffers are indented) (evaluation of "
"option buflist.format.indent)\n"
" - ${format_nick_prefix}: colored nick prefix for a channel "
"(evaluation of option buflist.format.nick_prefix)\n"
" - ${color_nick_prefix}: color of nick prefix for a channel "
"(set only if the option buflist.look.nick_prefix is enabled)\n"
" - ${nick_prefix}: nick prefix for a channel "
"(set only if the option buflist.look.nick_prefix is enabled)\n"
" - ${format_name}: formatted name (evaluation of option "
"buflist.format.name)\n"
" - ${name}: the short name (if set), with a fallback on the "
"name\n"
" - ${color_hotlist}: the color depending on the highest "
"hotlist level for the buffer (evaluation of option "
"buflist.format.hotlist_xxx where xxx is the level)\n"
" - ${format_hotlist}: the formatted hotlist (evaluation "
"of option buflist.format.hotlist)\n"
" - ${hotlist}: the raw hotlist\n"
" - ${hotlist_priority}: \"none\", \"low\", \"message\", "
"\"private\" or \"highlight\"\n"
" - ${hotlist_priority_number}: -1 = none, 0 = low, 1 = message, "
"2 = private, 3 = highlight\n"
" - ${format_lag}: the lag for an IRC server buffer, empty if "
"there's no lag (evaluation of option buflist.format.lag)\n"
" - ${format_tls_version}: indicator of TLS version for a server "
"buffer, empty for channels (evaluation of option "
"buflist.format.tls_version)"),
WEECHAT_CMD_ARGS_DESC(
N_("raw[enable]: enable buflist"),
N_("raw[disable]: disable buflist"),
N_("raw[toggle]: toggle buflist"),
N_("raw[bar]: add the \"buflist\" bar"),
N_("raw[refresh]: force the refresh of some bar items (if no item "
"is given, all bar items used are refreshed, according to option "
"buflist.look.use_items)"),
"",
N_("The lines with buffers are displayed using string evaluation "
"(see /help eval for the format), with these options:"),
N_(" - buflist.look.display_conditions: conditions to display a "
"buffer in the list"),
N_(" - buflist.format.buffer: format for a buffer which is not "
"current buffer"),
N_(" - buflist.format.buffer_current: format for the current buffer"),
"",
N_("The following variables can be used in these options:"),
N_(" - bar item data (see hdata \"bar_item\" in API doc for a "
"complete list), for example:"),
AI(" - ${bar_item.name}"),
N_(" - window data, where the bar item is displayed (there's no "
"window in root bars, see hdata \"window\" in API doc for a "
"complete list), for example:"),
AI(" - ${window.number}"),
AI(" - ${window.buffer.full_name}"),
N_(" - buffer data (see hdata \"buffer\" in API doc for a complete "
"list), for example:"),
AI(" - ${buffer.number}"),
AI(" - ${buffer.name}"),
AI(" - ${buffer.full_name}"),
AI(" - ${buffer.short_name}"),
AI(" - ${buffer.nicklist_nicks_count}"),
N_(" - irc_server: IRC server data, defined only on an IRC buffer "
"(see hdata \"irc_server\" in API doc)"),
N_(" - irc_channel: IRC channel data, defined only on an IRC channel "
"buffer (see hdata \"irc_channel\" in API doc)"),
N_(" - extra variables added by buflist for convenience:"),
N_(" - ${format_buffer}: the evaluated value of option "
"buflist.format.buffer; this can be used in option "
"buflist.format.buffer_current to just change the background color "
"for example"),
N_(" - ${current_buffer}: a boolean (\"0\" or \"1\"), \"1\" if "
"this is the current buffer; it can be used in a condition: "
"${if:${current_buffer}?...:...}"),
N_(" - ${merged}: a boolean (\"0\" or \"1\"), \"1\" if the "
"buffer is merged with at least another buffer; it can be used "
"in a condition: ${if:${merged}?...:...}"),
N_(" - ${format_number}: indented number with separator "
"(evaluation of option buflist.format.number)"),
N_(" - ${number}: indented number, for example \" 1\" if there "
"are between 10 and 99 buffers; for merged buffers, this variable "
"is set with number for the first buffer and spaces for the next "
"buffers with same number"),
N_(" - ${number2}: indented number, for example \" 1\" if there "
"are between 10 and 99 buffers"),
N_(" - ${number_displayed}: \"1\" if the number is displayed, "
"otherwise \"0\""),
N_(" - ${indent}: indentation for name (channel, private and list "
"buffers are indented) (evaluation of "
"option buflist.format.indent)"),
N_(" - ${format_nick_prefix}: colored nick prefix for a channel "
"(evaluation of option buflist.format.nick_prefix)"),
N_(" - ${color_nick_prefix}: color of nick prefix for a channel "
"(set only if the option buflist.look.nick_prefix is enabled)"),
N_(" - ${nick_prefix}: nick prefix for a channel "
"(set only if the option buflist.look.nick_prefix is enabled)"),
N_(" - ${format_name}: formatted name (evaluation of option "
"buflist.format.name)"),
N_(" - ${name}: the short name (if set), with a fallback on the "
"name"),
N_(" - ${color_hotlist}: the color depending on the highest "
"hotlist level for the buffer (evaluation of option "
"buflist.format.hotlist_xxx where xxx is the level)"),
N_(" - ${format_hotlist}: the formatted hotlist (evaluation "
"of option buflist.format.hotlist)"),
N_(" - ${hotlist}: the raw hotlist"),
N_(" - ${hotlist_priority}: \"none\", \"low\", \"message\", "
"\"private\" or \"highlight\""),
N_(" - ${hotlist_priority_number}: -1 = none, 0 = low, 1 = message, "
"2 = private, 3 = highlight"),
N_(" - ${format_lag}: the lag for an IRC server buffer, empty if "
"there's no lag (evaluation of option buflist.format.lag)"),
N_(" - ${format_tls_version}: indicator of TLS version for a server "
"buffer, empty for channels (evaluation of option "
"buflist.format.tls_version)")),
"enable|disable|toggle"
" || bar"
" || refresh %(buflist_items_used)|%*",
Expand Down

0 comments on commit cfa5f33

Please sign in to comment.