help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: split buffers


From: AmosBurke
Subject: Re: split buffers
Date: Wed, 08 Dec 2010 15:19:56 -0000
User-agent: G2/1.0

>
> I'm happy doing vulcan deathgrip chords in order to change just
> the buffer in a frame, versus the whole frame full of buffers to
> another frame with different buffers, but I need it all to exist in
> one physical window.
>

There are two commands which seem to  save and restore buffer/window-
configurations in a frame that might suffice for what you want:

window-configuration-to-register  (bound to Control-x r w)  to save
it

and

jump-to-register (bound to Control-x r j)

So if you get a particular buffer/window-configuration set up you can
save it with c-x r w  (you have to then type a number for a specific
register e.g. 1, when prompted)
Then you can set up another buffer/window-configuration and save that
with c-x r w (giving a different register number when prompted)

Then you restore them at any time with c-x r j (and register number
desired at the prompt)

You can simplify the keystroke combinations and typing by adding
something like this to your .emacs file:

(defun SaveWinConfigToRegister1 ()
"save window configuration to register 1"
  (interactive)
  (window-configuration-to-register 1)
)

(defun RestoreRegister1 ()
"restore configuration from register 1"
  (interactive)
  (jump-to-register 1)
)

(defun SaveWinConfigToRegister2 ()
"save window configuration to register 2"
  (interactive)
  (window-configuration-to-register 2)
)

(defun RestoreRegister2 ()
"restore configuration from register 2"
  (interactive)
  (jump-to-register 2)
)


(defun SaveWinConfigToRegister3 ()
"save window configuration to register 3"
  (interactive)
  (window-configuration-to-register 3)
)

(defun RestoreRegister3 ()
"restore configuration from register 3"
  (interactive)
  (jump-to-register 3)
)

; <CTRL-F1> to save window configuation to register 1
(global-set-key (kbd "<C-f1>") 'SaveWinConfigToRegister1)
; <ALT-F1> to restore window configuration saved in register 1
(global-set-key (kbd "<M-f1>") 'RestoreRegister1)
; <CTRL-F1> to save window configuation to register 2
(global-set-key (kbd "<C-f2>") 'SaveWinConfigToRegister2)
; <ALT-F1> to restore window configuration saved in register 2
(global-set-key (kbd "<M-f2>") 'RestoreRegister2)
(global-set-key (kbd "<C-f3>") 'SaveWinConfigToRegister3)
(global-set-key (kbd "<M-f3>") 'RestoreRegister3)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]