1Dictionary look-up hack for w3m
2
31. INTRODUCTION
4
5If you have a dictionary look-up command (such as 'webster'), you can
6look up words in a document using w3m. This dictionary-lookup code
7was contributed by `Rubikitch' (rubikitch@ruby-lang.org), and
8further modified by Tushar Samant (scribble at pobox.com).
9
102. INSTALLATION
11
12To make use of the dictionary look-up, you currently must change a
13compile option by hand. After running configure, edit config.h
14and change
15
16#undef USE_DICT
17
18to
19
20#define USE_DICT
21
22and recompile w3m (i.e. type "make install").
23Note that w3m/0.3+cvs-1.373 or later, USE_DICT is defined by default.
24
25Then find or install a CGI program which takes a word as a query
26string and prints a response.
27
28Some ways to do this would be:
29
30  * If you have the 'webster' command, put something like this
31    in a script called 'w3mdict':
32
33      #!/bin/sh
34
35      echo Content-type: text/plain
36      echo
37      webster $QUERY_STRING
38
39    Then install w3mdict as a local CGI (see the local CGI section
40    of the w3m manual), and set your dictionary options from the
41    options page of w3m (usually invoked with "o").
42
43  * If you want this function to look a word up on Google instead,
44    write a local CGI script like this:
45
46      #!/bin/sh
47
48      google_q='http://google.com/search?btnG=Google&q'
49
50      cat <<_END_
51      Content-type: text/plain
52      W3m-control: GOTO $google_q=$QUERY_STRING
53      W3m-control: DELETE_PREVBUF
54
55      _END_
56
57    and set its path as your dictionary-lookup URL option.
58
593. USAGE
60
61You can use the following two commands:
62
63ESC w    Input a word and look it up using w3mdict command.
64
65ESC W    look up the current word in the buffer.
66
67To change these keys, edit ~/.w3m/keymap and edit lines for the
68functions DICT_WORD and DICT_WORD_AT respectively.
69