From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls Date: Mon, 04 Dec 2017 19:28:35 +0200 Message-ID: <83efoaxv0c.fsf@gnu.org> References: <20171129233237.27462.23351@vcs0.savannah.gnu.org> <20171129233238.504B5204F1@vcs0.savannah.gnu.org> <5d668ce5-1482-a3d4-c01b-7d996a532567@yandex.ru> <20171130214621.GA22157@ACM> <27985594-3bb4-ce88-8928-2ccfeac13eae@yandex.ru> <20171201154913.GB3840@ACM> <1e542021-e389-cca4-6acd-349efddb2652@yandex.ru> <20171201223529.GG3840@ACM> <4a94ec5c-efdd-50f1-ff4d-277f5f45c2df@yandex.ru> <83lgil1qme.fsf@gnu.org> <83d13x1j2s.fsf@gnu.org> <34abea95-c7f7-e8fa-8407-8c2fd2a4cfe1@yandex.ru> <83y3mkzw1n.fsf@gnu.org> <83mv2zzv7z.fsf@gnu.org> <83r2saxyj1.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1512408547 22610 195.159.176.226 (4 Dec 2017 17:29:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Dec 2017 17:29:07 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 04 18:29:02 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 1eLuY2-0005F3-8l for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2017 18:28:54 +0100 Original-Received: from localhost ([::1]:44417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLuY9-0000BY-GI for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2017 12:29:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLuXz-0000A5-Dt for emacs-devel@gnu.org; Mon, 04 Dec 2017 12:28:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLuXw-0005n8-9O for emacs-devel@gnu.org; Mon, 04 Dec 2017 12:28:51 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLuXw-0005n4-5q; Mon, 04 Dec 2017 12:28:48 -0500 Original-Received: from [176.228.60.248] (port=4383 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eLuXv-0004cJ-3q; Mon, 04 Dec 2017 12:28:47 -0500 In-reply-to: (message from Stefan Monnier on Mon, 04 Dec 2017 11:49:59 -0500) 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:220713 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Mon, 04 Dec 2017 11:49:59 -0500 > > > Why does it need to widen, though? > > Because in general, indentation may need to look at the context, and > that context may be outside of the current user-chosen narrowing. > > > If the mode's indent-line-function is not supposed to call 'widen', > > why do we do that in indent-according-to-mode? > > We do it in indent-according-to-mode specifically so that > indent-line-function doesn't need to do it. > > > When you widen, the text that comes into the view will be entirely > > alien syntactically to the sub-mode that is trying to indent, right? > > The widening is done in indent-according-to-mode and brings into view > the whole multi-mode buffer, indeed. Then MMM's indent-line-function is > called, which narrows the buffer to the relevant chunk and then calls > the submode's indent-line-function which hence only sees the part of the > buffer it needs. Ah, so this assumes that MMM is active in the buffer? If so, can we widen only if MMM is indeed active? Doing so will I believe minimize (or even eliminate) the effects on existing behaviors when MMM is not used. > It's a change that can have visible effects, of course, but these are > fairly rare and I'm hard pressed to come up with scenarios where the > effect is anything but beneficial. Use being so deep into the pretest requires to be either 110% careful not to change existing behaviors, or agree to postpone this to Emacs 27.