I have two buffers open in emacs next to each other lets call them A,B in that order in the split screen. I have a function that opens a new file (C) and depending on which buffer (A,B) I execute the function in, if executed in A (scenario 1) the buffer will move to the right to be (C,A) and if executed in B (scenario 2), the buffer stays in place (C,B).
I use another function that simply close the new buffer (C) but now the order of the original files will change (B,A) in the first scenario (scenario 1).
Is there a way to include functionality in the (closing function I use) to preserve the original order of files A,B?
t in their place, after done with them another function to close these new two buffers. Is there a way to preserve the order in which the original buffers were in?
Meaning, if they were in this order A,B side to side, after closing the new buffers keep them in that order and not B,A for example.
This solved it:
(setq my-window-conf (current-window-configuration))
....
(set-window-configuration my-window-conf) ;; restore window layout and
;; selected buffers