Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs session / projects / window management

I am working with Ruby on Rails projects most of the time so I need a way to save projects and the state of the buffers/windows I am working on, mostly because I often find myself switching to a different project for a few minutes and then going back to the project I was working on. Desktop.el seems to be very close except for the window configuration saving.

For those familiar with TextMate, I'm looking for something like the textmate project files that you can open and they open a different instance of the editor that only opens the files in that project.

Thanks, Cezar

like image 825
Cezar Halmagean Avatar asked Nov 06 '09 08:11

Cezar Halmagean


1 Answers

I tried to put myself in your shoes and conjure up my preferred Emacs solution. Best I can come up with is that I do occasionally get into a mode where I don't want my windows mucked with by dealing with an Emacs interrupt, one that requires different Emacs resources (buffers/windows). Say for example I have an ediff going on and I want to go to the scratch buffer to test out an idea without mucking with my ediff perspective, to borrow the Eclipse notion. In such a case I generally do C-x 5 2 to bring up a new frame. If I've already got multiple frames up on the monitor I will do C-x 5 f to select a named frame.

In your case, you might have one set of frames with a "proj-x" prefix and another with a "proj-y" prefix. In this case C-x f proj-x-foo provides a quick switch to handle your interrupt C-x f proj-y-fee switches you back. In most cases, I think you talking about two frames, which is even easier: C-x f o to switch between the two frames.

I think the take-home point is that with Emacs, one can "drop" what you're doing without the need to close anything, do something else and then come back to your original environment with little fuss or muss. This is a corollary to the notion that with Emacs you can have hundreds of files open simultaneously, i.e. you do not need to close a file and then open another. Open 'em all and have a ball. :-) And when you embrace this style, C-x s is your friend.

like image 148
pajato0 Avatar answered Sep 24 '22 15:09

pajato0