Define __file__ when we %edit a real file.

Closes gh-2765.
Merge pull request #2766 from bfroehle/edit_file_attribute

Define __file__ when we %edit a real file.