From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Pierre=2DAndr=C3=A9_Cornillon?= Subject: Re: Fontification for the inner bloc of two nested bloc Date: Wed, 11 Oct 2017 17:54:08 +0200 Message-ID: References: <87k203fp6o.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2JKl-0000Pm-5K for emacs-orgmode@gnu.org; Wed, 11 Oct 2017 11:54:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2JKk-0004cP-Cu for emacs-orgmode@gnu.org; Wed, 11 Oct 2017 11:54:11 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:55006) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2JKk-0004ba-5U for emacs-orgmode@gnu.org; Wed, 11 Oct 2017 11:54:10 -0400 Received: by mail-lf0-x22f.google.com with SMTP id d10so2602639lfg.11 for ; Wed, 11 Oct 2017 08:54:09 -0700 (PDT) In-Reply-To: <87k203fp6o.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: Org Mode List Hello, On Tue, Oct 10, 2017 at 9:16 AM, Nicolas Goaziou w= rote: > Hello, > > Pierre-Andr=C3=A9 Cornillon writes: > >> Dear orgmode users/gurus, >> >> I have a question about fontification of inner src bloc. >> >> I have two nested blocks: one special (outer bloc) and one src (inner >> bloc) like this >> >> #+begin_bloc20171001122500 >> #+begin_src R >> blip <- runif(2) >> test <- rnorm(2) >> #+end_src >> >> #+end_bloc20171001122500 >> >> and I want to have the native fontification property for the inner one. >> >> I have already (setq org-src-fontify-natively t) in my .emacs and it >> works like a charm for src blocks alone (not nested) but for nested >> ones it breaks. >> >> Is nested blocks are allowed and if so, is that possible to have that >> fontification property ? > > Nested blocks are allowed, but the fontification system has a few > shortcomings, including this one. Ultimately, this part of Org needs to > be rewritten using the parser. what is "the parser" exactly ? > > Anyway The bug probably lies in `org-fontify-meta-lines-and-blocks-1'. > Do you want to investigate? I agree that the regular search expression in the org-fontify-meta-lines-and-blocks-1 seems to match only one level of src block. I am not an elisp programmer but splitting the function in two part will allow to make it recursive (and thus to cope with several level of nested src block) ? Well it's pure speculation without testing... > > Regards, > > -- > Nicolas Goaziou Best regards, Pierre-Andre