Carpe diem (Felix's blog)

I am a happy developer

Emacs W3m

This year I switched from vim to emacs. The reason is quite simple, I want to try different things, that’s all. Emacs is a highly configurable editor that you can use it to read emails, chat on irc, read pdf files, or whatever you can imagine. One of the most useful plugin is using emacs-w3m to browse websites.

Install

Emacs-w3m is an old package, luckily the latest package still functions well :D

This installation guide is mac specific, but you can replace the first command to other platform-specific package installer. I use Mac OSX 10.8, and the latest homebrew until May 15, 2013. In your shell, type in the following:

1
2
3
4
5
6
7
8
9
brew install w3m
mkdir -p ~/.emacs.d/vendor
cd ~/.emacs.d/vendor
cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot login
cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m

cd emacs-w3m
autoconf
make

Then, in your .emacs,

1
2
(add-to-list 'load-path "~/.emacs.d/vendor/emacs-w3m/")
(require 'w3m-load)

That’s all you need. :)

emacs-w3m

Other settings

If you want to open url links in w3m from org files, you can use the following setting, reference to emacs wiki post.

1
2
3
4
5
6
7
8
9
10
11
(defadvice org-open-at-point (around org-open-at-point-choose-browser activate)
  (let ((browse-url-browser-function
         (cond ((equal (ad-get-arg 0) '(4))
                'browse-url-generic)
               ((equal (ad-get-arg 0) '(16))
                'choose-browser)
               (t
                (lambda (url &optional new)
                  (w3m-browse-url url t)))
               )))
    ad-do-it))

If you want more from emacs-w3m, check out EmacsWiki: emacs-w3m.

Comments