Install the Emacs binary Emacs W64 (64-bit only)
You can unpack the tarball wherever you want; I chose C:\.
That's all what's needed, now run C:\emacs-21.3\bin\runemacs.exe (either by double-clicking the executable icon, or from the command prompt, both ways work fine).
If you want Emacs to appear in your Start Menu, run C:\emacs\bin\addpm.exe.
Configure Emacs to use packages
Most Emacs packages are written in Emacs Lisp (with the .el file extension), so they are platform independent and will thus work fine on Windows.
Let's say you have a friend using Emacs on any UNIX-like platform.
Just ask her/him for a copy of the folder of the Emacs packages.
(If you don't have any UNIX-like friends, you can also search the Net for Emacs packages. ;-)
Save the folder on your computer as C:\emacs-packages\.
Edit the C:\.emacs file (created automatically the first time you use Emacs).
Add the following lines, so Emacs can find the path to the packages:
An example:
To use the package highlight-current-line.el, add the following lines to .emacs (requires the package to be installed as C:\emacs-packages\highlight-current-line.el):
(require 'highlight-current-line)
;; If you want to mark only to the end of line:
(highlight-current-line-whole-line-on nil)
;; switch highlighting on
(highlight-current-line-on t)
(highlight-current-line-set-bg-color "#dfdfe0")
(highlight-current-line-set-fg-color "#666666")
Exit and run Emacs again, the current line of editing should now be highlighted.
Configure Emacs to different setups depending on Emacs version
Add the following lines to .emacs:
(cond ((< emacs-major-version 21)
;; Emacs 20 customization. (non-existing)
(setq custom-file "~/.emacs20.el"))
((and (= emacs-major-version 21) (< emacs-minor-version 4))
;; Emacs 21 customization, before version 21.4.
(setq custom-file "~/.emacs21.el"))
((< emacs-major-version 22)
;; Emacs version 21.4 or later. (non-existing).
(setq custom-file "~/.emacs21.4.el"))
(t
;; Emacs version 22.1 or later.
(setq custom-file "~/.emacs22.el")))
(load custom-file)
If Emacs hangs (for any reason), type:
C-g
and you should return to life. ;-)
To save a highlighted source code in Emacs as HTML, use htmlize, included in Emacs W32.
Just select a region in any file, type
htmlize-region
and Emacs will create a new buffer with a HTML version of your file, with highlighted text and everything.