# HG changeset patch # User Richard M. Stallman # Date 839971503 0 # Node ID d0a061b594a1aa99607416e13a8b535233e0cae1 # Parent 4bc8e911988395952d5594d56e094916dc4be1a6 Show how to reorder buffers. diff -r 4bc8e9119883 -r d0a061b594a1 lispref/buffers.texi --- a/lispref/buffers.texi Tue Aug 13 18:29:36 1996 +0000 +++ b/lispref/buffers.texi Tue Aug 13 21:25:03 1996 +0000 @@ -646,10 +646,23 @@ "buffer.c" "*Help*" "TAGS") @end group @end example +@end defun -This list is a copy of a list used inside Emacs; modifying it has no -effect on the ordering of buffers. -@end defun + The list that @code{buffer-list} returns is constructed specifically +by @code{buffer-list}; it is not an internal Emacs data structure, and +modifying it has no effect on the order of buffers. If you want to +change the order of buffers in the list, here is an easy way: + +@example +(defun reorder-buffer-list (new-list) + (while new-list + (bury-buffer (car new-list)) + (setq new-list (cdr new-list)))) +@end example + + With this method, you can specify any order for the list, but there is +no danger of losing a buffer or adding something that is not a valid +live buffer. @defun other-buffer &optional buffer visible-ok This function returns the first buffer in the buffer list other than