Is it possible to place the current buffer at the end of the buffer list without switching buffers in the window? I would like to write a wrapper function for
ibuffer that modifies the buffer list so that the IBuffer buffer is at the end of the list after calling it. The motivation is for the case when working on say
src1.code and then I call
ibuffer and use it to select
src2.code, then the buffer list looks like (most recent at the top)
src2.code *Ibuffer* src1.code . . .
but I would like it to look like
src2.code src1.code . . . *Ibuffer*
In the Emacs manual at https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-List.html, it says that there is a function
bury-buffer that places a buffer at the end of the buffer list. So I was hoping to write a function such as follows to achieve the desired result:
(defun ibuffer-bury-buffer () "Calls `ibuffer` and moves the buffer to the end of the buffer list. Doesn't work!" (interactive) (ibuffer) (bury-buffer))
But it seems that when you call
bury-buffer using the current buffer in the window that it also changes the buffer to the next buffer in the buffer list. Is there anything that can be done to prevent that?