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: Lifting all buffer restrictions in indentation functions Date: Fri, 08 Dec 2017 22:02:47 +0200 Message-ID: <83shclugwo.fsf@gnu.org> References: <83wp1xupqs.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1512763493 14803 195.159.176.226 (8 Dec 2017 20:04:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 8 Dec 2017 20:04:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 08 21:04:46 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 1eNOt3-0003Yd-UB for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2017 21:04:46 +0100 Original-Received: from localhost ([::1]:38827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNOt8-00026t-1Z for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2017 15:04:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNOrf-0001hI-Hs for emacs-devel@gnu.org; Fri, 08 Dec 2017 15:03:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNOra-000716-GV for emacs-devel@gnu.org; Fri, 08 Dec 2017 15:03:19 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNOra-000710-DE; Fri, 08 Dec 2017 15:03:14 -0500 Original-Received: from [176.228.60.248] (port=3791 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eNOrY-0007XT-RV; Fri, 08 Dec 2017 15:03:14 -0500 In-reply-to: (message from Stefan Monnier on Fri, 08 Dec 2017 12:03:45 -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:220798 Archived-At: > From: Stefan Monnier > Date: Fri, 08 Dec 2017 12:03:45 -0500 > > While such code might exist somewhere [tho most likely calling > indent-according-to-mode instead], the reasons why I think > breaking such code is the right thing are: > - it's very rare > - it should be easy to change this code so it works with the new (and > the old) convention, by replacing (indent-according-to-mode) with > (funcall indent-line-function). > - the reverse problem (i.e. where the restriction is currently obeyed > while it shouldn't) is much more common. > > IOW the change could introduce breakage, but in my opinion, it will > correct many more situations than it breaks, and those that it breaks > are easy to fix. To clarify: I'm not only afraid of breaking some existing code, I'm also worried by disabling any _future_ code which could call these functions in a narrowed buffer. This is AFAIU a legitimate usage, so unconditionally disallowing it sounds gross. And I don't think calling indent-line-function directly instead is the solution, because indent-according-to-mode, indent-for-tab-command etc. are not just trivial wrappers around the call to indent-line-function, they have additional functionality (otherwise why do we have them at all?).