From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: with-current-buffer (was: fit-window-to-buffer) Date: Mon, 27 Jun 2005 12:46:18 -0400 Message-ID: References: <87aclcu3vy.fsf@jurta.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1119892552 15886 80.91.229.2 (27 Jun 2005 17:15:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Jun 2005 17:15:52 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 27 19:15:44 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DmxCZ-0004aL-5J for ged-emacs-devel@m.gmane.org; Mon, 27 Jun 2005 19:15:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DmxKF-00011a-2w for ged-emacs-devel@m.gmane.org; Mon, 27 Jun 2005 13:23:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DmxIX-0000Rl-Di for emacs-devel@gnu.org; Mon, 27 Jun 2005 13:21:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DmxIW-0000RP-Pp for emacs-devel@gnu.org; Mon, 27 Jun 2005 13:21:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DmxAc-0007ej-RS for emacs-devel@gnu.org; Mon, 27 Jun 2005 13:13:18 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dmwq6-00079c-FS for emacs-devel@gnu.org; Mon, 27 Jun 2005 12:52:06 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DmwkU-0005IZ-4R; Mon, 27 Jun 2005 12:46:18 -0400 Original-To: Juri Linkov In-reply-to: <87aclcu3vy.fsf@jurta.org> (message from Juri Linkov on Mon, 27 Jun 2005 02:33:05 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39668 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39668 (defun test () (interactive) (set-buffer "a") (with-current-buffer "c" (pop-to-buffer "b")) (message "%s" (buffer-name (current-buffer)))) (test) At the end, it print "a" as the current buffer name, but actually this command makes the buffer "b" current. Shouldn't it print "b"? with-current-buffer is supposed to restore the previous current buffer. That is buffer a. This command does not make buffer b current. However, the main loop does that, because b is the selected window's buffer. The results are correct; I see no bug here.