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


Message #22 received at 14191-done <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'martin rudalics'" <rudalics <at> gmx.at>
Cc: 'Joost Kremers' <joostkremers <at> fastmail.fm>, 14191-done <at> debbugs.gnu.org,
	'Stefan Monnier' <monnier <at> iro.umontreal.ca>
Subject: RE: bug#14191: 24.3.50;
	(buffer-list) returns list with non-current buffer as its firstelement
Date: Sat, 13 Apr 2013 08:08:36 -0700
> > Why not take away some of the mystery and make the behavior 
> > here more transparent by creating a function whose name
> > suggests it?
> 
> `record-window-buffer' ?

;-)

I wasn't aware of it.  I was just basing my off-the-cuff suggestion on what the
code was apparently trying to do here.

But `record-window-buffer' is apparently quite a bit more than just
(select-window (selected-window)).

Should `record-window-buffer' be used in its place at this occurrence?  If not,
should another function be defined to do only (select-window (selected-window))
- essentially an alias to better communicate the intention?

You're the expert here, not I.  My feeling is just that using (select-window
(selected-window)) to take advantage of a less-than-obvious side effect is
obfuscating, not clever or wise.

Without an informative alias for this action, the code really needs to be
commented to indicate the unobvious intention/effect, at the least.  But is
probably better to have a function name & doc string communicate this than code
comments and bug reports.





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

Previous Next


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