WThreeMTabsAndDisplayModes

Emacs-w3m supports asynchronous operations on as many tabs, buffers, windows and frames that your cpu can handle. And they can be organized in several different ways.

Display Modes

There exist five display modes for emacs-w3m when called interactively: Plain, Tabbed, Dual-Pane, Dedicated-Frames, and Tabbed-Dedicated-Frames. When emacs-w3m is run in batch mode or non-interactively, only the Plain or Tabbed display modes are available. In the past, these modes had been set by a combination of three variables, ‘w3m-use-tab’, ‘w3m-pop-up-windows’ and ‘w3m-pop-up-frames’, but can now be set with this single setting ‘w3m-display-mode’. When this variable is set, the other three are ignored. Interactively, you can control this setting by M-x w3m-display-mode.

PLAIN

Each emacs-w3m buffer exists on its own and can appear in any window in any frame, although a reasonable attempt will be made to re-use an existing window. There is no tab bar. In the past, this had been set by the combination: ‘w3m-use-tab’ nil, ‘w3m-pop-up-windows’ nil, and ‘w3m-pop-up-frames’ nil.

TABBED

A reasonable attempt is made to keep only one window displaying emacs-w3m buffers. That window has a cliackable tab bar along the top. Users can manually subvert this by explicitly opening an emacs-w3m buffer in any number of other windows. In the past, this had been set by the combination: ‘w3m-use-tab’ t ‘w3m-pop-up-windows’ ignored, and ‘w3m-pop-up-frames’ nil.

DUAL-PANE

Once more than one emacs-w3m buffer exists, a reasonable attempt is made to present emacs-w3m in two windows on the same frame. Any action to open a new emacs-w3m buffer, such as ‘w3m-goto-url-new-session’ or ‘w3m-search-new-session’ displays the new buffer in the unfocused pane, and transfers focus there. In the past, this had been set by the combination: ‘w3m-use-tab’ nil ‘w3m-pop-up-windows’ t, and ‘w3m-pop-up-frames’ nil.

DEDICATED-FRAMES

Each new emacs-w3m buffer is opened in a new single-window frame. In the past, this had been set by the combination: ‘w3m-use-tab’ nil ‘w3m-pop-up-windows’ ignored, and ‘w3m-pop-up-frames’ t.

TABBED-DEDICATED-FRAMES

Each new emacs-w3m buffer is opened in the same window of the frame from which it was spawned, and is not easily visible to emacs-w3m buffers associated with other frames. The window includes a clickable tab bar along the top. In the past, this had been set by the combination: ‘w3m-use-tab’ t ‘w3m-pop-up-windows’ ignored, and ‘w3m-pop-up-frames’ t.”

Navigating between emacs-w3m buffers

Much of the following is a re-hash of content found in the emacs-w3m InfoMode manual, at node (emacs-w3m) Working with buffers.

From any emacs-w3m buffer, you can issue command w3m-select-buffer (default keybiding: C-c C-s), which will display a popup window listing all open w3m buffers. The display is very user-friendly in that instead of listing a buffer’s emacs name, which would be something like “<w3m>(23)”, it lists just the number followed by the title of the html page that the buffer is displaying. It also adds “(u)” for unread buffers. From that popup window, you can navigate the list and select a buffer to display (press ‘RETURN’ on it), or delete (press ‘d’). ‘q’, or C-g exit the popup buffer without doing anything.

If you don’t want to use the popup window, you can directly navigate to the sequentially next and previous emacs-w3m buffers using w3m-next-buffer and w3m-previous-buffer (C-c C-n and C-c C-p by default) to hop among them.

Another method is w3m-switch-buffer (C-c C-a). That command prompts you for an HTML window title to switch to, and lets you use M-p and M-n keys to navigate a list of available options.

Of course, if you are using a tabbed display mode and have mouse support, you can always just click on a tab …

See the history for this page if you’re interested in some really old (~2003, ~2007) alternative code snippets

A more generic Emacs buffer switching tool, BufferQuickSwitcher, could be used with w3m context too.

Spawning a new buffer

You have a few choices:

1. w3m-goto-url-new-session, bound by default to G. You will then be prompted for a URL, but if your cursor is on a URL, that will be the default.

2. You can explicitly make a copy of the current buffer with w3m-copy-buffer (C-c C-t by default).

3. Here’s a tiny-weeny function to create a new, empty buffer.

 (defun w3m-new-buffer nil
   "Opens a new, empty w3m buffer."
   "As opposed to `w3m-copy-buffer', which opens a non-empty buffer.
 This ought to be snappier, as the old buffer needs not to be rendered.
 To be quite honest, this new function doesn't open a buffer completely
 empty, but visits the about: pseudo-URI that is going to have to
 suffice for now."
   (interactive)
   (w3m-goto-url-new-session "about://"))

Killing a buffer

You have a few choices:

1. The usual emacs command C-x k

2. w3m-delete-buffer, bound by default to C-c C-w.

3. From within the buffer selection popup window (C-c C-s by default), press ‘d’ on a selection.


See Also: WThreeM, CategoryHypermedia