From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: display-buffer vs. current-buffer vs. post-command-hook Date: Tue, 04 Oct 2016 18:07:18 +0200 Message-ID: <57F3D3B6.7080201@gmx.at> References: <57F3C212.3020401@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1475597390 2750 195.159.176.226 (4 Oct 2016 16:09:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Oct 2016 16:09:50 +0000 (UTC) To: Ami Fischman , "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 04 18:09:47 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brSHo-0000F1-N6 for ged-emacs-devel@m.gmane.org; Tue, 04 Oct 2016 18:09:44 +0200 Original-Received: from localhost ([::1]:44075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brSHn-0004Bu-9i for ged-emacs-devel@m.gmane.org; Tue, 04 Oct 2016 12:09:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brSFj-0002tp-3Z for emacs-devel@gnu.org; Tue, 04 Oct 2016 12:07:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1brSFe-0004HI-0n for emacs-devel@gnu.org; Tue, 04 Oct 2016 12:07:33 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:61545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1brSFd-0004H0-OF for emacs-devel@gnu.org; Tue, 04 Oct 2016 12:07:29 -0400 Original-Received: from [192.168.1.100] ([212.95.7.62]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M1WHV-1b2Npp0ovp-00tPjw; Tue, 04 Oct 2016 18:07:28 +0200 In-Reply-To: X-Provags-ID: V03:K0:+GxzoO9indz0XpTBCZtVs5W1qaKpjdP50aDiDsoTMDBL+GigaG6 TsUe4ot1R1nkNkv/4rSZKR93DS3O488MKhuc6NLgBBbzjQcoWQeOcOMznC/3yVCwWL1XJT1 7LIOKhhfzXkYMEwxTjGjwIteQh14EJ1y6RUFX6cAnMnb5L3BF6PCNX8/PzHZk5DWZZOPQgM u6Gsr4PRGbgxF++Z9vfDw== X-UI-Out-Filterresults: notjunk:1;V01:K0:B3Gvr/aCW/0=:/r0z9FsgdvPsOoyaNteJ/c tChKOmdkB8TlsDsM84Isjdw7dREJXFRKQ9OhtDPg1HmAAihmDpB9AD7W2tdRWXJLXesrFAK+N 7UBB1tdW4qtBEH8i0jTySz1/4VwHvnLa9y4r1HSEDRtUE9VHIXFq+ZZWykchrRba/gz4dleEd SVMcyE0CnqEgAfZLSDpbjmIxu/2y+MgA/rGkscUajhjmQdcSpRUw3iyor2loBvnixixERmM1v T5XcowTu3dEJGGWyoIdI4XFysVrEz48zptGmTzMubQrOMNiwbVDOTZojt3bxotNzvhe8bYUp2 KsZiAGo38AFBgJaHXTZn9+04sy/lAvv77kYhk3qOOnLChO9QAsnu7UXQYyOat+lA2HkzznlLR Eyu2o18LnWibjcAWxP4LCEerSuLvLi6XF3GsBlRYHaP4vzZGuK4tjFNSxnK/zBQkciCnophvT BZLNTpjAKC8N1HUkltfRXfDhd6tM7DuNUsgtOTH19RNa8NIRBHVhfMVXRvZs+m/fmJ2YyEiVC vRIyMkUJJhLbNBEin+yRbFg6BdIkLNQLTFJxQeqjESaBCX+heq/xBQEcSaXov0xSD/k++YMul Sod3h84sptWzy6TkkP2CjeIfLqdXGdaSZm2EHOOeb3mRMKmnmhlTBxq/cydQV9I2FRx+/A6CD givE+YxWcILHDt5oTTjGTCrJu0r3zBGJr7V9I+sYhtF1o/atoMNF980a4YdDDLTB4y4wghf8g fgT6Jj5uW9HIvCvSK4p65t8Jt4ZQVYNABPSHoWpZgfZCAM1dKanSgXHB6HYvgXkLtA8qqOJZ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207982 Archived-At: > I'm sorry but I don't understand your statement. Should there not be an > expectation that (current-buffer)'s return value does not change between > the second and third call in my original snippet? No. The primary concern is that the current buffer must not be changed by `describe-key' or any other function that uses a temporary buffer to display its results. > Put another way, under what circumstances should one expect > current-buffer's return value to be stable in user-written elisp? The current buffer should never be changed by any function, unless it is a purpose of that function to change the current buffer. > Put a third way, what about describe-keys documentation should lead an > elisp author to understand that current-buffer will not reflect its effect > until after a [run-at-time 0]? > (sorry for the barrage of questions; I feel there's a fundamental something > I'm missing in play here and trying to see if you know what it is :)) I suppose you missed the following aspect described in section 26.2 of the Elisp manual entitled "The Current Buffer": When an editing command returns to the editor command loop, Emacs automatically calls `set-buffer' on the buffer shown in the selected window. [run-at-time 0] clearly runs after that. martin