From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: `save-excursion' defeated by `set-buffer' Date: Sun, 10 Jan 2010 19:05:55 +0100 Message-ID: <4B4A1703.50104@gmx.at> References: <87ocl8gvcn.fsf@lola.goethe.zz> <558DC61A9B3E4FF89CC53FF9DF7F7709@us.oracle.com> <20100110.105820.347261995.hanche@math.ntnu.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1263146803 2973 80.91.229.12 (10 Jan 2010 18:06:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 18:06:43 +0000 (UTC) Cc: emacs-devel@gnu.org To: Harald Hanche-Olsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 10 19:06:36 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NU2BO-0006Oe-Si for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2010 19:06:35 +0100 Original-Received: from localhost ([127.0.0.1]:38173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU2BP-0005DN-K0 for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2010 13:06:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NU2BL-0005DI-GV for emacs-devel@gnu.org; Sun, 10 Jan 2010 13:06:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NU2BH-0005Cu-Ih for emacs-devel@gnu.org; Sun, 10 Jan 2010 13:06:31 -0500 Original-Received: from [199.232.76.173] (port=35708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU2BH-0005Cr-G2 for emacs-devel@gnu.org; Sun, 10 Jan 2010 13:06:27 -0500 Original-Received: from mail.gmx.net ([213.165.64.20]:60948) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NU2BG-00072H-PU for emacs-devel@gnu.org; Sun, 10 Jan 2010 13:06:27 -0500 Original-Received: (qmail invoked by alias); 10 Jan 2010 18:05:58 -0000 Original-Received: from 88-117-41-209.adsl.highway.telekom.at (EHLO [88.117.41.209]) [88.117.41.209] by mail.gmx.net (mp016) with SMTP; 10 Jan 2010 19:05:58 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX188lTNjHdc8iToBqyf56pe2rYdMhQ/79ryfPheFi7 dl3hjlT0Y7N4Tz User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <20100110.105820.347261995.hanche@math.ntnu.no> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.73 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:119788 Archived-At: > An aside: While reading this discussion I wanted to experiment to > understand the difference between the two forms above. If I execute > the following from a buffer other than *scratch*, the letter A is > inserted four places after point, but point does not move: > > (with-current-buffer "*scratch*" (forward-char 4) (insert "A")) > > However, the doc string for with-current-buffer says nothing about > restoring point. This is confusing. Also, with-current-buffer expands > to save-current-buffer, whose doc string also says nothing about > restoring point. Again confusing. The form above _does_ move `point' unless that's inhibited by other (usually text) properties. If *scratch* is displayed in some window, `point' moves as well but the visible effect is overridden by the fact that `window-point' in any window showing *scratch* does not move (wrt to the surrounding text). So I suppose the behavior you report is a behavior you observed with *scratch* displayed in some window while you executed that form. martin