From 32c93b5c0a3abd2525677e0e2615abde8460d693 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 2 Nov 2012 09:37:15 +0100 Subject: [PATCH] core: add command /eval, use expression in conditions for bars, add function "string_eval_expression" in plugin API --- ChangeLog | 4 +- NEWS | 6 +- doc/de/autogen/plugin_api/hdata.txt | 2 - doc/de/autogen/user/weechat_commands.txt | 123 ++-- doc/de/weechat_user.de.txt | 213 +++++++ doc/en/autogen/plugin_api/hdata.txt | 2 - doc/en/autogen/user/weechat_commands.txt | 61 +- doc/en/weechat_dev.en.txt | 1 + doc/en/weechat_plugin_api.en.txt | 53 ++ doc/en/weechat_user.en.txt | 212 +++++++ doc/fr/autogen/plugin_api/hdata.txt | 2 - doc/fr/autogen/user/weechat_commands.txt | 59 +- doc/fr/weechat_plugin_api.fr.txt | 55 ++ doc/fr/weechat_user.fr.txt | 223 +++++++ doc/it/autogen/plugin_api/hdata.txt | 2 - doc/it/autogen/user/weechat_commands.txt | 133 +++-- doc/it/weechat_plugin_api.it.txt | 56 ++ doc/it/weechat_user.it.txt | 213 +++++++ doc/ja/autogen/plugin_api/hdata.txt | 2 - doc/ja/autogen/user/weechat_commands.txt | 121 ++-- po/POTFILES.in | 2 + po/cs.po | 101 +++- po/de.po | 114 +++- po/es.po | 115 +++- po/fr.po | 190 +++++- po/hu.po | 100 +++- po/it.po | 115 +++- po/ja.po | 114 +++- po/pl.po | 114 +++- po/pt_BR.po | 114 +++- po/ru.po | 100 +++- po/srcfiles.cmake | 2 + po/weechat.pot | 100 +++- src/core/CMakeLists.txt | 1 + src/core/Makefile.am | 2 + src/core/wee-command.c | 142 ++++- src/core/wee-config.c | 20 + src/core/wee-eval.c | 717 +++++++++++++++++++++++ src/core/wee-eval.h | 55 ++ src/core/wee-string.c | 34 +- src/core/wee-string.h | 7 +- src/gui/gui-bar-item.c | 49 +- src/gui/gui-bar-item.h | 7 +- src/gui/gui-bar.c | 136 ++--- src/gui/gui-bar.h | 4 +- src/gui/gui-key.c | 30 +- src/plugins/guile/weechat-guile-api.c | 59 +- src/plugins/guile/weechat-guile.c | 38 +- src/plugins/guile/weechat-guile.h | 4 +- src/plugins/lua/weechat-lua-api.c | 57 +- src/plugins/lua/weechat-lua.c | 32 +- src/plugins/lua/weechat-lua.h | 4 +- src/plugins/perl/weechat-perl-api.c | 55 +- src/plugins/perl/weechat-perl.c | 25 +- src/plugins/perl/weechat-perl.h | 5 +- src/plugins/plugin-script.c | 2 +- src/plugins/plugin.c | 2 + src/plugins/python/weechat-python-api.c | 58 +- src/plugins/python/weechat-python.c | 28 +- src/plugins/python/weechat-python.h | 4 +- src/plugins/ruby/weechat-ruby-api.c | 62 +- src/plugins/ruby/weechat-ruby.c | 31 +- src/plugins/ruby/weechat-ruby.h | 4 +- src/plugins/tcl/weechat-tcl-api.c | 60 +- src/plugins/tcl/weechat-tcl.c | 32 +- src/plugins/tcl/weechat-tcl.h | 4 +- src/plugins/weechat-plugin.h | 9 +- 67 files changed, 4141 insertions(+), 462 deletions(-) create mode 100644 src/core/wee-eval.c create mode 100644 src/core/wee-eval.h diff --git a/ChangeLog b/ChangeLog index 36777db2e..78ff73987 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,13 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.4.0-dev, 2012-10-20 +v0.4.0-dev, 2012-11-02 Version 0.4.0 (under dev!) -------------------------- +* core: add command /eval, use expression in conditions for bars * core: add option "-quit" for command /upgrade (save session and quit without restarting WeeChat, for delayed restoration) * core: fix display of zoomed/merged buffer (with number >= 2) after switching @@ -15,6 +16,7 @@ Version 0.4.0 (under dev!) (problem with nick displayed in first line of screen) (bug #37556) * core: fix wrapping of words with wide chars (the break was made before the correct position) +* api: add new function "string_eval_expression" * api: connect with IPv6 by default in hook_connect (with fallback to IPv4), shuffle list of hosts for a same address, add argument "retry" for hook_connect, move "sock" from hook_connect arguments to callback of diff --git a/NEWS b/NEWS index 15d704b12..e9cf3719a 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ WeeChat Release Notes ===================== Sébastien Helleu -v0.4.0-dev, 2012-10-16 +v0.4.0-dev, 2012-11-02 Version 0.4.0 (under dev!) @@ -9,6 +9,10 @@ Version 0.4.0 (under dev!) Important release notes: +* conditions in bars have changed, and now an expression is evaluated. + If you have a value with many conditions in a bar, like: `nicklist,active`, + you must now use an expression like: `${nicklist} && ${active}` (see + the chapter about bars in the 'WeeChat User's guide'). * IPv6 is now used by default to connect to IRC servers, with fallback to IPv4. The option irc.server_default.ipv6 is now "on" by default. If IPv6 is not enabled or fails, IPv4 will be used. The "ipv6" option in server is now used diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt index f5302dd5b..f6a441e0d 100644 --- a/doc/de/autogen/plugin_api/hdata.txt +++ b/doc/de/autogen/plugin_api/hdata.txt @@ -325,8 +325,6 @@ | weechat | bar | Bar | 'name' (string) + 'options' (pointer) + - 'conditions_count' (integer) + - 'conditions_array' (string, array_size: "conditions_count") + 'items_count' (integer) + 'items_subcount' (pointer) + 'items_array' (pointer) + diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt index 9e4780cfc..f1dffb0ec 100644 --- a/doc/de/autogen/user/weechat_commands.txt +++ b/doc/de/autogen/user/weechat_commands.txt @@ -11,49 +11,50 @@ message: Abwesenheitsnachricht (ohne eine Nachricht wird der Abwesenheitszustand [command]*`bar`* Infobars verwalten:: ........................................ /bar list|listfull|listitems - add [,[,...]] [,...] + add [,] [,...] default [input|title|status|nicklist] del |-all set