Subject: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its firstelement

From: "Drew Adams" <[email-masked]>
Date: Fri, 12 Apr 2013 10:51:16 -0700

> +    /* `switch-to-buffer' uses (select-window 
> +    (selected-window)) as a "clever"
> +    way to call record_buffer from Elisp

As your quote-marks are no doubt meant to suggest here, there's really nothing
clever about code that relies on behavior that is somewhat obscure.

Why not take away some of the mystery and make the behavior here more
transparent by creating a function whose name suggests it?

(defun record-selected-window-buffer () ; Or `defsubst', if you prefer.
  "Move the buffer of the selected window to the front of `buffer-list'."
  (select-window (selected-window)))