emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DISCUSSION] Refactoring fontification system


From: Phil Estival
Subject: Re: [DISCUSSION] Refactoring fontification system
Date: Wed, 8 Jun 2022 08:52:12 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

[2022-06-03 Wed 11:45] Ihor Radchenko <yantar92@gmail.com>:
>
> I'd like to hear if anyone has any idea on how to interpret the
> following:
>
> 1. org-protecting-blocks is an internal auxiliary variable used to
>    determine which blocks should be fontified using different major
>    mode.
>    It's value is ("src" "example" "export")
>    So, #+begin_src lang and #+begin_export lang are fontified according
>    to LANG. Makes sense.
>    However, what about #+begin_example?
>    org-element-example-block-parser does not appear to expect language
>    specification in the example blocks. Only switches seems to be
>    allowed. Am I missing something and Org actually allows example
>    blocks to specify language? Or was it the case in the distant past
>    versions of Org?


 - org-fontify-meta-lines-and-blocks-1
   is looking for begin_
   what comes after (src) is optional and can be anything

   Next it looks for "language" (match-string 5 to 7
   — it could be helpful to have comments indicating
   the number matching of the groups next to them).
   What gets fontified like a source block turns out to be:
   ,#+begin_{\w} <language> [<switches> <header arguments>]

   So this is fontified:

   #+begin_quote python
   def sss(): pass
   #+end_quote

   and this too:

   #+begin_fly awk
   BEGIN { woosh }
   #+end_fly

   Which is nice, but not interpreted like so
   by any export backend.


>
> 3. org-fontify-meta-lines-and-blocks-1 creates a special face for
>    ("+title:" "+subtitle:" "+author:" "+email:" "+date:")
>    The face name is org-document-info.
>    But what about, say, +description: or +language:?
>    Would it make more sense to fontify all the keywords from
>    org-options-keywords instead?
>

Makes more sense, yes.
I would have named them "directives"
rather than "keywords", but it's too late now.


Regards,
Phil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]