Use with-current-buffer.
Add my name.
Require Emacs 21 or later.  Drop support for XEmacs and Emacs <=20.
Use buffer-substring-no-properties.