reddit / emacs

how to customize buffer order

DiamondDemon669 · 2022-04-13 01:31
So I have this system with three windows, window A, B and C, and window A opens files, window B is for testing/running/research and window C has dired to mess around with files. each of them has buffers it opens and buffers it should be opening. I want to customize the buffer order (the thing C-x LEFT and C-x RIGHT cycle through) so window A only opens files, window B only opens a language shell (typically python), a terminal or eww and window C only opens dired for example the two shortcuts should cycle like this ``` *scratch* *Messages* *GNU Emacs* buffer buffer *Python* *ansi-term* *eww* buffer buffer *dired* buffer buffer file A file B file C ``` with the buffer buffers being buffers between buffers to signal to me not to pass it when cycling through buffers. the problem is I cant fix the order in place and there are always buffers getting stuck between the ones I need to cycle through
lawlist · 2022-04-13 04:11
To customize buffer order, you will need to manage buffers separately / apart from the internal Emacs method of organization; i.e., maintain your own separate buffer list -- checking for buffers at are no longer alive and remove them. The buffers can be organized by frame. Alp Aker has a nice library `frame-bufs` that demonstrates how to separate the internal lists from a custom list, and also organize it by frame. The internal global list and internal frame-local list are constantly changing and you cannot attempt to control their order.
fiverniner · 2022-04-13 04:29
Sounds like you want this: https://github.com/bmag/emacs-purpose
DiamondDemon669 · 2022-04-13 14:37
Thanks! I saw it before and installed it, but I couldnt figure out what it did it so I just left it there. the require directive was already in .emacs and every search I did about it pointed towards it. I was just oblivious