Domanda

I use aquamacs 90% of the time to edit R files with ESS (Emacs Speaks Statistics). In this mode, I find it indispensable to have a split window, C-x 3 C-x 2, such that I can view simultaneously the source code and the R buffer (terminal window). Thus, every time I launch aquamacs, I need to perform the following steps: split the window, select the right one, switch buffer to *R*, go back to the file. How can I save this setup across sessions?

thanks.

È stato utile?

Soluzione

There is C-c C-z (ess-switch-to-end-of-ESS) which does the splitting and switching to the end of ess inferior buffer. I am using it all the time.

Altri suggerimenti

Try this:

(defun open-r-project ()
  (interactive)
  (delete-other-windows)
  (split-window-horizontally)
  (R)
  (ess-change-directory "~/projects/")
  (next-multiframe-window)
  (find-file "~/projects/")
  (previous-multiframe-window)
)

(global-set-key (kbd "C-c r") 'open-r-project)

Note, however, that this is my first LISP function. I have no idea how to make the project dir parameter working. Will try tomorrow. Oh, and note that I'm using SVN version of ESS.

There are a number of packages that do this kind of thing. It seems that layout-restore is probably the closest fit, but you might want to look at all the entries in the Emacs wiki under the "Switching Window Configurations" heading of the Category Windows page.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top