This is how you set default applications..
Point and click:
Right click on the text file you want to open, choose Properties and then Open with. You should find Emacs in the Recommanded Software list. Click the Set as default button.
Using the commandline:
If you want to set default applications using the terminal, you use to XDG tool.
xdg-mime default emacs23.desktop text/plain
Then try to open a plain text document.
If you want to set default applications for the current user, edit this file:
To edit global settings by hand, see this file:
Edit: Thanks to Oli how made me aware of XDG in the comments below the question