[w3m-dev-en 00239] Re: printing

From: Johannes Zellner (johannes@zellner.org)
Date: Wed Sep 27 2000 - 03:36:39 CDT

  • Next message: Johannes Zellner: "[w3m-dev-en 00240] here is the /correct/ patch"

    On Wed, Sep 27, 2000 at 12:29:34PM +0900, Hironori Sakamoto wrote:

    Hello,

    > >> From: Johannes Zellner <johannes@zellner.org>
    > >> ah. Thank you. That's nice. Now I only need a new keymap
    > >> feature which allows strings instead of function names:
    > >> keymap C-p "| html2ps | lpr"
    > >> or:
    > >> keymap C-p "html2ps %s | lpr"
    > >> (where %s is substituted by the url of the current page)
    > >> This would make w3m pretty configurable :-)
    > >> what do people think about that ?
    >
    > That extension of keymap is difficult.
    > User will expect that the target(%s) is url in some cases,
    > but it is the current buffer or the downloaded source file
    > in another case.
    >
    > I know another technique to print in w3m.
    > Press 'S' (it means to save buffer), and input "| a2ps | lpr".
    > # "a2ps" is a converter form text file to postscript.
    >
    > Then, the followig extension of keymap will be possible.
    >
    > keymap C-p SAVE_BUFFER "| a2ps | lpr"
    >
    > How about that.

    I couldn't resist. The patch is attached. This applies to
    a plain unpatched w3m-0.1.11-pre. The syntax is for example

        keymap P "| html2ps | lpr"
        keymap P "html2ps %s | gv -"
        keymap P "html2ps %u | gv -"

    (single quotas also work)
    Currently three escapes are implemented:

    %u --> url
    %s --> filename of the cache file
    %d --> line number (this is not too useful, as the line number is
           counted for the displayed page, but not for the html source.

    so it's up to the user, if he wishes to use the cache file or
    the url. /All/ occurrences of the escapes are replaced, so
    one could use soemthing like

        keymap P "a2ps --title='%s' %s | lpr"

    another hint: did someone ever compile w3m with gcc -Wall ?
    There are /lots/ of warnings !

    -- 
       Johannes
    




    This archive was generated by hypermail 2b29 : Wed Sep 27 2000 - 04:02:39 CDT