Skip to content

Commit

Permalink
core: add support of quotes in commands /key bind and /key bindctxt
Browse files Browse the repository at this point in the history
  • Loading branch information
flashcode committed Aug 27, 2023
1 parent 3ca4f2d commit 181f4c0
Show file tree
Hide file tree
Showing 16 changed files with 204 additions and 35 deletions.
1 change: 1 addition & 0 deletions ChangeLog.adoc
Expand Up @@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele

New features::

* core: add support of quotes in commands `/key bind` and `/key bindctxt`
* core: evaluate command given to `/repeat` with contextual variables (issue #2007)
* core: add option `callbacks` in command `/debug`
* core: add option type "enum" (issue #1973)
Expand Down
5 changes: 3 additions & 2 deletions po/cs.po
Expand Up @@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-26 21:34+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -2060,7 +2060,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
74 changes: 72 additions & 2 deletions po/de.po
Expand Up @@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-08-27 00:11+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
Expand Down Expand Up @@ -2562,6 +2562,75 @@ msgstr ""
"unbindctxt <context> <key> || reset <key> || resetctxt <context> <key> || "
"resetall -yes [<context>] || missing [<context>] || legacy <key> [<key>...]"

#, fuzzy
#| msgid ""
#| " list: list all current keys\n"
#| "listdefault: list default keys\n"
#| " listdiff: list differences between current and default keys (keys "
#| "added, redefined or deleted)\n"
#| " context: name of context (\"default\" or \"search\")\n"
#| " bind: bind a command to a key or display command bound to key (for "
#| "context \"default\")\n"
#| " bindctxt: bind a command to a key or display command bound to key, for "
#| "given context\n"
#| " command: command (many commands can be separated by semicolons)\n"
#| " unbind: remove a key binding (for context \"default\")\n"
#| " unbindctxt: remove a key binding for given context\n"
#| " reset: reset a key to default binding (for context \"default\")\n"
#| " resetctxt: reset a key to default binding, for given context\n"
#| " resetall: restore bindings to the default values and delete ALL "
#| "personal bindings (use carefully!)\n"
#| " missing: add missing keys (using default bindings), useful after "
#| "installing new WeeChat version\n"
#| " legacy: display new name for legacy keys\n"
#| "\n"
#| "When binding a command to a key, it is recommended to use key alt+k (or "
#| "Esc then k), and then press the key to bind: this will insert key name in "
#| "command line.\n"
#| "\n"
#| "For some keys you might need to use /debug key, this displays the raw key "
#| "code that can be used (for example the key ctrl+backspace could be \"ctrl-"
#| "h\" or \"ctrl-?\", depending on your terminal and other settings).\n"
#| "\n"
#| "Modifiers allowed (in this order when multiple are used):\n"
#| " meta- (alt key)\n"
#| " ctrl- (control key)\n"
#| " shift- (shift key, can only be used with key names below)\n"
#| "\n"
#| "Key names allowed: f0 to f20, home, insert, delete, end, backspace, pgup, "
#| "pgdn, up, down, right, left, tab, return, comma, space.\n"
#| "\n"
#| "Combo of keys must be separated by a comma.\n"
#| "\n"
#| "For context \"mouse\" (possible in context \"cursor\" too), key has "
#| "format: \"@area:key\" or \"@area1>area2:key\" where area can be:\n"
#| " *: any area on screen\n"
#| " chat: chat area (any buffer)\n"
#| " chat(xxx): chat area for buffer with name \"xxx\" (full name including "
#| "plugin)\n"
#| " bar(*): any bar\n"
#| " bar(xxx): bar \"xxx\"\n"
#| " item(*): any bar item\n"
#| " item(xxx): bar item \"xxx\"\n"
#| "Wildcard \"*\" is allowed in key to match many mouse events.\n"
#| "A special value for command with format \"hsignal:name\" can be used for "
#| "context mouse, this will send the hsignal \"name\" with the focus "
#| "hashtable as argument.\n"
#| "Another special value \"-\" can be used to disable key (it will be "
#| "ignored when looking for keys).\n"
#| "\n"
#| "Examples:\n"
#| " key alt-r to jump to #weechat IRC channel:\n"
#| " /key bind meta-r /buffer #weechat\n"
#| " restore default binding for key alt-r:\n"
#| " /key reset meta-r\n"
#| " key meta-v then f1 to run /help:\n"
#| " /key bind meta-v,f1 /help\n"
#| " key \"tab\" to stop search in buffer:\n"
#| " /key bindctxt search tab /input search_stop\n"
#| " middle button of mouse on a nick to retrieve info on nick:\n"
#| " /key bindctxt mouse @item(buffer_nicklist):button3 /msg nickserv info "
#| "${nick}"
msgid ""
" list: list all current keys\n"
"listdefault: list default keys\n"
Expand All @@ -2572,7 +2641,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/es.po
Expand Up @@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-26 21:34+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -2560,7 +2560,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
10 changes: 6 additions & 4 deletions po/fr.po
Expand Up @@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"PO-Revision-Date: 2023-08-27 11:28+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-08-27 14:12+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
Expand Down Expand Up @@ -2523,7 +2523,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down Expand Up @@ -2593,7 +2594,8 @@ msgstr ""
" bindctxt : associer une commande à une touche ou affiche la commande "
"associée à la touche pour le contexte donné\n"
" commande : commande (plusieurs commandes peuvent être séparées par des "
"points-virgules)\n"
"points-virgules) ; des guillemets peuvent être utilisés pour préserver les "
"espaces au début et à la fin de la commande\n"
" unbind : supprimer l'association à une touche\n"
" unbindctxt : supprimer l'association à une touche pour le contexte donné\n"
" reset : réinitialiser une touche à son association par défaut\n"
Expand Down
5 changes: 3 additions & 2 deletions po/hu.po
Expand Up @@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -1883,7 +1883,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/it.po
Expand Up @@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-26 21:34+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -2147,7 +2147,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/ja.po
Expand Up @@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-08-08 07:13+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
Expand Down Expand Up @@ -2529,7 +2529,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/pl.po
Expand Up @@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-08-08 07:13+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
Expand Down Expand Up @@ -2990,7 +2990,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/pt.po
Expand Up @@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-26 21:34+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
Expand Down Expand Up @@ -2521,7 +2521,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/pt_BR.po
Expand Up @@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-26 21:34+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -2224,7 +2224,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
5 changes: 3 additions & 2 deletions po/ru.po
Expand Up @@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-06-17 11:47+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -1906,7 +1906,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down
74 changes: 72 additions & 2 deletions po/sr.po
Expand Up @@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-08-27 11:25+0200\n"
"POT-Creation-Date: 2023-08-27 14:12+0200\n"
"PO-Revision-Date: 2023-08-08 07:14+0200\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
Expand Down Expand Up @@ -2593,6 +2593,75 @@ msgstr ""
"<контекст> <тастер> || resetall -yes [<контекст>] || missing [<контекст>] || "
"legacy <тастер> [<тастер>...]"

#, fuzzy
#| msgid ""
#| " list: list all current keys\n"
#| "listdefault: list default keys\n"
#| " listdiff: list differences between current and default keys (keys "
#| "added, redefined or deleted)\n"
#| " context: name of context (\"default\" or \"search\")\n"
#| " bind: bind a command to a key or display command bound to key (for "
#| "context \"default\")\n"
#| " bindctxt: bind a command to a key or display command bound to key, for "
#| "given context\n"
#| " command: command (many commands can be separated by semicolons)\n"
#| " unbind: remove a key binding (for context \"default\")\n"
#| " unbindctxt: remove a key binding for given context\n"
#| " reset: reset a key to default binding (for context \"default\")\n"
#| " resetctxt: reset a key to default binding, for given context\n"
#| " resetall: restore bindings to the default values and delete ALL "
#| "personal bindings (use carefully!)\n"
#| " missing: add missing keys (using default bindings), useful after "
#| "installing new WeeChat version\n"
#| " legacy: display new name for legacy keys\n"
#| "\n"
#| "When binding a command to a key, it is recommended to use key alt+k (or "
#| "Esc then k), and then press the key to bind: this will insert key name in "
#| "command line.\n"
#| "\n"
#| "For some keys you might need to use /debug key, this displays the raw key "
#| "code that can be used (for example the key ctrl+backspace could be \"ctrl-"
#| "h\" or \"ctrl-?\", depending on your terminal and other settings).\n"
#| "\n"
#| "Modifiers allowed (in this order when multiple are used):\n"
#| " meta- (alt key)\n"
#| " ctrl- (control key)\n"
#| " shift- (shift key, can only be used with key names below)\n"
#| "\n"
#| "Key names allowed: f0 to f20, home, insert, delete, end, backspace, pgup, "
#| "pgdn, up, down, right, left, tab, return, comma, space.\n"
#| "\n"
#| "Combo of keys must be separated by a comma.\n"
#| "\n"
#| "For context \"mouse\" (possible in context \"cursor\" too), key has "
#| "format: \"@area:key\" or \"@area1>area2:key\" where area can be:\n"
#| " *: any area on screen\n"
#| " chat: chat area (any buffer)\n"
#| " chat(xxx): chat area for buffer with name \"xxx\" (full name including "
#| "plugin)\n"
#| " bar(*): any bar\n"
#| " bar(xxx): bar \"xxx\"\n"
#| " item(*): any bar item\n"
#| " item(xxx): bar item \"xxx\"\n"
#| "Wildcard \"*\" is allowed in key to match many mouse events.\n"
#| "A special value for command with format \"hsignal:name\" can be used for "
#| "context mouse, this will send the hsignal \"name\" with the focus "
#| "hashtable as argument.\n"
#| "Another special value \"-\" can be used to disable key (it will be "
#| "ignored when looking for keys).\n"
#| "\n"
#| "Examples:\n"
#| " key alt-r to jump to #weechat IRC channel:\n"
#| " /key bind meta-r /buffer #weechat\n"
#| " restore default binding for key alt-r:\n"
#| " /key reset meta-r\n"
#| " key meta-v then f1 to run /help:\n"
#| " /key bind meta-v,f1 /help\n"
#| " key \"tab\" to stop search in buffer:\n"
#| " /key bindctxt search tab /input search_stop\n"
#| " middle button of mouse on a nick to retrieve info on nick:\n"
#| " /key bindctxt mouse @item(buffer_nicklist):button3 /msg nickserv info "
#| "${nick}"
msgid ""
" list: list all current keys\n"
"listdefault: list default keys\n"
Expand All @@ -2603,7 +2672,8 @@ msgid ""
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" command: command (many commands can be separated by semicolons)\n"
" command: command (many commands can be separated by semicolons); quotes "
"can be used to preserve spaces at the beginning/end of command\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
Expand Down

0 comments on commit 181f4c0

Please sign in to comment.