I've seen the https://www.emacswiki.org/emacs/buffer-move.el script, but I'm trying to something a bit different. Suppose I have a frame with a buffer from file A.h in it and A.cpp in another frame somewhere else. If I currently have A.h selected and try to open A.cpp from it (using either C-x C-f or projectile open), I would want the frames containing A.h and A.cpp to simply swap buffers with each other. Is there a library or something that already does this? I'm trying to do it myself based on buffer-move.el
, but I can't find any of the hooks I need or the ability to search for a frame containing a buffer with a specific name.
1 Answer
Do you really need the buffers to swap frames? Or would it be enough to just select (move the focus to) the frame of the buffer you want to use?
For that, just C-x 4 b
if pop-up-frames
is non-nil, or C-x 5 b
if it is nil.
frame-bufs
that associate buffers with frames. There is an option to associate or disassociate, or at least there is in my modified version. I have never played with the swapper-oo idea -- instead, I just associate or disassociate whatever buffers I need. I also have adisplay-buffer-alist
function that associates certain file types with specified frames. I've taken it one step further and tied it in with a modified version of tabbar ... associating.move-buffer
is that I need to select the frame with arrow keys (or movement keys if I redo the keybindings), which isn't as fast for me as just opening a file or switching the buffer.ace-window
can swap buffers in windows within the same frame or in different frames -- "How to swap buffers between two frames?": emacs.stackexchange.com/questions/38505/…