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

3. Compatibility with other Browsers

Due to the popularity of several other browsers, Emacs/W3 offers an easy transition to its much better way of life. This ranges from being able to share the same preferences files and disk cache to actually emulating the keybindings used in other browsers.

3.1 Emulation  Emacs/W3 can emulate the keybindings and other behaviours of other browsers.
3.5 Hotlist Handling  A hotlist is an easy way to keep track of interesting Web pages without having to remember the exact path to get there.
3.6 History  Keeping a history of documents visited in one Emacs sessions allows the use of
'forward' and 'back' buttons easily.
3.7 Global History  Keeping a history of all the places ever visited on the web.

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

3.1 Emulation

Emacs/W3 can emulate the keybindings of lynx and netscape, but only one at a time. If you want emulation permanantly turned on, then you should add turn-on-lynx-emulation or turn-on-netscape-emulation to w3-mode-hook.

3.2 Lynx emulation  Emulate lynx.
3.3 Netscape emulation  Emulate netscape.
3.4 Masquerading  Emacs/W3 can masquerade as another browser.

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

3.2 Lynx emulation

turn-on-lynx-emulation turns on lynx emulation and turns off netscape emulation. lynx emulation is handled by the w3-lynx-emulation-minor-mode minor mode. For more information about lynx style hotlists, See section 3.5 Hotlist Handling.

:: work :: Document lynx emulation

Down arrow
Highlight next topic
Up arrow
Highlight previous topic
Right arrow, Return, Enter
Jump to highlighted topic
Left arrow
Return to previous topic. gdj1: actually, this doesn't seem to work quite right.
Scroll down to next page (Page-Down)
Scroll up to previous page (Page-Up)
Scroll down to next page (Page-Down)
Scroll up to previous page (Page-Up)
Go to first page of the current document (Home)
Go to last page of the current document (End)
Scroll up to previous page (Page-Up)
Scroll down to next page (Page-Down)
Go forward two lines in the current document
Go back two lines in the current document
Go forward half a page in the current document (ignored)
Go back half a page in the current document (ignored)
Go to Toolbar or Banner in the current document, only works in XEmacs. gdj1: is this what is meant by toolbar?
?, h
Help (this screen)
Add the current link to a bookmark file
Send a comment to the document owner
Download the current link
Edit the current file (ignored)
Goto a user specified URL or file
Show an index of documents (ignored)
Execute a jump operation (using hotlist)
Show a list of key mappings
List references (links) in current document
Return to main screen
Go to the next search string
Set your options
Print the current document
Delete hotlist entry
Enter a search string for an external search gdj1: really?
Go backwards in history
Search for a string within the current document
View a bookmark file
Go to the Visited Links Page
Force submission of form or link with no-cache
Cancel transfer in progress
Go to the history Page gdj1: really?
Show file and link info
Toggle document source/rendered view
Spawn your default shell
Toggle image_links mode on and off (ignored)
Toggle pseudo_inlines mode on and off (ignorged)
Send an HTTP HEAD request for the current doc or link (ignored)
Reload current file and refresh the screen
Refresh the screen
Erase input line (ignored)
Cancel input or transfer
Toggle trace mode on and off (ignored)
Invoke the Cookie Jar Page (ignored)

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

3.3 Netscape emulation

turn-on-netscape-emulation turns on netscape emulation and turns off lynx emulation. netscape emulation is handled by the w3-netscape-emulation-minor-mode minor mode. For more information about netscape style hotlists, See section 3.5 Hotlist Handling.

Add the current link to a bookmark file

Show hotlist file.

Search forward in document

Reapeat last search

Show history window

Load images

Goto a user specified URL or file

Send mail

Open new frame

Open a local file

Print current document

Quit current document

Reload document and redraw

Save current document

Go back in history list

Go forward in history list

Scroll left

Scroll right

Scroll up

Scroll down

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

3.4 Masquerading

HTTP allows servers to ask browsers what browser they are, and what version they are. Emacs/W3 allows you to choose the reply. There are functions to masquerade as lynx, netscape, IE or arena. For each browser there are three functions, turn-on-browser-masquerade-mode, turn-off-browser-masquerade-mode and w3-browser-masquerade-mode. The purpose of the first two is clear, w3-browser-masquerade-mode takes an optional argument which toggles the mode if it's nil, turns off the mode if it's 0 and turns the mode on otherwise.

If you'd prefer to masquerade as another browser, then you should call w3-masquerade-stub with three arguments: arg, app and version. arg has the same function as for w3-browser-masquerade-mode, app is the name of the browser to masquerade as and version is the version.

Why would you want to masquerade as another browser when you could be advertising Emacs/W3? Well, some servers will only let certain browsers connect with them. This is cleary evil. Also some servers may alter what they present depending on the browser, this is probably a Good Thing but they might not know about Emacs/W3. Also one could argue that demanding the USER_AGENT field is a breach of privacy, Emacs/W3 doesn't have to send it (see section 7. Security), but the server doesn't have to let you connect either.

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

3.5 Hotlist Handling

Emacs/W3 supports two types of hotlist, mosaic hotlists and HTML as used by lynx and netscape (which both call hotlists bookmarks). Unfortunately, not all hotlist operations are supported for HTML files at the moment.

In order to avoid having to traverse many documents to get to the same document over and over, Emacs/W3 supports a "hotlist" like Mosaic. This is a file that contains URLs and aliases. Hotlists allow quick access to any document in the Web, providing it has been visited and added to the hotlist. The variable w3-hotlist-file determines where this information is saved. The structure of the file is compatible with Mosaic's hotlist file, so this defaults to `~/.mosaic-hotlist-default'.

Hotlist commands are:

Shows the hotlist entries matching a regular expression.

Adds the current document to the hotlist, with the buffer name as its identifier. Modifies the file specified by w3-hotlist-file. If this is given a prefix-argument (via C-u), the title is prompted for instead of automatically defaulting to the document title.

Prompts for the alias of the entry to kill. Pressing the spacebar or tab will list out partial completions. The internal representation of the hotlist and the file specified by w3-hotlist-file are updated.

Some hotlist item names can be very unwieldy (`Mosaic for X level 2 fill out form support'), or uninformative (`Index of /'). Prompts for the item to rename in the minibuffer--use the spacebar or tab key for completion. After having chosen an item to rename, prompts for a new title until a unique title is entered. Modifies the file specified by w3-hotlist-file.

Prompts for the alias to jump to. Pressing the spacebar or tab key shows partial completions.

Converts the hotlist into HTML and displays it.

Appends another hotlist file to the one currently in memory.

Add the document pointed to by the hyperlink under point to the hotlist.

This rereads the default hostlist file specified by w3-hotlist-file.

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

3.6 History

Almost all web browsers keep track of the URLs followed from a page, so that it can provide forward and back buttons to keep a path of URLs that can be traversed easily.

If url-keep-history is non-nil, then Emacs/W3 keeps track of all the URLs visited in an Emacs session. If t then Emacs/W3 will save the history list at the end of each session to the url-global-history-file file. The history list is simply a list of all the URLs visited in the session.

To view a listing of the history for this session of Emacs/W3, use M-x w3-show-history-list (Hv) from any buffer, and Emacs/W3 generates an HTML document showing every URL visited since Emacs started (or cleared the history list), and then format it. Any of the links can be chosen and followed to the original document. To clear the history list, choose 'Clear History' from the 'Options' menu.

Another twist on the history list mechanism is the fact that all Emacs/W3 buffers remember what URL, buffer, and buffer position of the last document, and also keeps track of the next location jumped to from that buffer. This means that the user can go forwards and backwards very easily along the path taken to reach a particular document. To go forward, use the function w3-forward-in-history (F), to go backward, use the function w3-backward-in-history (B). To view the entire history, use w3-show-history-list (Hv).

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

3.7 Global History

Most web browsers also support the idea of a "history" of URLs the user has visited, and it displays them in a different style than normal URLs. Emacs/W3 will read and write history files generated by Emacs/W3, Mosaic v1 and v2 or netscape. Emacs/W3 looks at the file contents to determine the type of history.

If the variable url-keep-history is t, then Emacs/W3 keeps a list of all the URLs visited in a session. The file is automatically written to disk every url-global-history-save-interval seconds and when exiting emacs. The list is added to those already in the file specified by url-global-history-file, which defaults to `~/mosaic.hst' for MS operating systems, `~/mosaic.global-history' for VMS and `~/.w3/history' for everything else.

If any URL in the list is found in the file, it is not saved, but new ones are added at the end of the file.

The function that saves the global history list is smart enough to notice what style of history list is being used (Netscape, Emacs/W3, or XMosaic), and writes out the new additions appropriately.

One of the nice things about keeping a global history files is that Emacs/W3 can use it as a completion table. When doing M-x w3-fetch, pressing the tab or space key will show all completions for a partial URL. This is very useful, especially for very long URLs that are not in a hotlist, or for seeing all the pages from a particular web site before choosing which to retrieve.

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

3.8 Display Variables

Emacs/W3 has many variable for you to fiddle with to get the display just right.

You can control what Emacs/W3 does with frame by setting w3-display-frames. It can be
Emacs/W3 will pretend not to understand frames at all.
Emacs/W3 will show hyperlinks to frames but will not fetch them (the same behaviour as lynx).
This is similar to as-nil, but Emacs/W3 will ask if you want to retrieve the frames.
Emacs/W3 will display the hyperlinks and fetch the frames.

Emacs/W3 lets you decide what characters to use for bullets in unordered lists by setting w3-bullets. It is a association list, mapping list types to characters. By default it is ((disc . ?*) (circle . ?o) (square . ?#) (none . ? )).

You can decide what should be displayed when tabbing through links by setting the w3-echo-link variable. It is a list and may contain the following symbols,
Display the URL of the target.
Display the text of the link.
Display the title attribute of the link.
Display the name or id attribute of the link.

The default is (title url text name).

Many HTML pages use horizontal lines (rules) to separate sections of the page. You can control what character Emacs/W3 will use to draw these by setting w3-horizontal-rule-char. If it is a character (not a string) then Emacs/W3 will replicate that character across the screen, if it is nil then Emacs/W3 will use a terminal graphics character if possible. It is nil by default.

When Emacs/W3 draws table and rules, it needs to approximate line somehow. If w3-use-terminal-characters it non-nil (the default) then Emacs/W3 will use terminal graphics characters if they are available.

Using terminal graphics characters on ttys will trigger display bugs in both XEmacs and FSF Emacs, but the display is usually readable with FSF Emacs. w3-use-terminal-characters-on-tty controls whether to use terminal graphics characters on ttys, it is nil by default.

Emacs/W3 can use glyphs rather than text properties for terminal graphics characters. Glyphs do not work with the most recent versions of XEmacs. This is t by default.

w3-defined-link-types is a list of names that have special significance as the values of `REL' or `REV' attributes of <link> elements. All members should be in lowercase.

Some people do not feel it's worth their time to add alt tags to their images, but Emacs/W3 can create alt tags on the fly for images that do not have them. To control this you can set w3-auto-image-alt to one of the following:
Do not create alt tags
The string will be run through format with the filename of the image and so may have a single %s, for example "[IMAGE(%s)]"
The function will be called with the filename of the images as the argument. This is the default, with w3-default-image-alt-func being the function.

w3-min-img-size, w3-default-image-alt-func, w3-dummy-img-alt-repl
w3-default-image-alt-func returns w3-dummy-img-alt-repl (`*' by default) if the image's height and width are both less than w3-min-img-size pixels (15 by default) and if the filename matches the w3-dummy-img-re regular expression. Otherwise, w3-default-image-alt-func returns the filename enclosed in a `[]' pair.

Emacs/W3 will expect the standard icons to be in the format specified by w3-icon-format. This is gif by default, but could be xpm, xbm or any other format for that matter. It is added as a file extension to the icon name, but the variable's value must be a symbol. If nil, then the server decides.

You can choose whether Emacs/W3 retrieves images with the document, or delays loading them by setting w3-delay-image-loads. By default this is t if you compiled XEmacs with support for gifs, jpegs, pngs or imagick and nil otherwise.

w3-image-mappings controls the mapping of MIME types to image types for the `image' package. Each entry is a cons cell of a MIME type string and an image-type symbol.

Emacs/W3 will split menus into smaller submenus if they are longer than w3-max-menu-length.

The maximum width of a pulldown menu choice.

Emacs/W3's right margin is controlled by w3-right-margin. This is subtracted from (window-width) for each Emacs/W3 buffer and used as the fill-column. It is 2 by default.

The maximum length of a line. If nil (the default) then lines can extend to the window margin.

You can specify the modeline to use in `w3-mode' by setting this.

If this is non-nil (the default) then Emacs/W3 will let a document specify a CSS stylesheet.

Emacs/W3 will ignore a document's attempts to define certain colours if w3-user-colors-take-precedence it non-nil. The default is nil.

Emacs/W3 will ignore attempts by stylesheets or font tags to change certain fonts if this is non-nil.

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

3.8.1 Asynchronous behaviour

  • url-be-asynchronous If this is non-nil then document retrievals over HTTP will be down in the background.

  • url-default-retrieval-proc This controls what happens when an asynchronous retrievel completes. It is url-default-callback by default but can be any function taking one argument. The argument specifies the file that has been retrieved. If there is no buffer associated with the file, then url-default-callback just puts a message in the minibuffer saying that the retrieval is complete, otherwise the action depends on the buffer.

  • w3-do-incremental-display Emacs/W3 can de incremental display of pages if w3-do-incremental-display is t. It is nil by default.

  • w3-notify You might want Emacs/W3 to notify you discreetly when it has finished preparing a page for your reading pleasure. You can control Emacs/W3's behaviour in this situation by way of the w3-notify variable. It may take the following values:
    Puts the Emacs/W3 page in its own frame.
    Make the Emacs/W3 page the current buffer and only window.
    Make the Emacs/W3 page the current buffer in the same window. This is the default.
    Make the Emacs/W3 page the current buffer in the other window.
    Display the Emacs/W3 page in the other window, but don't make it the current buffer.
    Don't display Emacs/W3 page, but print a message when ready and beep.
    The same as polite, but don't beep.
    Make no indication that the page is ready, in fact any other value is equivalent to meek.

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

    This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html