From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: `save-excursion' defeated by `set-buffer' Date: Tue, 15 Mar 2011 11:55:57 -0700 Message-ID: References: <4D792D16.1080900@easy-emacs.de><83y64ksoik.fsf@gnu.org><87aah0j7lf.fsf@rapttech.com.au><19836.48264.656000.373465@gargle.gargle.HOWL><19838.9290.109000.165849@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1300215514 17171 80.91.229.12 (15 Mar 2011 18:58:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 15 Mar 2011 18:58:34 +0000 (UTC) To: "'Stefan Monnier'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 15 19:58:28 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PzZRr-0002Za-Bb for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Mar 2011 19:58:27 +0100 Original-Received: from localhost ([127.0.0.1]:45173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzZRq-0000zb-Pp for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Mar 2011 14:58:26 -0400 Original-Received: from [140.186.70.92] (port=53027 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzZPa-0007qh-UF for help-gnu-emacs@gnu.org; Tue, 15 Mar 2011 14:56:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzZPY-0001Nw-JR for help-gnu-emacs@gnu.org; Tue, 15 Mar 2011 14:56:06 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:43442) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzZPY-0001NV-Bt for help-gnu-emacs@gnu.org; Tue, 15 Mar 2011 14:56:04 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p2FItwAN015039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Mar 2011 18:56:00 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p2FItwqa031749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 15 Mar 2011 18:55:58 GMT Original-Received: from abhmt004.oracle.com (abhmt004.oracle.com [141.146.116.13]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p2FItvJi013825; Tue, 15 Mar 2011 13:55:57 -0500 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 Mar 2011 11:55:57 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcvjQMHbieunBtn3RnWHWkTHn6Y9EgAADItw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-Source-IP: acsmt356.oracle.com [141.146.40.156] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4D7FB63E.0106,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 148.87.113.121 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80143 Archived-At: > > Even if that were true for some very old code, there is no > > reason to bring `set-buffer' into it. > > Of course there is: what I wrote is only true when set-buffer is used. > When it's not used in the save-excursion, then it's actually very > common for that save-excursion to indeed be used to save point "when it's not used in the save-excursion" is not the same thing as "when I don't see it in the `save-excursion' sexp. As I said: > > And even for such a search-and-destroy old code mission, > > looking for `set-buffer' is by no means sufficient, as I'm sure > > you realize. You might as well just look for `save-excursion' > > and check to see if each occurrence really needs to save point. > > > > `set-buffer' is a red herring here - totally. It is neither > > necessary nor sufficient as an indicator of any problem. It > > does not matter what happens during a `save-excursion' excursion > > - it really doesn't. `set-buffer', `jump-off-the-deep-end', > > `go-fly-a-kite', or whatever. It just does not matter. Even if you are worried about `set-buffer' (which you need not be), you won't necessarily find it just by looking for it literally and lexically in the `save-excursion' sexp. But you know this.