reddit / emacs

I have a couple questions about literal examples from https://orgmode.org/manual/Literal-Examples.html

Status-Detective-783 · 2022-02-19 01:49
EDIT: THIS HAS BEEN ANSWERED, THANKS! I'm a newbie. From: https://orgmode.org/manual/Literal-Examples.html It says the following: You must insert a comma right before lines starting with either ‘*’, ‘,*’, ‘#+’ or ‘,#+’ Is this a mistake in the text? Why would I need to put a comma before a line starting with `,*`? I'd end up with `,,*`. Then they give the following example: #+BEGIN_EXAMPLE ,* I am no real headline #+END_EXAMPLE But wouldn't it be sufficient without the begin end? ;; This will work too ,* I am no real headline For that matter, wouldn't it be sufficient to have just about any character there, including a space? ;; This will work too * I am no real headline EDIT: It just occurred to me that I'm thinking mainly in terms of how emacs is parsing and presenting the information within the editor as I type, but there might be other issues with the system processing the text, such as for agendas, exporting, etc.
NihilistDandy · 2022-02-19 02:56
`example` and `src` blocks are rendered differently on export (and can also support things like syntax highlighting in Org), so that's the answer to your "why not just do it without the block". As for the commas, the parser treats `*` and `#+` at the beginning of a line preferentially, so if you want to display literal `*` and `#+` at the beginning of a line on export, you need to escape them with `,`. Similarly, if you want to be able to display literal `,*` and `,#+` (say, because you are writing examples about Org), you'll have to escape _those_ with `,`, as well, or they'll be exported as literal `*` and `#+`. Hence, `,,*` and `,,#+`.
Status-Detective-783 · 2022-02-19 03:00
Perfect, thanks!