[elinks-users] Sourcing hooks.lua at runtime?

Miciah Dashiel Butler Masters miciah.masters at gmail.com
Thu Feb 16 12:45:45 PST 2012


On Thu, Feb 16, 2012 at 03:35:02PM -0500, scribblemacher wrote:
>Hello,
>
>I'm fiddling around with using Lua hooks to reformat pages. It's trial
>and error for me to get the results I want (I'm not a programmer and
>I've never touched Lua before this). It seems that Elinks only reads my
>hooks.lua file on start-up though, which makes my trial and error
>experiments a bit slow. Is there a way to get Lua to reload this file
>after I make changes? Or perhaps there is a better way to perform this
>type of experimentation other than the pre_format_html function?
>
>Advise would be much appreciated!
[...]

Yes: Using the default hooks.lua file, you can enter "reload()" at the
Lua console to reload the hooks file.  Open the console with the ","
key.

"reload()" is actually defined in the default hooks.lua file.  Later on
in hooks.lua, you can see that the Lua console just calls the
lua_console_hook function, which allows the user to call the reload()
function or run arbitrary Lua code.

Best regards,

-- 
Miciah Dashiel Butler Masters <miciah.masters at gmail.com>



More information about the elinks-users mailing list