Juri Linkov writes: > Thanks for your patch. Generally it works correctly, with few exceptions: > > 1. The function `buffer-list' returns a list of buried buffers in reverse > order. In the frame parameter `buried_buffer_list' the most recently > buried buffer is first, so `buffer-list' misses a Fnreverse on `prevlist'. Fixed. > 2. Since `last-buffer' is a general function, I suggest to move it to > simple.el. Done. > 3. Could you create a separate function from lambda which is now let-bound > in `last-buffer'? It could be named, for example, as `get-next-valid-buffer'. Done. New patch attached below.