Updated code to be similar to 'emacs-for-python'.

I could never get 'Pymacs' to install and function properly on Linux,
but I noticed that the version distributed by 'emacs-for-python',
https://github.com/gabrielelanaro/emacs-for-python, worked just fine. So
I have taken those modifications, to the best of my knowledge, and
applied them here.