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: Lifting all buffer restrictions in indentation functions Date: Fri, 08 Dec 2017 18:51:55 +0200 Message-ID: <83wp1xupqs.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1512751971 10766 195.159.176.226 (8 Dec 2017 16:52:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Dec 2017 16:52:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 08 17:52:48 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 1eNLtH-0002hF-PD for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2017 17:52:47 +0100 Original-Received: from localhost ([::1]:38130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLtO-0003Rk-Ty for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2017 11:52:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLsr-0003Iy-60 for emacs-devel@gnu.org; Fri, 08 Dec 2017 11:52:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNLso-0004EE-1B for emacs-devel@gnu.org; Fri, 08 Dec 2017 11:52:21 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNLsn-0004EA-TQ for emacs-devel@gnu.org; Fri, 08 Dec 2017 11:52:17 -0500 Original-Received: from [176.228.60.248] (port=3457 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNLsm-00084U-TA for emacs-devel@gnu.org; Fri, 08 Dec 2017 11:52:17 -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:220794 Archived-At: Hi, Emacs. The issue I raise here is a spin-off from discussing the changes on the widen-less branch, but I think it is largely independent and has more broad effect, so IMO it should be discussed separately. 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, so for example the following (save-excursion (narrow-to-region START END) (indent-for-tab-command)) will not do what the caller expects, because indent-line-function will not run restricted to the region bounds, but will instead be able to access the whole buffer. The rationale for this change seems to be twofold: . it is TRT for indentation operations . MMM and similar features need that, and will apply the restriction as appropriate before calling the mode-specific indentation function I'm worried by widening unconditionally, because some strange mode could need to run its indentation function restricted, and the indentation function itself might not have enough context to narrow by itself. IOW, widening unconditionally seems to invalidate potentially legitimate uses of this functionality, so I wonder whether we should have some "fire escape", or maybe condition this widening only on MMM and similar modes being active. I'd like to hear opinions about this. If I'm the only one who is bothered by this, then I will defer to Stefan's and Dmitry's opinions. TIA