Skip to content

More Emacs and Python

January 1, 2010

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 with build, then install options.  (for help, run –help-commands)

2. Pymacs:  downloaded from Pymacs archives (Pymacs version 23).  From terminal, ran the 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 script.

Final .emacs file:

(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-")

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 Comments leave one →
  1. January 1, 2010 9:26 pm

    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. michellejw permalink*
    January 2, 2010 7:49 am

    How did you do that?

  3. January 2, 2010 3:58 pm

    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!

  4. January 3, 2010 1:16 pm

    Here’s the promised link:

    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.

  5. michellejw permalink*
    January 3, 2010 6:10 pm

    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.

  6. January 3, 2010 7:23 pm

    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

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: