From unknown Thu Aug 14 20:53:19 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#14191 <14191@debbugs.gnu.org> To: bug#14191 <14191@debbugs.gnu.org> Subject: Status: 24.3.50; (buffer-list) returns list with non-current buffer as its first element Reply-To: bug#14191 <14191@debbugs.gnu.org> Date: Fri, 15 Aug 2025 03:53:19 +0000 retitle 14191 24.3.50; (buffer-list) returns list with non-current buffer a= s its first element reassign 14191 emacs submitter 14191 Joost Kremers severity 14191 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 08:38:27 2013 Received: (at submit) by debbugs.gnu.org; 12 Apr 2013 12:38:27 +0000 Received: from localhost ([127.0.0.1]:47054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQdFH-0006rh-KB for submit@debbugs.gnu.org; Fri, 12 Apr 2013 08:38:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49107) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQdF8-0006q0-V4 for submit@debbugs.gnu.org; Fri, 12 Apr 2013 08:38:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQdBK-0007VF-RK for submit@debbugs.gnu.org; Fri, 12 Apr 2013 08:34:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.2 required=5.0 tests=BAYES_05,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID,USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:46470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQdBK-0007VB-Ol for submit@debbugs.gnu.org; Fri, 12 Apr 2013 08:34:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQdBI-0006D4-TX for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2013 08:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQdBG-0007US-Ua for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2013 08:34:16 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQdBG-0007Tu-Pt for bug-gnu-emacs@gnu.org; Fri, 12 Apr 2013 08:34:14 -0400 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 5F03120DBC for ; Fri, 12 Apr 2013 08:34:13 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute2.internal (MEProxy); Fri, 12 Apr 2013 08:34:13 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=Vj/SwaVFb82H+o9lhBCGv2xcIyk=; b=PCtgJJlLv5xpKJGm8Vs5Y Aqd45E4byGCDK0e9l1Jwrv4pEPtS36Pq9H1caNuofJC0Ez05MP2qsdMSZb8m3hy1 xlQK2gKGBO47iZkWobHxAp/bhFnPcbIBRZUNqRR68Dsv/pUcvCSF8/qYQsV6flyx qJU+UHlyqmzvN9yBRWtg+Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=Vj/SwaVFb82H+o9lhBCGv2 xcIyk=; b=Ut0WqV+ozLuiRy5zkhS9FbRjmoCvWS/JWBKu1UQB4Pbs31v92wtgQJ ELGBA3OAmNjU+ywBNwWRxmQi7KIajUUJiPan8cwr/tQmdn9GxpYp0DiZr4nCVtLF rzv3IKcvve72Bjs9yPOtbmCzqfym/W3YARJidGPd1SMSwxtuV2NPw= X-Sasl-enc: VU8UAQLpnjhQYaVb0WG5qNuvQzrAU8znv0HBpTuNcobn 1365770052 Received: from Darkstar.messagingengine.com (unknown [24.134.177.133]) by mail.messagingengine.com (Postfix) with ESMTPA id D123C200149 for ; Fri, 12 Apr 2013 08:34:12 -0400 (EDT) From: Joost Kremers To: bug-gnu-emacs@gnu.org Subject: 24.3.50; (buffer-list) returns list with non-current buffer as its first element User-agent: mu4e 0.9.9.5; emacs 24.3.50.1 Date: Fri, 12 Apr 2013 14:34:05 +0200 Message-ID: <87a9p4lygy.fsf@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) (buffer-list) returns a list of buffers, but the first buffer in the list is not the current buffer. Recipe to reproduce: - start Emacs with `emacs -Q' - M-x ielm RET - at the prompt, type (buffer-list) Output (list of buffers wrapped for better readability): ,---- | *** Welcome to IELM *** Type (describe-mode) for help. | ELISP> (buffer-list) | (# # # | # # | # # #) `---- Although the *ielm* buffer is current, the first buffer in the list is the *scratch* buffer. Doing the same thing in an Emacs Debian (Ubuntu) snapshot from a few weeks ago: ,---- | *** Welcome to IELM *** Type (describe-mode) for help. | ELISP> (buffer-list) | (# # # | # # | # # | #) | | ELISP> (emacs-version) | "GNU Emacs 24.3.50.1 (i686-pc-linux-gnu)\n of 2013-03-19 on gold, modified by Debian" `---- Here, the output of buffer-list has the *ielm* buffer as its first element. (Note, I've included the output of (emacs-version) here: this is obviously *not* the version in which the bug occurs. That version is given below.) Note that I'm just using the *ielm* buffer to show the output of (buffer-list). It has nothing to do with the bug itself. Using `M-x eval RET (buffer-list) RET' gives the same result, as does using (buffer-list) in Elisp. (Which is how I ran into the bug: swbuff.el from http://emhacks.sourceforge.net/ stopped working properly. I traced the problem to this changed behaviour of buffer-list.) HTH Joost Kremers In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 3.6.0) of 2013-04-11 on fermium, modified by Debian (emacs-snapshot package, version 2:20130410-1~ppa1~quantal1) Windowing system distributor `The X.Org Foundation', version 11.0.11300000 System Description: Ubuntu 12.10 Configured using: `configure --build i686-linux-gnu --host i686-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.3.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3.50/site-lisp:/usr/share/emacs/site-lisp --without-compress-info --with-crt-dir=/usr/lib/i386-linux-gnu/ --with-x=yes --with-x-toolkit=gtk3 --with-imagemagick=yes CFLAGS='-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' CPPFLAGS='-D_FORTIFY_SOURCE=2' LDFLAGS='-g -Wl,--as-needed -znocombreloc'' Important settings: value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: en_US.UTF-8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: IELM Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x i e l m ( b u f f e r - l i s t ) C-a a C-SPC M-w ( e m a c s - v e r s i o n ) C-SPC M-w C-x C-g M-x e m a c b u r e p o r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set End of buffer Mark set Making completion list... Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode easymenu ielm pp comint ansi-color ring time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) -- Joost Kremers Life has its moments From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 13:37:00 2013 Received: (at 14191-done) by debbugs.gnu.org; 12 Apr 2013 17:37:00 +0000 Received: from localhost ([127.0.0.1]:47646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhuG-0007ic-BS for submit@debbugs.gnu.org; Fri, 12 Apr 2013 13:37:00 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:17383) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQhuC-0007i3-BH for 14191-done@debbugs.gnu.org; Fri, 12 Apr 2013 13:36:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFxIEd/2dsb2JhbABEuzWDWRdzgh8BBScvIxALNBIUGA0kiCTBLZEKA5IgklqBXoMTgUok X-IPAS-Result: Av8EABK/CFFFxIEd/2dsb2JhbABEuzWDWRdzgh8BBScvIxALNBIUGA0kiCTBLZEKA5IgklqBXoMTgUok X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="7278405" Received: from 69-196-129-29.dsl.teksavvy.com (HELO pastel.home) ([69.196.129.29]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Apr 2013 13:32:56 -0400 Received: by pastel.home (Postfix, from userid 20848) id 0479D67B10; Fri, 12 Apr 2013 13:32:58 -0400 (EDT) From: Stefan Monnier To: Joost Kremers Subject: Re: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its first element Message-ID: References: <87a9p4lygy.fsf@fastmail.fm> Date: Fri, 12 Apr 2013 13:32:58 -0400 In-Reply-To: <87a9p4lygy.fsf@fastmail.fm> (Joost Kremers's message of "Fri, 12 Apr 2013 14:34:05 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 14191-done Cc: 14191-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > - start Emacs with `emacs -Q' > - M-x ielm RET > - at the prompt, type (buffer-list) [...] > Although the *ielm* buffer is current, the first buffer in the list is > the *scratch* buffer. I've installed the patch below which should restore the old behavior. Thanks for the nice test case. Stefan === modified file 'src/window.c' --- src/window.c 2013-04-11 16:06:47 +0000 +++ src/window.c 2013-04-12 17:30:35 +0000 @@ -489,7 +489,10 @@ Fset_buffer (w->contents); if (EQ (window, selected_window) && !inhibit_point_swap) - return window; + /* `switch-to-buffer' uses (select-window (selected-window)) as a "clever" + way to call record_buffer from Elisp, so it's important that we call + record_buffer before returning here. */ + goto record_and_return; sf = SELECTED_FRAME (); if (XFRAME (WINDOW_FRAME (w)) != sf) @@ -508,7 +511,10 @@ fset_selected_window (sf, window); select_window_1 (window, inhibit_point_swap); + bset_last_selected_window (XBUFFER (w->contents), window); + windows_or_buffers_changed++; + record_and_return: /* record_buffer can run QUIT, so make sure it is run only after we have re-established the invariant between selected_window and selected_frame, otherwise the temporary broken invariant might "escape" (bug#14161). */ @@ -518,8 +524,6 @@ record_buffer (w->contents); } - bset_last_selected_window (XBUFFER (w->contents), window); - windows_or_buffers_changed++; return window; } From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 13:55:28 2013 Received: (at 14191-done) by debbugs.gnu.org; 12 Apr 2013 17:55:28 +0000 Received: from localhost ([127.0.0.1]:47681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQiC7-0001Cp-Ve for submit@debbugs.gnu.org; Fri, 12 Apr 2013 13:55:28 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:46361) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQiC5-0001CR-3E for 14191-done@debbugs.gnu.org; Fri, 12 Apr 2013 13:55:25 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r3CHpQnw026752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Apr 2013 17:51:27 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3CHpPqL024067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 12 Apr 2013 17:51:25 GMT Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3CHpOZM024054; Fri, 12 Apr 2013 17:51:24 GMT Received: from dradamslap1 (/10.159.167.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 12 Apr 2013 10:51:24 -0700 From: "Drew Adams" To: "'Stefan Monnier'" , "'Joost Kremers'" References: <87a9p4lygy.fsf@fastmail.fm> Subject: RE: 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 Message-ID: <9522B8428A9D4EE2A8029FFE7904D967@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Thread-Index: Ac43o9TRNUhVA0KNScGqvCq7djgrPgAACr2A X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 14191-done Cc: 14191-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > + /* `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))) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 12 15:03:38 2013 Received: (at 14191) by debbugs.gnu.org; 12 Apr 2013 19:03:38 +0000 Received: from localhost ([127.0.0.1]:47756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQjG5-0007EO-GX for submit@debbugs.gnu.org; Fri, 12 Apr 2013 15:03:38 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:59364) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQjG2-0007E0-23 for 14191@debbugs.gnu.org; Fri, 12 Apr 2013 15:03:35 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3ZnT1P0CRyz4KK3J; Fri, 12 Apr 2013 20:59:36 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3ZnT1N6X8VzbbpM; Fri, 12 Apr 2013 20:59:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id jPr0yH2ffsHu; Fri, 12 Apr 2013 20:59:35 +0200 (CEST) X-Auth-Info: hVZ8QzWxhVBMLUZPDahz+QP7VpLbmZRhINaCd/LXAB4= Received: from igel.home (ppp-93-104-148-12.dynamic.mnet-online.de [93.104.148.12]) by mail.mnet-online.de (Postfix) with ESMTPA; Fri, 12 Apr 2013 20:59:35 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id 5596BCA2B4; Fri, 12 Apr 2013 20:59:35 +0200 (CEST) From: Andreas Schwab To: Joost Kremers Subject: Re: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its first element References: <87a9p4lygy.fsf@fastmail.fm> X-Yow: Now my EMOTIONAL RESOURCES are heavily committed to 23% of the SMELTING and REFINING industry of the state of NEVADA!! Date: Fri, 12 Apr 2013 20:59:35 +0200 In-Reply-To: <87a9p4lygy.fsf@fastmail.fm> (Joost Kremers's message of "Fri, 12 Apr 2013 14:34:05 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 14191 Cc: 14191@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Joost Kremers writes: > (buffer-list) returns a list of buffers, but the first buffer in the > list is not the current buffer. Nor is it documented to do so. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 13 04:06:19 2013 Received: (at 14191-done) by debbugs.gnu.org; 13 Apr 2013 08:06:19 +0000 Received: from localhost ([127.0.0.1]:48324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQvTX-0005zO-C2 for submit@debbugs.gnu.org; Sat, 13 Apr 2013 04:06:19 -0400 Received: from mout.gmx.net ([212.227.17.21]:61270) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UQvTU-0005zF-S4 for 14191-done@debbugs.gnu.org; Sat, 13 Apr 2013 04:06:17 -0400 Received: from mailout-de.gmx.net ([10.1.76.29]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LrH2g-1UYsYW10f6-0136Sh for <14191-done@debbugs.gnu.org>; Sat, 13 Apr 2013 10:02:16 +0200 Received: (qmail invoked by alias); 13 Apr 2013 08:02:16 -0000 Received: from 62-47-42-65.adsl.highway.telekom.at (EHLO [62.47.42.65]) [62.47.42.65] by mail.gmx.net (mp029) with SMTP; 13 Apr 2013 10:02:16 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+3C80RhxK3r0vZw1vRbqbUwFNf8r6ZJQN0wMFuIx uFBJ/e5mEr+xpX Message-ID: <51691102.1080803@gmx.at> Date: Sat, 13 Apr 2013 10:02:10 +0200 From: martin rudalics MIME-Version: 1.0 To: Drew Adams Subject: Re: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its firstelement References: <87a9p4lygy.fsf@fastmail.fm> <9522B8428A9D4EE2A8029FFE7904D967@us.oracle.com> In-Reply-To: <9522B8428A9D4EE2A8029FFE7904D967@us.oracle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 14191-done Cc: 'Joost Kremers' , 14191-done@debbugs.gnu.org, 'Stefan Monnier' X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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' ? martin From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 13 11:12:55 2013 Received: (at 14191-done) by debbugs.gnu.org; 13 Apr 2013 15:12:55 +0000 Received: from localhost ([127.0.0.1]:48837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UR28M-0006fm-Ud for submit@debbugs.gnu.org; Sat, 13 Apr 2013 11:12:55 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:33553) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UR28J-0006fR-Vz for 14191-done@debbugs.gnu.org; Sat, 13 Apr 2013 11:12:53 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r3DF8m4i026570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 13 Apr 2013 15:08:49 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3DF8lH3007411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 13 Apr 2013 15:08:47 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r3DF8lFg007408; Sat, 13 Apr 2013 15:08:47 GMT Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 13 Apr 2013 08:08:47 -0700 From: "Drew Adams" To: "'martin rudalics'" References: <87a9p4lygy.fsf@fastmail.fm> <9522B8428A9D4EE2A8029FFE7904D967@us.oracle.com> <51691102.1080803@gmx.at> 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 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <51691102.1080803@gmx.at> Thread-Index: Ac44HexNQdIuv2lOT264tmCbHuBSuAAOYDmg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -3.9 (---) X-Debbugs-Envelope-To: 14191-done Cc: 'Joost Kremers' , 14191-done@debbugs.gnu.org, 'Stefan Monnier' X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) > > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 14 08:51:15 2013 Received: (at 14191) by debbugs.gnu.org; 14 Apr 2013 12:51:15 +0000 Received: from localhost ([127.0.0.1]:49932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1URMOo-0005K8-S1 for submit@debbugs.gnu.org; Sun, 14 Apr 2013 08:51:15 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59546) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1URMOl-0005Jh-H5 for 14191@debbugs.gnu.org; Sun, 14 Apr 2013 08:51:13 -0400 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 57C5D20A3A; Sun, 14 Apr 2013 08:47:04 -0400 (EDT) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute4.internal (MEProxy); Sun, 14 Apr 2013 08:47:04 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:references:in-reply-to:date:message-id :mime-version:content-type; s=mesmtp; bh=Vp6bn47LTuyLv2ZGTVITb6l YCoo=; b=HLRLwgWyqzRlCw+n80iQJpyzNNhy03CQyTP05HtSoGpWeZ1AascM4NF SHI5Nxe23TSG2cQw6R7qCBLER2N1v8TpS0DzKoYihsggNkhE5XhZ405DxTuQq3eu KlAHrmFq4l12Lf0OS0yL7789GKpeOv8q42U9lIeJxj4uniRdgP60= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:cc:subject:references:in-reply-to :date:message-id:mime-version:content-type; s=smtpout; bh=Vp6bn4 7LTuyLv2ZGTVITb6lYCoo=; b=TKjFVTBlT0ngO01yfDnWs4WMOuLpIqqF5Yz2TU HHwxcjNEU+Pveg03ODnez51y6MO6Lud3ZuTwIqaX5pe6auYcWM0d6RDNwt+KMHvi EQ8TfSKcmqmQ7YCDEZDsID3jFbk9z5G2dDpAmcL+Ck9jeUma2fhiMq0iiNBVf3wO YpcUc= X-Sasl-enc: INs5suwNQ+B4yImuQo4PzRBcIlsg5L/FKJaOC/16oewO 1365943623 Received: from eeenterprise.messagingengine.com (unknown [77.177.28.223]) by mail.messagingengine.com (Postfix) with ESMTPA id 6034A200159; Sun, 14 Apr 2013 08:47:03 -0400 (EDT) From: Joost Kremers To: "Andreas Schwab" Subject: Re: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its first element References: <87a9p4lygy.fsf@fastmail.fm> User-agent: mu4e 0.9.9.5; emacs 24.3.50.1 In-reply-to: Date: Sun, 14 Apr 2013 14:46:53 +0200 Message-ID: <87ppxxe0ua.fsf@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 14191 Cc: 14191@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Fri, Apr 12 2013, Andreas Schwab wrote: > Joost Kremers writes: > >> (buffer-list) returns a list of buffers, but the first buffer in the >> list is not the current buffer. > > Nor is it documented to do so. True, of course. But it seems it has always been the case, so perhaps it should be documented? -- Joost Kremers Life has its moments From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 15 03:15:25 2013 Received: (at 14191-done) by debbugs.gnu.org; 15 Apr 2013 07:15:25 +0000 Received: from localhost ([127.0.0.1]:51330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1URddM-0006b3-S6 for submit@debbugs.gnu.org; Mon, 15 Apr 2013 03:15:25 -0400 Received: from mout.gmx.net ([212.227.17.21]:57685) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1URddH-0006ar-TH for 14191-done@debbugs.gnu.org; Mon, 15 Apr 2013 03:15:21 -0400 Received: from mailout-de.gmx.net ([10.1.76.34]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0Lm9fT-1V0QM11T4T-00Zj7U for <14191-done@debbugs.gnu.org>; Mon, 15 Apr 2013 09:11:08 +0200 Received: (qmail invoked by alias); 15 Apr 2013 07:11:08 -0000 Received: from 62-47-46-238.adsl.highway.telekom.at (EHLO [62.47.46.238]) [62.47.46.238] by mail.gmx.net (mp034) with SMTP; 15 Apr 2013 09:11:08 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19mzS5VW8hmVQlW+rFm9XhdSYvnSJ1DAwahdWub9i LHtUkhBRqOdnOQ Message-ID: <516BA803.3050506@gmx.at> Date: Mon, 15 Apr 2013 09:10:59 +0200 From: martin rudalics MIME-Version: 1.0 To: Drew Adams Subject: Re: bug#14191: 24.3.50; (buffer-list) returns list with non-current buffer as its firstelement References: <87a9p4lygy.fsf@fastmail.fm> <9522B8428A9D4EE2A8029FFE7904D967@us.oracle.com> <51691102.1080803@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 14191-done Cc: 'Joost Kremers' , 14191-done@debbugs.gnu.org, 'Stefan Monnier' X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > But `record-window-buffer' is apparently quite a bit more than just > (select-window (selected-window)). More and less, I think. > 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. As Andreas already remarked, the behavior of Emacs in this regard was never clearly documented. Unfortunately, I don't know more about its "unobvious intention/effect" than you. martin From unknown Thu Aug 14 20:53:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 May 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Fri May 17 11:49:52 2013 Received: (at control) by debbugs.gnu.org; 17 May 2013 15:49:52 +0000 Received: from localhost ([127.0.0.1]:49156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UdMul-0003uO-LR for submit@debbugs.gnu.org; Fri, 17 May 2013 11:49:52 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:47320 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UdMuj-0003uG-RO for control@debbugs.gnu.org; Fri, 17 May 2013 11:49:50 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UdMuT-0006zB-46 for control@debbugs.gnu.org; Fri, 17 May 2013 11:49:33 -0400 Date: Fri, 17 May 2013 11:49:33 -0400 Message-Id: Subject: control message for bug 14415 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) unarchive 14191 forcemerge 14191 14415 From unknown Thu Aug 14 20:53:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 15 Jun 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator