[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1.3 Using your favorite engines

Emacs-w3m has a number of built-in search engines you can use. What if you want to use your favorite search engine and it's not listed in the known search engines? You have to add it to the list of search engines, and it's quite easy:

  1. First, you have to find what's the entry point of the search engine you want to add, for example:

    http://my.searchengine.com/?query=foobar

    where foobar is the term you want to search for.

  2. Once you have this information, add this to your `~/.emacs-w3m' file:

     
    (eval-after-load "w3m-search"
      '(add-to-list 'w3m-search-engine-alist
                    '("My engine"
                      "http://my.searchengine.com/?query=%s"
                      nil)))
    

    Replace the first field "My engine" with the description of your engine, the second field with the entry point (the `%s' is important, it will be replaced by the search term when you issue the search), and the third field is the encoding to use, nil or omitting this field means to use the value of w3m-default-coding-system as a regular encoding.

    For English search engines, you rarely have to worry about this. However, for some Japanese search engines, you may need to specify something (e.g. euc-japan) there.

  3. You can now use this engine to search, using the normal S key in emacs-w3m. If you use this engine often, you can also add it to the Quicksearch (see 4.1.2 An alternative (and fast) way to search the web) engines and give it a small prefix, by adding this to your `~/.emacs-w3m' file instead:

     
    (eval-after-load "w3m-search"
      '(progn
         (add-to-list 'w3m-search-engine-alist
                      '("My engine"
                        "http://my.searchengine.com/?query=%s"
                        nil))
         (add-to-list 'w3m-uri-replace-alist
                      '("\\`my:" w3m-search-uri-replace "My engine"))))
    

    This way you can also use a URL like my:foobar to search for the term "foobar" with your engine.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by TSUCHIYA Masatoshi on November, 3 2005 using texi2html