Here are some functions to cycle through user's buffers:
(defun xah-next-user-buffer () "Switch to the next user buffer. (buffer name does not start with “*”.)" (interactive) (next-buffer) (let ((i 0)) (while (and (string-equal "*" (substring (buffer-name) 0 1)) (< i 20)) (setq i (1+ i)) (next-buffer)))) (defun xah-previous-user-buffer () "Switch to the previous user buffer. (buffer name does not start with “*”.)" (interactive) (previous-buffer) (let ((i 0)) (while (and (string-equal "*" (substring (buffer-name) 0 1)) (< i 20)) (setq i (1+ i)) (previous-buffer))))
And here are some functions to cycle through Emacs buffers:
(defun xah-next-emacs-buffer () "Switch to the next emacs buffer. (buffer name that starts with “*”)" (interactive) (next-buffer) (let ((i 0)) (while (and (not (string-equal "*" (substring (buffer-name) 0 1))) (< i 20)) (setq i (1+ i)) (next-buffer)))) (defun xah-previous-emacs-buffer () "Switch to the previous emacs buffer. (buffer name that starts with “*”)" (interactive) (previous-buffer) (let ((i 0)) (while (and (not (string-equal "*" (substring (buffer-name) 0 1))) (< i 20)) (setq i (1+ i)) (previous-buffer))))
The next step will be to set some custom shortcuts.
Courtesy of ErgoEmacs.