<p>Does emacs have something like vi's “set number”, so that each line starts with its line number?</p>

Take a look at this article. It explains various ways to add line numbers to emacs:
http://www.emacswiki.org/cgi-bin/wiki/LineNumbers