A number of browsers allow you to define quick searches so that you can type keywords into your address bar in order to search predetermined sites. With a little bit of code, you can do this in Emacs, too. In this project, you'll learn how to set up your own keywords to work with w3m and browse-url, so you can use your keywords for browsing both inside and outside Emacs.
First, set up keywords by adding the following lines to your ~/.emacs. We'll use an associative list of regular expressions and substitutions, like this:

This will turn "g keyword1 keyword2" into a Google search for keyword1 and keyword2.
Next, define advice for the functions that open URLs. Before-type advice allows you to modify arguments before the function is run, and we'll use that to change the URLs. To modify the URL behavior of w3m, add the following to your ~/.emacs:

To try out your searches, use M-x browse-url RET g emacs RET to do a Google search for all things Emacs, and use M-x w3m-goto-url (usually bound to g) inside w3m to use the quick searches.
You can define more quick searches like this:

One Pingback/Trackback

What’s wrong with the quick-search feature which is already in emacs-w3m? See section 4.1 of the emacs-w3m manual and the variable w3m-search-engine-alist. It even allows to launch several searches on different search engines at once.