If you're using mod_rewrite functionality, then the urls generated by cms_selflink will have the alias in them.
However, if you want to modify the default functionality for url generation, look at GetURL in lib/classes/class.content.inc.php. Almost all URLs in the system are generated from that method.