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 pluginsSeverity: 3 - Normal
Item Group: crashStatus: Fixed
Privacy: PublicAssigned to: Sebastien Helleu <flashcode>
Originator Name: Open/Closed: Closed
Release: 0.3.3IRC nick: 

Add a New Comment (Rich MarkupRich 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 20 May 2013 09:03:50 AM UTCflashcodeOpen/ClosedOpen=>Closed
    Fri 22 Mar 2013 06:56:32 PM UTCflashcodeItem Groupother=>crash
      StatusNeed Info=>Fixed
    Tue 21 Sep 2010 03:38:33 PM UTCflashcodeRelease0.4.4-dev=>0.3.3
    Tue 21 Sep 2010 03:38:13 PM UTCflashcodeItem GroupNone=>other
      StatusNone=>Need Info
      Assigned toNone=>flashcode

    Back to the top


    Powered by Savane 3.1-cleanup