>![]() |
emacs-w3m is a front-end, written in emacs lisp, to the text-based web browser w3m. It supports tables, images, and all major web protocols. It is also fully supported in emacspeak.
The main advantage of emacs-w3m is speed. The rendering of web pages is done with the external program w3m. which is written in c, so it is fast. It also seems not to choke on some web pages like the alternative, emacs/w3.
Another big advantage to emacs-w3m is that it is under active development. Problems seem to be fixed soon after they come to the attention of the developers and are available very quickly as long as you are willing to use the cvs version.
For those who have limited sight as opposed to no sight at all, emacs-w3m displays all graphics within its own buffer. This might be a misconfiguration on my part, but there are some images that open in an external window when opened from emacs/w3.
I can also say that I cannot remember a page that wouldn't render in emacs-w3m. This is not something I can say about emacs/w3.
Taken by itself, the disadvantages of using w3m are few. Long periods between releases can be seen by some to be a disadvantage although the alternative browser's time between releases is now several years, I believe.
With hardware or software that support multiple voices, such as IBM's
Via Voice, one can allow differences in speech to indicate differences
in document text. For example, headings can be spoken in a voice with
a lower pitch, links in a higher voice. The voices in emacs-w3m are
much more limited than those in emacs/w3 and not all textual
attributes can be indicated. As of the writing of this document, pre
tags and the like cannot be indicated. It has been within the last
few months that italic text support has been added.
Another disadvantage is the fact that the rendering in emacs-w3m is done by the external process, w3m. Since w3m is written in C, it is not as easily customizable from within the community of emacs users. Code written in emacs lisp can be substituted for code in a running emacs instance, something that is not possible in C.
A further disadvantage is the lack of table navigation, i.e. the ability to move from cell to cell in a table to more easily understand the information presented. Linearizing the table is available but sometimes it is difficult to keep the meanings of the columns in your head to discern the meaning. Maybe it is just me.
A disadvantage shared between the browsers is the lack of support for javascript. Many sites use javascript for links to the next page, such as Reuters web site. This can sometimes be worked around using the google transcoder. See See below, for more information.
This part of the document is not meant to replace the
describe-mode
information available via the C-h m
keystroke or the emacs-w3m info manual. This is by no means an
exhaustive list of available commands.
emacs-w3m has considerable functionality and many features that make browsing more efficient and convenient. Below are many of the functions that are native to emacs-w3m.
Cap S will query for a search term. By default, the search engine used is google. This can be changed with a prefix command. To see the available engines, after hitting C-u Cap S, when it asks for the engine hit <TAB> to get a list of available completions. Tab completion of partial words works here as well. For example, hitting “y” and then <TAB> will complete to the word “yahoo”.
Form navigation can be achieved with the right and left brackets. This is useful for times where you want to go to the input field on a web page without having to tab through the links. Google is a good example of where this would be useful. The right bracket moves point to the next form, and the left bracket moves to the previous, wrapping around at the ends of the buffer.
While in a form, using C-c C-c will submit the form with no need to tab around looking for the “Submit” button.
Many extensions have been written by the emacspeak community to expand emacs-w3m and make it more accessible. Below are those extensions.
While being a variable and not a function, the variable
emacspeak-w3m-speak-titles-on-switch
makes emacs-w3m more friendly.
It tells emacspeak to speak the document title when switching between
emacs-w3m buffers. The default, nil
, will speak the mode line. This
is the same behavior seen in all other buffers. This speaking of the
document title is more descriptive than just hearing *w3m*<4>
. This
variable can be customized in the usual ways, either in your .emacs
file or via the Customize
interface. If you do set this variable,
reading the mode line can still be achieved with C-e m.
The j command will jump to the first occurance of the title in the document. Each time you use this command in succession, it will jump to the next occurance of the title. This is very convenient for web pages that have the title show up in multiple places in the document. The web site for The Register is a good example of this.
The l command uses the default media player to play the media stream
at point. I believe this is set to emacspeak-m-player
by default.
While beyond the scope of this document to describe the installation
of mplayer, I would highly advise using this media player. With the
correct codecs installed, mplayer will play everything you will find,
I believe, with one convenient player that does not require a GUI.
C-t will run the current page through the google transcoder. The transcoder is very useful to the users of screen readers as it takes care of formatting issues like tables. While not usually a problem, There is a function to linearize tables in emacs-w3m, but it is not always successful. You can reverse this command by giving a prefix argument.
M-t runs the url under point through the transcoder. This command can be reversed by giving a prefix argument.
Extensions have been written to take advantage of much of the google functionality. The following describes how to access many of these extensions.
C-c C-g will search the current web site with google.
C-c C-x will extract the current page from the google cache. A prefix argument will extract the url under point from the cache. This is useful if, for instance, a site is down for one reason or another and you absolutely must have the information.
C-c C-l will find pages similar to the current page. This is just like the “similar” link at the end of a google search result.
C-c C-r will browse the rss link under point. One reason this might
be useful is to first try out the rss feed before you configure your
rss reader to subscribe to the feed. For a easy to use rss reader,
see the section below on See emacspeak-rss
.
The letter x is the prefix key for the xsl transforms. xslt is some powerful ju-ju. It takes a web page and does all kinds of cool things with it. These things are listed below.
The command x a will apply an xsl transformation to the current page. one particularly useful transform is to linearize tables. This takes the tables and formats them linearly down the page as if they were paragraphs instead of table cells. This command can be more easily applied with the x l command.
If you want to always have tables linearized, use the x a command and
type linearize <TAB> and then the x o to toggle xsl on. This will
linearize the tables in every subsequently visited page for this
session. While it seems possible to make this happen automatically in
emacs/w3, I do not believe this is currently possible in emacs-w3m.
A noticeable increase in speed can be seen in emacs/w3 by turning xslt
on and using sort-tables
or linearize-tables
. This
eliminates the need for the browser to render nested tables. Since
speed is not such an issue with emacs-w3m, I don't bother turning on
xslt for the session.
The x b command will add a “submit” button to forms that do not have one such as the one on the emacswiki web site . Submitting forms can be more easily achieved with C-c C-c.
If on a google search page, the x h command will give you only the
search hits. An easier way of getting the same results is to use the
url-template
“Google Hits” which returns the same results. Another
advantage of using the url-template
is that it can be done from
anywhere, not just in an emacs-w3m buffer.
See emacspeak-url-template, for more
information.
The x t command sorts the tables. It takes the nested tables and unnests them. While sometimes useful, this is not nearly as useful as the same function in emacs/w3. While doing the same thing, emacs/w3 has the capability of allowing the user to navigate the tables cell by cell.
One issue that might need work is that, by default, when tabbing over links in emacs-w3m the url of the link is spoken. There are several ways to deal with this.
One solution, actually two but they accomplish the same result, is to include the following code in the ~/.emacs-w3m file:
(remove-hook 'w3m-after-cursor-move-hook #'w3m-print-this-url)
Or, this code in the .emacs file
(add-hook 'w3m-after-cursor-move-hook (lambda () (emacspeak-speak-messages nil)))
Both of these solutions, as far as the user can see, seem to be equivalent. They differ only in where they are placed.
The other solution is to leave things as they are. Some users mention that they find it helpful to have the url spoken and, if they want the text of the link spoken they use C-e l. As with everything else in emacs, it is completely up to you to decide what is best.