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.
- 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
- 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)
- You can use the command
‘chm-view-file’ to view a CHM file in the browser.
- You can bind the command
‘dired-mode-map’, so that you can view a CHM file that is marked in a dired buffer.
‘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).
- 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.