diff options
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/autogen/plugin_api/completions.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/en/autogen/user/guile_commands.txt | 20 | ||||
-rw-r--r-- | doc/en/weechat_scripting.en.txt | 91 | ||||
-rw-r--r-- | doc/en/weechat_user.en.txt | 65 |
5 files changed, 127 insertions, 53 deletions
diff --git a/doc/en/autogen/plugin_api/completions.txt b/doc/en/autogen/plugin_api/completions.txt index 45626fdcc..bec6757fb 100644 --- a/doc/en/autogen/plugin_api/completions.txt +++ b/doc/en/autogen/plugin_api/completions.txt @@ -8,6 +8,8 @@ | aspell | aspell_langs | list of supported langs for aspell +| guile | guile_script | list of scripts + | irc | irc_channel | current IRC channel | irc | irc_channel_nicks_hosts | nicks and hostnames of current IRC channel diff --git a/doc/en/autogen/plugin_api/infolists.txt b/doc/en/autogen/plugin_api/infolists.txt index 88534c235..7397122ff 100644 --- a/doc/en/autogen/plugin_api/infolists.txt +++ b/doc/en/autogen/plugin_api/infolists.txt @@ -4,6 +4,8 @@ | alias | alias | list of aliases | alias pointer (optional) | alias name (can start or end with "*" as wildcard) (optional) +| guile | guile_script | list of scripts | script pointer (optional) | script name (can start or end with "*" as wildcard) (optional) + | irc | irc_channel | list of channels for an IRC server | channel pointer (optional) | server,channel (channel is optional) | irc | irc_ignore | list of IRC ignores | ignore pointer (optional) | - diff --git a/doc/en/autogen/user/guile_commands.txt b/doc/en/autogen/user/guile_commands.txt new file mode 100644 index 000000000..be0c993ae --- /dev/null +++ b/doc/en/autogen/user/guile_commands.txt @@ -0,0 +1,20 @@ +[[command_guile_guile]] +[command]*`guile`* list/load/unload scripts:: +........................................ +/guile list|listfull [<name>] + load <filename> + autoload + reload|unload [<name>] + + list: list loaded scripts +listfull: list loaded scripts (verbose) + load: load a script +autoload: load all scripts in "autoload" directory + reload: reload a script (if no name given, unload all scripts, then load all scripts in "autoload" directory) + unload: unload a script (if no name given, unload all scripts) +filename: script (file) to load + name: a script name (name used in call to "register" function) + +Without argument, this command lists all loaded scripts. +........................................ + diff --git a/doc/en/weechat_scripting.en.txt b/doc/en/weechat_scripting.en.txt index e827c3f58..3afbdf0df 100644 --- a/doc/en/weechat_scripting.en.txt +++ b/doc/en/weechat_scripting.en.txt @@ -16,8 +16,15 @@ Introduction WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and light, designed for many operating systems. -This manual documents way to write scripts for WeeChat, using one of five -supported script languages: perl, python, ruby, lua or tcl. +This manual documents way to write scripts for WeeChat, using one of supported +script languages: + +* python +* perl +* ruby +* lua +* tcl +* guile (scheme) [NOTE] Almost all examples in this doc are written in Python, but API is the same for @@ -31,20 +38,45 @@ Scripts in WeeChat Languages specificities ~~~~~~~~~~~~~~~~~~~~~~~ -Some things are specific to languages: +Python +^^^^^^ -* perl: -** functions are called with `weechat::xxx(arg1, arg2, ...);` -* python: -** you have to `import weechat` -** functions `print*` are called `prnt*` in python (because 'print' is reserved - keyword) -** functions are called with `weechat.xxx(arg1, arg2, ...)` -* ruby: -** you have to define 'weechat_init' and call 'register' inside -** functions are called with `Weechat.xxx(arg1, arg2, ...)` -* tcl: -** functions are called with `weechat::xxx arg1 arg2 ...` +* You have to `import weechat` +* Functions `print*` are called `prnt*` in python (because 'print' is reserved + keyword) +* Functions are called with `weechat.xxx(arg1, arg2, ...)` + +Perl +^^^^ + +* Functions are called with `weechat::xxx(arg1, arg2, ...);` + +Ruby +^^^^ + +* You have to define 'weechat_init' and call 'register' inside +* Functions are called with `Weechat.xxx(arg1, arg2, ...)` + +Lua +^^^ + +* Functions are called with `weechat.xxx(arg1, arg2, ...)` + +Tcl +^^^ + +* Functions are called with `weechat::xxx arg1 arg2 ...` + +Guile (scheme) +^^^^^^^^^^^^^^ + +* Functions are called with `(weechat:xxx arg1 arg2 ...)` +* Following functions take one list of arguments (instead of many arguments + for other functions), because number of arguments exceed number of allowed + arguments in Guile: +** config_new_section +** config_new_option +** bar_new [[register_function]] Register function @@ -73,14 +105,6 @@ Arguments: Example of script, for each language: -* perl: - -[source,perl] ----------------------------------------- -weechat::register("test_perl", "FlashCode", "1.0", "GPL3", "Test script", "", ""); -weechat::print("", "Hello, from perl script!"); ----------------------------------------- - * python: [source,python] @@ -91,6 +115,14 @@ weechat.register("test_python", "FlashCode", "1.0", "GPL3", "Test script", "", " weechat.prnt("", "Hello, from python script!") ---------------------------------------- +* perl: + +[source,perl] +---------------------------------------- +weechat::register("test_perl", "FlashCode", "1.0", "GPL3", "Test script", "", ""); +weechat::print("", "Hello, from perl script!"); +---------------------------------------- + * ruby: [source,ruby] @@ -112,12 +144,20 @@ weechat.print("", "Hello, from lua script!") * tcl: -// [source,tcl] +[source,tcl] ---------------------------------------- weechat::register "test_tcl" "FlashCode" "1.0" "GPL3" "Test script" "" "" weechat::print "" "Hello, from tcl script!" ---------------------------------------- +* guile (scheme): + +[source,lisp] +---------------------------------------- +(weechat:register "test_scheme" "FlashCode" "1.0" "GPL3" "Test script" "" "") +(weechat:print "" "Hello, from scheme script!") +---------------------------------------- + [[load_script]] Load script ~~~~~~~~~~~ @@ -125,11 +165,12 @@ Load script You have to use command, depending on language: ---------------------------------------- -/perl load perl/script.pl /python load python/script.py +/perl load perl/script.pl /ruby load ruby/script.rb /lua load lua/script.lua /tcl load tcl/script.tcl +/guile load guile/script.scm ---------------------------------------- You can make link in directory 'language/autoload' to autoload script when diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt index 35b0a5665..04e9e4357 100644 --- a/doc/en/weechat_user.en.txt +++ b/doc/en/weechat_user.en.txt @@ -86,23 +86,24 @@ Dependencies Following table shows list of packages that are required or optional to compile WeeChat. -[width="80%",cols="4,^2,13",options="header"] +[width="100%",cols="5,^3,^3,13",options="header"] |======================================== -| Package ^(1)^ | Required | Feature -| cmake | *yes* | build (autotools still possible, but cmake is recommended) -| libncursesw5-dev ^(2)^ | *yes* | ncurses interface -| gettext | no | internationalization (translation of messages; base language is english) -| libgcrypt11-dev | no | SASL authentication with IRC server using DH-BLOWFISH mechanism -| libgnutls-dev (≥ 2.2.0) | no | SSL connection to IRC server -| ca-certificates | no | certificates for SSL connections -| libaspell-dev | no | aspell plugin -| libperl-dev | no | perl plugin -| python-dev | no | python plugin -| ruby1.8-dev | no | ruby plugin -| liblua5.1-0-dev | no | lua plugin -| tcl-dev (≥ 8.5) | no | tcl plugin -| asciidoc (≥ 8.5.0) | no | build documentation (HTML files) -| source-highlight | no | syntax highlight for sources in HTML documentation +| Package ^(1)^ | Version | Required | Feature +| cmake | | *yes* | build (autotools still possible, but cmake is recommended) +| libncursesw5-dev ^(2)^ | | *yes* | ncurses interface +| gettext | | | internationalization (translation of messages; base language is english) +| libgcrypt11-dev | | | SASL authentication with IRC server using DH-BLOWFISH mechanism +| libgnutls-dev | ≥ 2.2.0 | | SSL connection to IRC server +| ca-certificates | | | certificates for SSL connections +| libaspell-dev | | | aspell plugin +| python-dev | 2.5 → 2.7 | | python plugin +| libperl-dev | | | perl plugin +| ruby1.8-dev | | | ruby plugin +| liblua5.1-0-dev | | | lua plugin +| tcl-dev | ≥ 8.5 | | tcl plugin +| guile-1.8-dev | | | guile (scheme) plugin +| asciidoc | ≥ 8.5.0 | | build documentation (HTML files) +| source-highlight | | | syntax highlight for sources in HTML documentation |======================================== [NOTE] @@ -992,8 +993,8 @@ possible to load or unload plugins while WeeChat is running. It's important to make difference between a 'plugin' and a 'script': a 'plugin' is a binary file compiled and loaded with command `/plugin`, whereas -a 'script' is a text file loaded with a plugin like 'perl' with command -`/perl`. +a 'script' is a text file loaded with a plugin like 'python' with command +`/python`. You can use command `/plugin` to load/unload a plugin, or list all loaded plugins. @@ -1022,11 +1023,12 @@ Default plugins are: | logger | Log buffers to files | relay | Relay data via network (IRC proxy) | rmodifier | Alter modifier strings with regular expressions -| perl | Perl scripting API | python | Python scripting API +| perl | Perl scripting API | ruby | Ruby scripting API | lua | Lua scripting API | tcl | Tcl scripting API +| guile | Guile (scheme) scripting API | xfer | File transfer and direct chat |======================================== @@ -1220,11 +1222,11 @@ $ echo 'irc.freenode.#weechat *hello!' >~/.weechat/weechat_fifo_12345 $ echo '*hello!' >~/.weechat/weechat_fifo_12345 ---------------------------------------- -* send two commands to unload/reload Perl scripts (you have to separate them +* send two commands to unload/reload Python scripts (you have to separate them with "\n"): ---------------------------------------- -$ echo -e '*/perl unload\n*/perl autoload' >~/.weechat/weechat_fifo_12345 +$ echo -e '*/python unload\n*/python autoload' >~/.weechat/weechat_fifo_12345 ---------------------------------------- You can write a script to send command to all running WeeChat at same time, @@ -1913,7 +1915,8 @@ If command line contains: `/oper nick password` then display becomes: Scripts plugins ~~~~~~~~~~~~~~~ -WeeChat provides 5 scripting plugins: Perl, Python, Ruby, Lua and Tcl. +WeeChat provides 6 scripting plugins: Python, Perl, Ruby, Lua, Tcl and Guile +(scheme). These plugins can load, execute and unload scripts for these languages. For more information about how to write scripts, or WeeChat API for @@ -1921,18 +1924,18 @@ scripts, please read 'WeeChat Scripting Guide'. You can find some scripts for WeeChat here: http://www.weechat.org/scripts -[[perl_commands]] -Perl commands -^^^^^^^^^^^^^ - -include::autogen/user/perl_commands.txt[] - [[python_commands]] Python commands ^^^^^^^^^^^^^^^ include::autogen/user/python_commands.txt[] +[[perl_commands]] +Perl commands +^^^^^^^^^^^^^ + +include::autogen/user/perl_commands.txt[] + [[ruby_commands]] Ruby commands ^^^^^^^^^^^^^ @@ -1951,6 +1954,12 @@ Tcl commands include::autogen/user/tcl_commands.txt[] +[[guile_commands]] +Guile commands +^^^^^^^^^^^^^^ + +include::autogen/user/guile_commands.txt[] + [[xfer_plugin]] Xfer plugin ~~~~~~~~~~~ |