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

 
 

bug #31050: cannot use config_new_option from ruby script

Submitted by:  arno <arenevier>
Submitted on:  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:  Sebastien Helleu <flashcode>
Originator Name:  Open/Closed:  Closed
Release:  0.3.3 IRC nick: 

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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:
http://weechat.org/files/doc/devel/weechat_scripting.en.html#_ruby

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
Thu 16 Sep 2010 11:45:19 AM UTC, original submission:

Hi,
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:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/vm_insnhelper.c?annotate=29040#l380

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
end

arno <arenevier>

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    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 Release2.2-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.3