From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Re: Lifting all buffer restrictions in indentation functions Date: Fri, 8 Dec 2017 12:38:33 -0500 Message-ID: References: <83wp1xupqs.fsf@gnu.org> Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114970ec2465da055fd7a9b5" X-Trace: blaine.gmane.org 1512754752 9661 195.159.176.226 (8 Dec 2017 17:39:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Dec 2017 17:39:12 +0000 (UTC) Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 08 18:39:08 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNMc7-0002Oq-Gb for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2017 18:39:07 +0100 Original-Received: from localhost ([::1]:38402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNMcE-0004sJ-Ot for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2017 12:39:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNMc8-0004s6-4N for emacs-devel@gnu.org; Fri, 08 Dec 2017 12:39:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNMc4-0002fV-TW for emacs-devel@gnu.org; Fri, 08 Dec 2017 12:39:08 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNMc4-0002fR-PL for emacs-devel@gnu.org; Fri, 08 Dec 2017 12:39:04 -0500 Original-Received: from mail-qt0-f174.google.com ([209.85.216.174]:35328) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1eNMc4-0000lq-Ad; Fri, 08 Dec 2017 12:39:04 -0500 Original-Received: by mail-qt0-f174.google.com with SMTP id u10so27706950qtg.2; Fri, 08 Dec 2017 09:39:04 -0800 (PST) X-Gm-Message-State: AKGB3mIRyY1nzWyUwP1ESR09qpceXZfW0UEUEQsohOARW/m5h+i8WLnR 14bIUn7HykXXRkAy51asyjwv2tVQnEP7Fd8bCc4= X-Google-Smtp-Source: AGs4zMYGJZwgWhv2w79jZRjRFVrco67S9bdOM/H9rOx7VDTwA/zoifFU3lDomgApiAz5rQKIA4CW4OwxHydMJ+rC6k8= X-Received: by 10.55.42.75 with SMTP id q72mr37083340qkh.57.1512754743894; Fri, 08 Dec 2017 09:39:03 -0800 (PST) Original-Received: by 10.200.55.124 with HTTP; Fri, 8 Dec 2017 09:38:33 -0800 (PST) In-Reply-To: <83wp1xupqs.fsf@gnu.org> X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:220796 Archived-At: --001a114970ec2465da055fd7a9b5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Dec 8, 2017 at 11:51 AM, Eli Zaretskii wrote: > Hi, Emacs. > > The widen-less branch proposes to have indent-according-to-mode, > indent-for-tab-command, and indent-region call 'widen' before calling > indent-line-function. This call is unconditional, =E2=80=8BYou don't say in your message but I would assume that a save-restriction is used automatically within these tab commands so that after the indent command, the restriction is restored and there is no need for callers to wrap indent functions within a save-restriction. So after these two calls: > =E2=80=8B=E2=80=8B > > =E2=80=8B=E2=80=8B > (narrow-to-region START END) > =E2=80=8B=E2=80=8B > (indent-for-tab-command) =E2=80=8Bthe narrowed region would be nearly the same (except for changes made by the tab command). Is that correct? If that is the case, then this seems much less problematic than if it is not and I would defer to Stefan's thinking. Bob --001a114970ec2465da055fd7a9b5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Dec 8, 20= 17 at 11:51 AM, Eli Zaretskii <el= iz@gnu.org> wrot= e:
Hi, Emacs.

The widen-less branch proposes to have indent-according-to-mode,
indent-for-tab-command, and indent-region call 'widen' before calli= ng
indent-line-function.=C2=A0 This call is unconditional,
=E2=80=8BYou don't say in your message but I would assume that
a s= ave-restriction is used automatically within these
tab commands so that af= ter the indent command, the
restriction is restored and there is no need f= or callers
to wrap indent functions within a save-restriction.

=
So a= fter these two calls:
=E2=80= =8B=E2=80=8B

=E2=80=8B=E2=80=8B
=C2=A0 =C2=A0 (narrow-to-region START EN= D)
=E2=80=8B=E2=80=8B
=C2=A0 =C2=A0 (indent-for-tab-command)

=E2=80=8Bthe narrowed region would be nearly the same= (except
for changes made by the tab command).=C2=A0 Is that correct?
If that is the case, then this seems much less problematic
than if it i= s not and I would defer to Stefan's thinking.

Bob

--001a114970ec2465da055fd7a9b5--