|
From: | Max Nikulin |
Subject: | Re: [DISCUSSION] Refactoring fontification system |
Date: | Thu, 9 Jun 2022 22:31:09 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
On 08/06/2022 11:23, Tom Gillespie wrote:
As for lang parameter support in example blocks, would you mind creating a separate feature request thread? Extending export blocks export will require changing in parser syntax and thus should be discussed carefully in a separate thread.I would strongly caution against allowing an optional #+begin_example lang syntax. It will lead to extreme confusion, even when users know to use org-lint. The reason for this is that example blocks do not have (and frankly should not have) full org-babel support. Babel is already complex enough as is without having to explain to a user that yes they can noweb an example block into a src block, but that they cannot noweb a source block into an example block.
My expectation is that treating #+begin_example almost as #+begin_src will simplify code. E.g. `org-latex-src-block' has a fallback to plain \begin{verbatim} if language is unknown or is not specified, so it may handle examples as well. The difference is that for #+begin_example evaluation and noweb are disabled, either it is hardcoded (my preference) or default values for :noweb and :eval header argument are adjusted.
On 09/06/2022 12:37, Pedro Andres Aranda Gutierrez wrote:
OK, just to add to the discussion. The original intent of my message was to give _me_ control over what I want to colour, not delegating that to the fontifying engine in Emacs. I need limited and controlled colouring for text-books and lab manuals where colouring elements of a listing goes against the publishing standards. I only need custom colouring to "emulate" terminal output, not for the code as such. And I could do that with the #+ATTR: if supported.
Fontification and an attribute to specify an option for environment are independent features. My point is that if example and src blocks reused the same code than it would be enough to implement :options attribute (similar to #+begin_quote) once and both types of blocks would be more flexible.
If #+begin_example becomes more dumb, unsure if it is reasonable to allow to generate "\begin{verbatim}[commandchars=\\\{\}]" for example block but not for source blocks.
Side note: I can not say that #+begin_example with language is widely used, but one case may be found in org-manual.org and a dozen in worg.
[Prev in Thread] | Current Thread | [Next in Thread] |