More Emacs and Python

Fun times on Christmas vacation!  What better time to get my Emacs environment working the way I want it?  I’m going too try to keep it really simple this time.  I’m going to get Rope, Pymacs, and Ropemacs to start with, and maybe these will be all I need for now.

First, I create a .emacs file in my home directory.  I will fill it in as I go, and will include the final version when it’s complete.  All that’s in it now is a line that says: (add-to-list 'load-path "~.emacs.d/").  Also create a directory called .emacs.d. I had both of these things before, but deleted them and am starting from scratch because I had issues that I couldn’t solve.

1. Rope:  downloaded from Sourceforge repository (Rope version 0.9.2).  From terminal, ran setup.py with build, then install options.  (for help, run setup.py –help-commands)

2. Pymacs:  downloaded from Pymacs archives (Pymacs version 23).  From terminal, ran the setup.py file with the build and install options again.  I just put my .emacs.d/ directory in my emacs load-path (above), and then put the pymacs.el file in there.  The Pymacs website suggests byte compiling for speed, which isn’t too complicated:  just open emacs, type M-x byte-compile-file RETpymacs.el RET.

3. Ropemacs:  Last time I did this, I used the source repository on Bitbucket, but this time I just downloaded from the Sourceforge site (same as Rope, just scroll down).  I installed the same way as for Rope and Pymacs using the setup.py script.

Final .emacs file:
[sourcecode]
(add-to-list ‘load-path "~.emacs.d/")
(autoload ‘pymacs-apply "pymacs")
(autoload ‘pymacs-call "pymacs")
(autoload ‘pymacs-eval "pymacs" nil t)
(autoload ‘pymacs-exec "pymacs" nil t)
(autoload ‘pymacs-load "pymacs" nil t)
(require ‘pymacs)
(pymacs-load "ropemacs" "rope-")
[/sourcecode]

And that’s it for now…Hopefully this will work for me. Maybe I’ll add Yasnippets eventually, but I don’t think I really have a need for that yet.

6 thoughts on “More Emacs and Python

  1. What I’ve actually taken to doing is carrying a flash drive around for other computers (when I’m stuck without access to my netbook) that runs a copy of emacs 23 from there. It temporarily copies the .emacs file to the %appdata% folder after backing up an existing copy. My installation anywhere!

  2. I created a little batch script to do the housekeeping for me. I am away from my primary computer at the moment, but when I get back I’ll zip up what I have and point a link your way. Maybe you’ll even have suggestions I can use to improve the implementation!

  3. Here’s the promised link:

    http://filehost.revealedsingularity.net/portable_emacs_windows.7z

    Just edit “EDITME.emacs” to your heart’s content (but be careful about changing the way the directory structures are laid out). Put any .el files into emacs.d, but when autoloading them in the .emacs file refer to them in ~/elisp/[…] (for compatibility).

    runemacs.bat runs the whole thing, starting with backing up any elisp directory and any existing .emacs file, launching runemacs.exe, then when you exit, pressing any key will clean up and restore the original configuration.

  4. oh wow – I just read your last comment and realised that the batch file runs on Windows… I am doing most of this stuff on my own computer, which is currently running Ubuntu. But my work computer runs Windows, I’ll have to give it a try on that.

  5. Yeah — I mean, you can largely do the same thing by writing a shell script for nix, but I’ve not gotten around to it. It so happens most computers of people I know (and my primary production machine) are Windows, though my laptop is Ubuntu.

Leave a Reply to Philip Kahn Cancel reply

Your email address will not be published. Required fields are marked *