Developed by codermattie
Buffer Ring creates rings of buffers. Cycling within a buffer-ring switches to the next buffer in the ring until it wraps around. It does not use the buffer LRU list so the buffers within a ring are always the same until you add or delete buffers from them.
This project was inspired by MTorus. I tried MTorus but it was far too complex for my tastes. The generality complicated the interface, and the code was a labyrinth of hooks.
In essence I wanted a ring, not a Dyson’s Sphere ☺
This implementation is simple, a couple of files massing only 500+ lines.
Here are the buffer-ring commands:
global ring (torus) rotation
If it is too simple for you I suggest MTorus. I will definitely not add mark rings. set-mark-command-repeat-pop works well enough for me.
This is a work in progress. The major functions have been completed. There may still be some bug hunting and polishing left. I welcome anyone to try it.
please contact me with problems or suggestions codermattie.
Version 0.1.0 2011-03-26
complete the interface by adding a function to delete buffer rings from the global torus
Version 0.1.1 2013-10-29
major bug-fixes in both the dyn-ring implementation in insert and buffer-ring fixes to id buffers by a unique id embedded in the buffer instead of the name of the buffer which is subject to change.
Moving to Git. The buffer-ring stuff now works really well for me even on large numbers of buffers. I have loaded 50-60 buffers or so and not had a problem.
One nagging issue is handling perl. I put a buffer-ring-add on a cperl buffer hook and for some reason it drives me insane by trying to add twice. I think it has something to do either with cperl strangess (whoda thunk it ?) or some weird lingering trace of perl-mode.
This is great, a simpler MTorus. But what would be greater is integration with ibuffer. ibuffer can filter buffers according to rules, it would be good if I could create buffer rings from such ibuffer groups. Also, There is no completion on buffer add/delete. Could you put these files on github (or somesuch) so I could contribute if needed, thanks. --CH
Ok, I’ve Tried using Buffer-Ring with Espect with some sucess:
; start buffer-ring with espect filtering (require 'espect) (require 'buffer-ring) (setq espect-buffer-settings '(((:mode "eshell-mode") (:mode "term-mode") (lambda () (buffer-ring-add "term"))) ((:mode "org-mode") (lambda () (buffer-ring-add "ORG"))) ((:mode "emacs-lisp-mode") (lambda () (buffer-ring-add "elisp"))) ((:mode "c-mode") (lambda () (buffer-ring-add "C-SRC"))) ((:mode "python-mode") (lambda () (buffer-ring-add "Python-SRC"))) ((:mode "dired-mode") (lambda () (buffer-ring-add "dired"))) ((:name "^\\*scratch\\*") (lambda () (buffer-ring-add "emacs-regular"))) )) ; this needs to be done specially (save-excursion (switch-to-buffer "\*Messages\*") (buffer-ring-add "emacs-regular")) ; don't show welcome message (setq inhibit-splash-screen t) ;; It might be better just to use the ;; filters, and to run all current ;; buffers through it once espect starts.
I have considered your suggestion. I would very much like to make it work better for people and work with other coders. I will consider a way to do that now. I do not have hesitation only constraints on time etc…