Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I just downloaded emacs 23.1 for my new snow leopard macbook pro from http://emacsformacosx.com/ and it works like a charm, except...

I have visual customizations in my .emacs, a few lines are extracted here:

(set-background-color "black")
(set-cursor-color "green") (set-default-font "--Lucida Console-normal-r-normal-normal-18--96-96-c-*-iso10646-1")

I also have some key bindings set up, here are a few lines of those

(global-set-key "\C-l" `goto-line)

(global-set-key [(control ?%)] `query-replace-regexp)

The first time I start emacs or open a document with emacs, everything loads perfectly. When I issue a command-N or open another file through finder, a new window opens with the key binding customizations loaded but without the visual customizations (including window size, etc)

I think this has something to do with how emacsclient is being invoked and the emacs server, but despite my avid usage of emacs for development, I'm pretty clueless when it comes to setting up the editor itself outside of .emacs level customization

Here are potential behaviors I would like to achieve when a new window is opened (via command-n or opening a document in finder), in order of preference:

  1. Have the new window create a new emacs process (not just a new buffer) so that I can manage and navigate multiple projects similar to how textmate does it, using one emacs process for each project.

  2. Have those visual customizations be persistent so that each new window loads with the correct sizing, fonts, and colors.

  3. Have each new document open as a buffer within the current active emacs window.

Let me know if you guys can help, thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

OK I figured out how to do this (start a new emacs server for each new file opened and manage your projects that way) from the terminal, I'm sure it would be trivial to get it working from the finder too but since I'm usually in terminal anyway it works for me.

You just add this to your ~/.profile

function emacs-open() {
    /Applications/Emacs.app/Contents/MacOS/Emacs $1 &
}

then when you want to open a file in a new project (emacs server) with all ur frame customizations and .emacs loaded correctly, it's just

$ emacs-open index.php

I know this may seem really obvious to some, but as far as i could tell it's not done for you anywhere when u dl the package from http://emacsformacosx.com/ so hopefully this helps somebody

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.