emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: org-mode interprets * as a headline in text between #+BEGIN


From: Nick Dokos
Subject: Re: [O] Bug: org-mode interprets * as a headline in text between #+BEGIN_.. and #+END_...
Date: Thu, 06 Oct 2016 18:05:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

John Hendy <address@hidden> writes:

> On Thu, Oct 6, 2016 at 3:28 PM, David Talmage
> <address@hidden> wrote:
>> I often paste verbatim text into the lab notebook I keep with org-mode.
>> Org-mode always interprets any line that begins with an asterisk as a
>> headline, even when the line is surrounded by #+BEGIN_... and #+END_...
>> patterns. This breaks org-special-edit, making it complain, "No special
>> environment to edit here", unless I manually insert another character at the
>> beginning of every line in the block that begins with an asterisk.
>>
>> The behavior surprised me.  I found two ways to work around it.  First, I
>> can edit the would-be verbatim text as described above. It will always look
>> like the original text in org-special-edit. That's marginally acceptable
>> because it alters my original text and makes me take one more step before I
>> can copy and paste it elsewhere.  Second, I can put such text in a drawer.
>> I discovered that org-mode does not mis-interpret my text in a drawer.
>>
>>
>
> I don't have a good explanation of why, but I know you need a comma to
> escape org syntax, even within src blocks:
> - mention of it in the manual (footnote 4):
> http://orgmode.org/manual/Literal-examples.html
> - SO answer:
> http://stackoverflow.com/questions/7431167/escaping-org-mode-example-block-inside-of-an-example-block
>

C-c ' to edit the block will rewrite it with a , in front - but only
if the line does not start with a * - if it starts with a *, then C-c
' will complain as the OP posted. And if you have speed keys enabled,
then comma or space will not self-insert, and you got to do something
like C-q , to enter the comma or C-q SPC for a space, making the whole
thing even more confusing. I don't know how it would interact with
org-indent turned off: I didn't try that.

Is the "* on column 0 is a headline" convention a consequence of the
dependence on outline.el? Or is it just historical baggage? I cannot
remember the grammar rules, but I'm wondering if the parser could be
made to say "not a headline" in this situation, and if so, what the
consequences might be (particularly, the bad consequences).

I'm not sure whether Nicolas has actually explained this situation in
the past, but, with gmane non compos mentis, I did not attempt to find
an earlier discussion.

-- 
Nick




reply via email to

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