David Woodfall <[EMAIL PROTECTED]> writes:

> At the moment I'm saving a page and using
>
> w3m -dump xxx.htm | lp
>
> Is there a way of setting up a keyboard shortcut/alias to do this?

doc/lua-scripting.txt includes a "Printing" example that formats
the document with ELinks (rather than w3m) and prints the result.
However, it uses "writeto" which apparently is in Lua 4 but not
in Lua 5.  For Lua 5, you can instead use:

-- print the current document (for Lua 5)
function print()
        local lp, errmsg = io.popen("lp", "w")
        if lp == nil then
                error(errmsg)
        else
                lp:write(current_document_formatted(79))
                lp:close()
        end
end
bind_key('main', 'P', print)

I don't have w3m installed but I imagine you could use "w3m -dump
- | lp" in the popen call and current_document() in lp:write,
or create a temporary file.

Attachment: pgpQhwve5cdr9.pgp
Description: PGP signature

_______________________________________________
elinks-users mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-users

Reply via email to