MapaDoSite ModificaçõesRecentes Notícias SeçãoElisp HowTo

ChmView

What's is ChmView

ChmView is a mode to view CHM files in Emacs.
It is based on “archmage”.
(archmage is a program that acts as HTTP server on specified port number, so you can read CHM file with your favorite browser.)
And ChmView integrates “archmage” with Emacs, you can use emacs-w3m (or any browser you like) to browse a CHM file.

Install

ChmView is based on archmage(1) so make sure you have it installed on your system. On a Debian-based OS :
sudo aptitude install archmage
Put Lisp:chm-view.el in your load-path, and add
(require ‘chm-view)
in ~/.emacs

Setup

I recommend you install emacs-w3m, and setup the variable ‘browse-url-browser-function’ with the value ‘w3m-browse-url’, then you can view a CHM file in Emacs! Like below:
(setq browse-url-browser-function ‘w3m-browse-url)

Usage

You can use the command ‘chm-view-file’ to view a CHM file in the browser.
You can bind the command ‘chm-view-dired’ with ‘dired-mode-map’, so that you can view a CHM file that is marked in a dired buffer.

Note

Because ‘archmage’ needs time to extract the CHM file, the browser (such as emacs-w3m) might open a special port before the ‘archmage’ extract is completed. If this occurs, you will get an error: “Cannot retrieve URL: http://localhost:531560 (exit status: 0)”. Just refresh the current page to fix this issue.
If you always get this error when opening a CHM file, you need to set ‘chm-view-delay’ to a larger number (default is 0.3 seconds).

Customize

All above setup can customized using
M-x customize-group RET chm-view RET
The delay time before view CHM file.
This is necessary spend time start sub-process.

Screenshot

ChmView_Screenshot