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: Bug #25608 and the comment-cache branch Date: Mon, 13 Feb 2017 00:50:32 -0500 Message-ID: References: <20170202202418.GA2505@acm> <83lgtouxpf.fsf@gnu.org> <20170202215154.GB2505@acm> <83h94bvhzw.fsf@gnu.org> <20170205220045.GB2294@acm> <83d1es61li.fsf@gnu.org> <20170211232511.GA13712@acm> <20170212120553.GB3087@acm> <5dac24ba-a73e-b4f4-f595-30f86564b00a@yandex.ru> <20170212172900.GC3087@acm> <87mvdq97zy.fsf@jun.debian8.nb> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486965059 13191 195.159.176.226 (13 Feb 2017 05:50:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2017 05:50:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 13 06:50:55 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 1cd9XI-00034J-WC for ged-emacs-devel@m.gmane.org; Mon, 13 Feb 2017 06:50:53 +0100 Original-Received: from localhost ([::1]:54672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd9XO-0000Mg-Kp for ged-emacs-devel@m.gmane.org; Mon, 13 Feb 2017 00:50:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd9XG-0000Lm-CS for emacs-devel@gnu.org; Mon, 13 Feb 2017 00:50:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cd9XD-00078Q-9W for emacs-devel@gnu.org; Mon, 13 Feb 2017 00:50:50 -0500 Original-Received: from [195.159.176.226] (port=56045 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cd9XD-00078I-0G for emacs-devel@gnu.org; Mon, 13 Feb 2017 00:50:47 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cd9X4-0002GN-4L for emacs-devel@gnu.org; Mon, 13 Feb 2017 06:50:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:K8zNfDYACaXvMXD6DKDN3Nr+xd8= 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:212322 Archived-At: > How about adding two text properties like island-major-mode and > island-variables? All chars in the same island have the same values of > the two text properties. A multi-major-mode package could use such a strategy, but I don't think we want to hard-code such a thing directly in font-lock and syntax-ppss. Instead, we should focus on an intermediate API that syntax-ppss and font-lock can use on one side and which a new island-mode mmm can use on the other. E.g. sgml-mode may want to occasionally treat a tag as "an island" (i.e. parse it using a special syntax-table and ignoring the surrounding context), during some internal processing (e.g. within a limited dynamic scope), but it wouldn't want to have to place text-properties for that: let-binding vars would be a lot more convenient. Similarly, it would be a lot more convenient for syntax-ppss to consult some dynamically-scoped variable to find the "beginning of (sub)buffer", rather than having to scan text properties. So, I think something along the lines of prog-indentation-context would be more appropriate (and an island-mode could still consult text-properties to then temporarily set some dynamically scoped variable). Stefan