From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-ppss): More sanity check to catch Date: Fri, 14 Feb 2014 15:53:39 -0500 Message-ID: References: <87r47bi1e5.fsf@yandex.ru> <52F96284.50507@yandex.ru> <52FAE12B.6060101@yandex.ru> <52FC3BEE.60604@yandex.ru> <52FCD2B4.5080006@yandex.ru> <52FD9F1D.50205@yandex.ru> <83mwhucg1h.fsf@gnu.org> <8338jldaju.fsf@gnu.org> <83wqgxbln7.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392411268 30944 80.91.229.3 (14 Feb 2014 20:54:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 20:54:28 +0000 (UTC) Cc: emacs-devel@gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 14 21:54:34 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WEPmL-0002lu-7f for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 21:54:33 +0100 Original-Received: from localhost ([::1]:53788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEPmK-000865-M6 for ged-emacs-devel@m.gmane.org; Fri, 14 Feb 2014 15:54:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEPmA-00085r-6A for emacs-devel@gnu.org; Fri, 14 Feb 2014 15:54:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEPm1-0005rm-WB for emacs-devel@gnu.org; Fri, 14 Feb 2014 15:54:22 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:47084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEPls-0005lb-3o; Fri, 14 Feb 2014 15:54:04 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 2DFF8848BD; Fri, 14 Feb 2014 15:54:03 -0500 (EST) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 85F5F1E5B74; Fri, 14 Feb 2014 15:53:39 -0500 (EST) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 682A6B40FE; Fri, 14 Feb 2014 15:53:39 -0500 (EST) In-Reply-To: <83wqgxbln7.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 14 Feb 2014 20:21:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169631 Archived-At: > Maybe I'm missing something, but how do you define fontification > functions that are only in effect in a portion of a buffer? Here's one way: >From the C code's point of view, fontification-functions will always point to the one and only jit-lock-function, and then jit-lock will call font-lock which will go through font-lock-fontify-region-function will be hooked by mmm-mode to dispatch to use the proper font-lock-keywords depending on the major mode in that region. We could also provide more direct support either directly in font-lock or directly in jit-lock, but the existing hooks might be sufficient. >> >> What we need instead is some conventions that major modes need to >> >> follow to play well in things like mmm-mode or mumamo. >> > Like what? >> Like "font-lock-keywords can only look before/after the provided region >> boundaries by calling special functions". > And why would this not play well? Not sure I understand the question. If the major modes don't obey this rule, they may end up looking at code which is written in another language and hence go them all confused. > We are not talking about narrowing to an arbitrary portion of text. > We are talking about narrowing to a portion that presents a > syntactically complete snippet of code. Not necessarily. As mentioned earlier, it may have to start indentation at a non-0 column, for example. Or, if you think of a comment as a "chunk" in another major mode, then you'll want to be able to jump from a brace to the matching other end, even if there's a comment between the two, so you'll have to jump over that "chunk" somehow, but "narrowing" won't do it, since it would have to "hide" something inside rather than something outside. Anyway, if you can hash out a design and implement it, go for it. Stefan