From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.devel Subject: Re: save-excursion and the mark Date: Wed, 25 Feb 2015 14:05:30 +0100 Message-ID: <54EDC89A.8000001@online.de> References: <54ECA136.60004@online.de> <54EDB6E2.70602@online.de> <87ioeq2mpl.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1424868966 13005 80.91.229.3 (25 Feb 2015 12:56:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Feb 2015 12:56:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 25 13:55:57 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 1YQbVE-00042J-GJ for ged-emacs-devel@m.gmane.org; Wed, 25 Feb 2015 13:55:48 +0100 Original-Received: from localhost ([::1]:53998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQbVC-0005gh-EY for ged-emacs-devel@m.gmane.org; Wed, 25 Feb 2015 07:55:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQbUh-0005Y2-Ew for emacs-devel@gnu.org; Wed, 25 Feb 2015 07:55:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQbUb-0007lw-6w for emacs-devel@gnu.org; Wed, 25 Feb 2015 07:55:15 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.24]:53028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQbUa-0007jZ-V4 for emacs-devel@gnu.org; Wed, 25 Feb 2015 07:55:09 -0500 Original-Received: from [192.168.178.32] ([77.12.85.221]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0MTxmj-1Xztgu42hF-00QjIu for ; Wed, 25 Feb 2015 13:55:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: <87ioeq2mpl.fsf@violet.siamics.net> X-Provags-ID: V03:K0:bfW5SoKxCUfKl4V6S9D0FBGMPFHYQheG8TZKPgWhonfP2xIiwxs eHG6/JFzTPjki2eFRMaNj+o9YuYdNRjPR0+tYjwWJnRYpjjQPz1ezQwM4sl0+L3uNcuh6N+ YAXA43t0XFR1YLCMvXyaRDp/r5DnzVcNzuRlsmyTT4UWnL97rmyzsV/a7o+LNE6tPGRndjK 6M1GSzYsthsjwzl7b7Cag== 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.24 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:183492 Archived-At: On 25.02.2015 13:35, Ivan Shmakov wrote: >>>>>> Andreas Röhler writes: >>>>>> On 25.02.2015 03:59, Stefan Monnier wrote: > > >>> See for example indent-code-ridigly. > > >> Can you give more details about how this requires save&restore of > >> the mark (or its "active" status)? > > > Think a shifting code by TAB in python-mode. > > FWIW, python.el doesn’t seem to use the mark. > > > Mark might exist somewhere in line. Shifting will use its own region > > – but original region should be restored – if any. Shifting by > > itself should not create a region nor clutter the mark-ring. > > There seem to be a misunderstanding; the notion of /Emacs Lisp/ > region is different to that of /Emacs/ region, the former being > (more or less) a way of saying “from here to there”, and > does /not/ (generally) involve either mark or point. > > For instance, indent-code-ridigly can be used from Lisp like: > > (indent-code-ridigly 13 37) > > Or perhaps: > > (when-let ((here (re-search-backward "START" nil t)) > (there (re-search-forward "END" nil t))) > (indent-code-ridigly here there)) > > With the common idiom being: > > (let ((save (point))) > ; Move point forward, by some amount. > (indent-code-ridigly save (point))) > > As should be obvious, the mark is /not/ involved in either case. > And, arguably, it /should not/ be. > > […] > > > commit b1d6ddd44614c84746f5ee494e1f29cd9be8a2d8 > > > Notable changes to goto-line, i. e. calling push-mark. > > That makes a point, indeed: there’s a class of Emacs commands > intended first and foremost for interactive use. Naturally, > goto-line is one of them; to quote its docstring: > > This function is for interactive use only; > in Lisp code use `forward-line' instead. > > The proposed change to save-excursion would expose the bugs in > the code which uses such commands inside of save-excursion, > which now masks the unfortunate side-effects of such (mis)use. > Okay, thanks. Andreas