emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: the_wurfkreuz <the_wurfkreuz@proton.me>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Org headings trigger is code blocks
Date: Wed, 31 Jul 2024 06:04:55 +0000	[thread overview]
Message-ID: <87h6c6jdvc.fsf@localhost> (raw)
In-Reply-To: <8zYKYBEAqlSgGecX399ZoMq0pLCPhJNPHlZSuWZZVs6HQuOOQCfMEfdoAA4dyrrmyobd5pW_-dGycqU1dlGxrK-qdQRdqaxjIjioQHz4yB0=@proton.me>

the_wurfkreuz <the_wurfkreuz@proton.me> writes:

> For instance, i have a command that starts with an asterisk, and i want
> to put it in a source block. However, doing so creates a heading.
> Shouldn't the code block serve as a clear logical indicator that i don't
> intend for that line to become a heading?
>
> Example:
>
> #+BEGIN_SRC
> * hard nofile 20000
> #+END_SRC

Headline syntax has the highest priority, so that you do not
accidentally invalidate a bunch of headings simply by having a
#+begin_src deeply inside some text:

...
#+begin_src
(unclosed #+begin-src)
...
* many headings here
#+begin_src
...<everything up to the first unclosed #+begin_src would be considered
a part of src block if what you suggest were the case>
#+end_src

You need to escape headings inside src blocks or literal examples like

#+BEGIN_SRC
,* hard nofile 20000
#+END_SRC

or simply by having an indentation

 #+BEGIN_SRC
 * hard nofile 20000
 #+END_SRC

See "12.6 Literal Examples" section of Org mode manual.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


      reply	other threads:[~2024-07-31  6:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  5:21 Org headings trigger is code blocks the_wurfkreuz
2024-07-31  6:04 ` Ihor Radchenko [this message]

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=87h6c6jdvc.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=the_wurfkreuz@proton.me \
    /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).