Python: Give goto_url_hook only one argument, like follow_url_hook.
commit26473f72f59641aa60277f14f703f8a76dda5a82
authorM. Levinson <levinsm@users.sourceforge.net>
Sun, 31 Dec 2006 15:00:34 +0000 (31 10:00 -0500)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Mon, 1 Jan 2007 15:45:36 +0000 (1 17:45 +0200)
tree7098f944bd204dbf6776badb83971976c923ef80
parente45f5a8915b7169e4bfe6475b736adf344f97b8f
Python: Give goto_url_hook only one argument, like follow_url_hook.

On Dec 31, 2006, at 11:30am, Kalle Olavi Niemitalo writes:
>src/scripting/python/hooks.c (script_hook_url) calls hooks as
>goto_url_hook(new-url, current-url) and follow_url_hook(new-url).
>It has a comment saying that the current-url parameter exists
>only for compatibility and that the script can instead use
>elinks.current_url().  However, the current-url parameter was
>added in commit 87e27b9b3e47671484c7eb77d61b75fffc89624f and is
>not in ELinks 0.11.2, so any compatibility problems would only
>hit people who have been using 0.12.GIT snapshots.  Can we remove
>the second parameter now before releasing ELinks 0.12pre1?

The decision isn't up to me, but I think this is a good idea. Here's a
patch that would update the documentation and hooks.py, as well as hooks.c.

FYI, if this patch is applied then anyone who's still trying to use a
goto_url_hook that expects a second argument will get a "Browser scripting
error" dialog box that says:

An error occurred while running a Python script:

TypeError: goto_url_hook() takes exactly 2 arguments (1 given)
contrib/python/hooks.py
doc/python.txt
src/scripting/python/hooks.c