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: Getting rid of prog-indentation-context Date: Mon, 11 Dec 2017 09:18:42 -0500 Message-ID: References: <20171129233237.27462.23351@vcs0.savannah.gnu.org> <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> <83o9nexy48.fsf@gnu.org> <83d13uxug5.fsf@gnu.org> <41e3f343-816f-d2db-6575-6ef43d54957f@yandex.ru> <838tecuqjb.fsf@gnu.org> <83609guppd.fsf@gnu.org> <83po7nt6oi.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1513002269 28034 195.159.176.226 (11 Dec 2017 14:24:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Dec 2017 14:24:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 11 15:24:24 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 1eOP0K-00074V-Ik for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2017 15:24:24 +0100 Original-Received: from localhost ([::1]:53465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOP0R-0008Si-Rm for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2017 09:24:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOOvA-0003DE-6f for emacs-devel@gnu.org; Mon, 11 Dec 2017 09:19:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOOv0-0003St-HK for emacs-devel@gnu.org; Mon, 11 Dec 2017 09:19:04 -0500 Original-Received: from [195.159.176.226] (port=49259 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOOv0-0003Pc-AX for emacs-devel@gnu.org; Mon, 11 Dec 2017 09:18:54 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eOOup-000286-G8 for emacs-devel@gnu.org; Mon, 11 Dec 2017 15:18:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:D7SJOhA10d9Qjrze30ldBdbSyeI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:220877 Archived-At: >> Could we just mark them as obsolete in Emacs-26? > Doesn't sound like a good idea to me: something that was introduced > recently and barely had any chance to be used doesn't fall under the > "obsolete" label for me. Eli, I fail to understand what you expect prog-indentation-context will be used for. Here's what I'd like to see happen for Emacs-26: - document the way major modes should behave in order to work properly in MMM contexts like mhtml-mode and mmm-mode. Part of this doc says that indent-line-functions can assume that the buffer is already widened (to the current chunk or the whole buffer). - change indent-according-to-mode to widen before calling indent-line-function (such that the above documentation is actually valid). - get rid of prog-indentation-context or at least mark it as obsolete, since its 2nd element competes with the above changes and its 3rd element, while potentially useful, lacks even a proof-of-concept demonstration that it does what it purports to do. - get rid of prog-widen. To be honest, I could live with a version of prog-indentation-context stripped down to its first element (which means: change its docstring to say something like: "When non-nil, provides context for indenting embedded code chunks. There are languages where part of the code is actually written in a sub language, e.g., a Yacc/Bison or ANTLR grammar also consists of plain C code. This variable enables the major mode of the main language to use the indentation engine of the sub-mode for lines in code chunks written in the sub-mode's language. When a major mode of such a main language decides to delegate the indentation of a line/region to the indentation engine of the sub mode, it should bind this variable to non-nil around the call. The non-nil value should be a list of the form: (FIRST-COLUMN . REST) FIRST-COLUMN is the column the indentation engine of the sub-mode should use for top-level language constructs inside the code chunk (instead of 0). REST is currently unused.") We could also keep prog-widen as (defalias prog-widen #'ignore) or a more verbose version of the same, if you insist. Stefan