GNU bug report logs - #14191
24.3.50; (buffer-list) returns list with non-current buffer as its first element

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Fri, 12 Apr 2013 12:39:03 UTC

Severity: normal

Merged with 14415

Found in versions 24.3.50, 24.3.50.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Stefan Monnier'" <monnier <at> iro.umontreal.ca>, "'Joost Kremers'" <joostkremers <at> fastmail.fm>
Cc: 14191-done <at> debbugs.gnu.org
Subject: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its firstelement
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)))






This bug report was last modified 12 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.