From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Uday S Reddy Newsgroups: gmane.emacs.devel Subject: Re: save-excursion again Date: Sat, 26 Jun 2010 12:03:38 +0100 Message-ID: References: <19483.43525.253000.115910@gargle.gargle.HOWL> <87pqzncc0y.fsf@uwakimon.sk.tsukuba.ac.jp> <87iq5fc4wj.fsf@uwakimon.sk.tsukuba.ac.jp> 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: dough.gmane.org 1277550256 9685 80.91.229.12 (26 Jun 2010 11:04:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 26 Jun 2010 11:04:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 26 13:04:15 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.69) (envelope-from ) id 1OSTBF-0007f7-Re for ged-emacs-devel@m.gmane.org; Sat, 26 Jun 2010 13:04:14 +0200 Original-Received: from localhost ([127.0.0.1]:54159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSTBF-0000Fc-7s for ged-emacs-devel@m.gmane.org; Sat, 26 Jun 2010 07:04:13 -0400 Original-Received: from [140.186.70.92] (port=51532 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSTB9-0000F5-Oe for emacs-devel@gnu.org; Sat, 26 Jun 2010 07:04:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSTB7-0001oP-L5 for emacs-devel@gnu.org; Sat, 26 Jun 2010 07:04:07 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:49642) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSTB7-0001o3-Fd for emacs-devel@gnu.org; Sat, 26 Jun 2010 07:04:05 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OSTB2-0007cC-WF for emacs-devel@gnu.org; Sat, 26 Jun 2010 13:04:01 +0200 Original-Received: from cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com ([92.232.137.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Jun 2010 13:04:00 +0200 Original-Received: from u.s.reddy by cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 26 Jun 2010 13:04:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpc10-harb6-0-0-cust112.perr.cable.virginmedia.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 In-Reply-To: X-detected-operating-system: by eggs.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:126427 Archived-At: On 6/25/2010 10:20 PM, Stefan Monnier wrote: >> Which brings up a question for Stefan. Are you saying that the >> condition-case-save-point-and-mark aspect of `save-excursion' should >> be abstracted out (say as `save-region') and separated from the >> save-buffer aspect? > > Not sure what you mean. If you mean we should introduce > a save-excursion-but-not-buffer, then I think it's a bad idea, because > such a thing would still have to save a marker (so there's no > improvement in terms of the amount of data saved) and the semantics of > "restore point in another buffer" is murky in Emacs. I think the point is that save-excursion has been saving too much. So, when we see a save-excursion in a piece of code, we are not sure whether it was meant to save the point and mark, or the current-buffer, or both. It seems that the original developers were themselves unsure after a while. I took Stephen's point as saying that, if we have separate save-current-buffer and save-region, with save-excursion strongly discouraged, we would promote a clearer programming style. Cheers, Uday