From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: `save-excursion' defeated by `set-buffer' Date: Wed, 23 Dec 2009 23:35:42 -0500 Message-ID: References: <87aaxdqwqv.fsf@regnitz.physics.niu.edu> <876380nvnt.fsf@lola.goethe.zz> <87hbrijbyg.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261629377 8402 80.91.229.12 (24 Dec 2009 04:36:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Dec 2009 04:36:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 24 05:36:10 2009 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 1NNfQn-000772-Sc for ged-emacs-devel@m.gmane.org; Thu, 24 Dec 2009 05:36:10 +0100 Original-Received: from localhost ([127.0.0.1]:35906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNfQo-0003ux-4I for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2009 23:36:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNfQi-0003u8-Kz for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:36:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNfQe-0003p3-33 for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:36:04 -0500 Original-Received: from [199.232.76.173] (port=53599 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNfQd-0003ou-VX for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:35:59 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:56667) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNfQX-0005zp-Lu; Wed, 23 Dec 2009 23:35:53 -0500 Original-Received: from alfajor.home (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nBO4ZhC8030719; Wed, 23 Dec 2009 23:35:46 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id EDE1A6435B; Wed, 23 Dec 2009 23:35:42 -0500 (EST) In-Reply-To: <87hbrijbyg.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 23 Dec 2009 10:07:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3434=0 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:118807 Archived-At: >> Irrelevant: neither example uses (save-excursion (set-buffer ..) ...). > Don't be disingenuous. with-temp-buffer uses with-current-buffer, which > is basically (save-current-buffer (set-buffer ... save-current-buffer != save-excursion This warning is specificaly aimed at reminding people that the two are different, so you clearly need to see this warning a few more times before you start to understand what it's about. >> Obviously "if you didn't want to move point in foo" implies that you did >> not want "to have mark, point, and buffer restored". > I don't see the obviousness. The code I show *does* move point within the save-excursion, so by "didn't move point" I meant the same as your "restore point". Hence the "obviousness". > And even _if_ using save-excursion for saving _both_ buffer and its > point was deprecated (for which I see no good reason whatsoever): as > long as the DOC string of save-excursion does not even _mention_ > save-current-buffer, it is not appropriate to throw warnings at > the user. Fair enough, I've just added a note to the docstring. Stefan