For a while now I’ve had a problem where at work we rely heavily on virtualenv and I occasionally want to do things like run pyflakes or run trial from the Twisted installed in that virtualenv. This following activate-virtualenv function appears to be all that is necessary to mimic source virtualenv/bin/activate for Emacs.

Enjoy.