From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.devel Subject: Re: `save-excursion' defeated by `set-buffer' Date: Sun, 10 Jan 2010 10:58:20 -0500 (EST) Message-ID: <20100110.105820.347261995.hanche@math.ntnu.no> References: <87ocl8gvcn.fsf@lola.goethe.zz> <558DC61A9B3E4FF89CC53FF9DF7F7709@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1263139223 12515 80.91.229.12 (10 Jan 2010 16:00:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 16:00:23 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 10 17:00:16 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 1NU0DA-0005Ly-Ds for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2010 17:00:16 +0100 Original-Received: from localhost ([127.0.0.1]:42579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU0DA-0003tl-Ky for ged-emacs-devel@m.gmane.org; Sun, 10 Jan 2010 11:00:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NU0BW-000342-Rh for emacs-devel@gnu.org; Sun, 10 Jan 2010 10:58:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NU0BR-00031Q-MF for emacs-devel@gnu.org; Sun, 10 Jan 2010 10:58:34 -0500 Original-Received: from [199.232.76.173] (port=43509 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NU0BR-00031H-Jh for emacs-devel@gnu.org; Sun, 10 Jan 2010 10:58:29 -0500 Original-Received: from anne.math.ntnu.no ([129.241.15.150]:65123) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NU0BQ-0008Q6-Rn for emacs-devel@gnu.org; Sun, 10 Jan 2010 10:58:29 -0500 Original-Received: (qmail 27362 invoked from network); 10 Jan 2010 15:58:23 -0000 Original-Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.102) by anne.math.ntnu.no with ESMTPA; 10 Jan 2010 15:58:23 -0000 In-Reply-To: X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.3.50 on Emacs 23.1.90 / Mule 6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:119784 Archived-At: + Stefan Monnier : > [...] > (with-current-buffer FOO ...) > [...] > (with-current-buffer FOO (save-excursion ...)) 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. - Harald