bugWeeChat - Bugs: bug #31050, cannot use config_new_option from...


bug #31050: cannot use config_new_option from ruby script

Submitter:  arno <arenevier>
Submitted:  Thu 16 Sep 2010 11:45:19 AM UTC
Category:  script API plugins Severity:  3 - Normal
Item Group:  crash Status:  Fixed
Privacy:  Public Assigned to:  flashcode
Originator Name:  Open/Closed:  Closed
Release:  * 0.3.3 IRC nick: 
* Mandatory Fields

Add a New Comment Rich Markup

Fri 22 Mar 2013 06:56:32 PM UTC, comment #2: 

Fixed in WeeChat, because it was crashing with Ruby 2.0.

Now this function receives the 6 last arguments (3 callbacks + 3 data strings) in an array of 6 strings.

See the scripting guide for an example:

Sebastien Helleu <flashcode>
Group administrator
Tue 21 Sep 2010 03:38:13 PM UTC, comment #1: 

I think the easier solution would be for ruby to allow more than 15 arguments.

I agree that 17 is lot of args for a function, but if possible, API should not change to be compatible with existing scripts.

Maybe you could report that problem to ruby?

Sebastien Helleu <flashcode>
Group administrator
Thu 16 Sep 2010 11:45:19 AM UTC, original submission:  

when trying to user config_new_option from a ruby script, it fails with error
ruby: error: (eval):6:in `config_new_option': too many arguments (17) (ArgumentError)
I investigated a bit, a discovered that ruby has a limit of 15 arguments to cfuncs:

Here is my example script:

def weechat_init
    Weechat.register('test', 'arno', '0.1', 'WTFPL', 'test', '', '')

    config = Weechat.config_new("weechat", "", "")
    section = Weechat.config_new_section(config, "history", 0, 0, "", "", "", "", "", "", "", "", "", "")
    option = Weechat.config_new_option(config, section, "max_commands", "integer", "", "", 0, 32767, "100", "", 0, "", "", "", "", "", "")

    return Weechat::WEECHAT_RC_OK

arno <arenevier>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by flashcode (Posted a comment)
  • -email is unavailable- added by arenevier (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-20 flashcode Open/ClosedOpen Closed
    2013-03-22 flashcode Item Groupother crash
        StatusNeed Info Fixed
    2010-09-21 flashcode Release3.3-dev 0.3.3
    2010-09-21 flashcode Item GroupNone other
        StatusNone Need Info
        Assigned toNone flashcode

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code