emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Pierre-André Cornillon" <pac.herault@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: Fontification for the inner bloc of two nested bloc
Date: Wed, 11 Oct 2017 17:54:08 +0200	[thread overview]
Message-ID: <CAGTEyCxhSdQ+1qDXzOfZP7EzVVW_H8nR9YVJk5OvcE9=ioUyOg@mail.gmail.com> (raw)
In-Reply-To: <87k203fp6o.fsf@nicolasgoaziou.fr>

Hello,

On Tue, Oct 10, 2017 at 9:16 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> Hello,
>
> Pierre-André Cornillon <pac.herault@gmail.com> 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

  reply	other threads:[~2017-10-11 15:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  9:11 Fontification for the inner bloc of two nested bloc Pierre-André Cornillon
2017-10-10  7:16 ` Nicolas Goaziou
2017-10-11 15:54   ` Pierre-André Cornillon [this message]
2017-10-11 16:00     ` Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2017-10-05  9:59 Pierre-André Cornillon
2017-10-01 14:36 Pierre-Andre Cornillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGTEyCxhSdQ+1qDXzOfZP7EzVVW_H8nR9YVJk5OvcE9=ioUyOg@mail.gmail.com' \
    --to=pac.herault@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).