From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-15?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.devel Subject: Re: save-excursion and the mark Date: Mon, 20 Apr 2015 08:31:04 +0200 Message-ID: <55349D28.8090304@online.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1429511511 11266 80.91.229.3 (20 Apr 2015 06:31:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2015 06:31:51 +0000 (UTC) Cc: Magnar Sveen , Daniel Colascione , Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 20 08:31:42 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Yk5F6-0003wr-2O for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2015 08:31:40 +0200 Original-Received: from localhost ([::1]:51973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk5F5-00011E-89 for ged-emacs-devel@m.gmane.org; Mon, 20 Apr 2015 02:31:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk5Et-0000xc-TB for emacs-devel@gnu.org; Mon, 20 Apr 2015 02:31:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yk5Eq-0007yO-N2 for emacs-devel@gnu.org; Mon, 20 Apr 2015 02:31:27 -0400 Original-Received: from mout.kundenserver.de ([212.227.17.13]:57743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yk5Eq-0007y1-Bi for emacs-devel@gnu.org; Mon, 20 Apr 2015 02:31:24 -0400 Original-Received: from [192.168.178.31] ([95.119.60.142]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0M1XmT-1ZdHG31Gy9-00tUoR; Mon, 20 Apr 2015 08:31:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: X-Provags-ID: V03:K0:WxDimXh1LE/djjnyS72BCIGFfTQeK4ytFrO4zBIIgJOr7k6J3RI gwcCZDSDZl+y3D3xJ2hqPFXq1+GzQYi12Qrqi9xPEH/56+phtLkwx7n/E9DJSfvct6s7P0A 2FnYrd3wmGcF6d9gppKhM8DBUvuSZqptrERmMN/WMcDgA6XGjkGNpYOky2lAtDhagKTWYfZ UV4xrISBynlwqJ3yxcpCQ== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.13 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:185689 Archived-At: Hi Stefan, Am 14.04.2015 um 22:16 schrieb Stefan Monnier: >> If you are indeed going forward with this change (why is that?), > There are various problems with the previous save-excursion semantics, > all linked to the mark-saving part of it, and this part is useless in > 98% of the cases, useful in 1%, and harmful in 1%, so it's better to get > rid of it in my view. > > Among the various problems, I actually fixed some recently (before > throwing out the code), but the remaining ones are ugly: > saving/restoring the mark includes saving/restoring the mark-active > state as well, and in the general case you'd also want to run the > (de)activate-mark-hook, which could break even more uses of > save-excursion which never expected it to run such hook code. Understand the wish to simplify things in this context. AFAIU there is some redundancy - what about deprecating explicit setting of mark-active? Its documentation says: Non-nil means the mark and region are currently active in this buffer. Maybe conceive region-active-p just as non-nil extend between point and mark - returning nil in case a mark is not set? Andreas > >> then maybe we could get a save-mark function? > Since you're the only user so far, better write explicitly the exact > saving/restoring you need (especially since it's not obvious to me what > it is you really need, I guess you could start with something along the > lines of (cl-letf (((mark)) (mark-active mark-active)) ...)). > > > Stefan > >