From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlos Pita Subject: Re: Bug: Add option to fontify latex blocks [9.1.9 (release_9.1.9-65-g5e4542 @ /home/carlos/local/stow/emacs-26/share/emacs/26.1.50/lisp/org/)] Date: Mon, 3 Dec 2018 01:18:37 -0300 Message-ID: References: <87h8g2kv81.fsf@gmail.com> <87lg5ershk.fsf@nicolasgoaziou.fr> <87d0qpsc4g.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTfh5-0006gd-LH for emacs-orgmode@gnu.org; Sun, 02 Dec 2018 23:18:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTfh5-0007O1-2n for emacs-orgmode@gnu.org; Sun, 02 Dec 2018 23:18:51 -0500 Received: from mail-yw1-xc44.google.com ([2607:f8b0:4864:20::c44]:45408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gTfh4-0007Nw-Uy for emacs-orgmode@gnu.org; Sun, 02 Dec 2018 23:18:51 -0500 Received: by mail-yw1-xc44.google.com with SMTP id d190so4846207ywd.12 for ; Sun, 02 Dec 2018 20:18:50 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org > the extension function becomes helpful again: this because the > #+BEGIN/#+END matcher is incremental and eventually the region to Well, on a closer inspection it's not that incremental, it's just ignoring the limit... (defun org-fontify-meta-lines-and-blocks-1 (limit) .... (when (re-search-forward (concat "^[ \t]*#\\+end" (match-string 4) "\\>.*") nil t) ;; on purpose, we look further than LIMIT .... This is against the rules! But if it's allowed here it should be allowed in org-do-latex-and-related by the same token, shouldn't it? So in order to get all this properly working: 1. Also ignore the limit in org-do-latex-and-related. 2. Install a region extension function so that multiline regions are properly identified at the start and after syntax breaking change (that is, at the beginning or at the end).