From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls Date: Mon, 04 Dec 2017 11:49:59 -0500 Message-ID: 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1512406267 32744 195.159.176.226 (4 Dec 2017 16:51:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Dec 2017 16:51:07 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 04 17:51:03 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 1eLtxO-0008Hp-8W for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2017 17:51:02 +0100 Original-Received: from localhost ([::1]:44084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLtxV-00033W-LP for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2017 11:51:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eLtwV-0002ud-5u for emacs-devel@gnu.org; Mon, 04 Dec 2017 11:50:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eLtwU-0002YV-Cw for emacs-devel@gnu.org; Mon, 04 Dec 2017 11:50:07 -0500 Original-Received: from pmta21.teksavvy.com ([76.10.157.36]:47736) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1eLtwO-0002QV-KY; Mon, 04 Dec 2017 11:50:00 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2HcGgCHeyVa/7mYWxdcHAEBAQQBAQoBA?= =?us-ascii?q?YM8gVSOLY8TgX2ZFoVFAoU0QxQBAQEBAQEBAQEDaCiFJAEEAXkFCwsNJxIUGDG?= =?us-ascii?q?KLQiqCyECijYBAQEBBgIBJYVRhmqLGQWTGo9SoQsohzSYBzYjgU0yGggwgmSDB?= =?us-ascii?q?oFsI4pRAQEB?= X-IPAS-Result: =?us-ascii?q?A2HcGgCHeyVa/7mYWxdcHAEBAQQBAQoBAYM8gVSOLY8TgX2?= =?us-ascii?q?ZFoVFAoU0QxQBAQEBAQEBAQEDaCiFJAEEAXkFCwsNJxIUGDGKLQiqCyECijYBA?= =?us-ascii?q?QEBBgIBJYVRhmqLGQWTGo9SoQsohzSYBzYjgU0yGggwgmSDBoFsI4pRAQEB?= X-IronPort-AV: E=Sophos;i="5.45,359,1508817600"; d="scan'208";a="10722675" Original-Received: from unknown (HELO pastel.home) ([23.91.152.185]) by smtp.teksavvy.com with ESMTP; 04 Dec 2017 11:49:59 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B8B5F61367; Mon, 4 Dec 2017 11:49:59 -0500 (EST) In-Reply-To: <83r2saxyj1.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 04 Dec 2017 18:12:34 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.36 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:220709 Archived-At: > 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. >> This change should be harmless because even if the user has narrowed >> the buffer, the indentation should always be done depending on the >> whole buffer's content anyway. > But that's an incompatible change, isn't it? 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. Stefan