From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Bug: org-mode interprets * as a headline in text between #+BEGIN_.. and #+END_... Date: Thu, 06 Oct 2016 18:05:18 -0400 Message-ID: <874m4prv4x.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsGnQ-0001Kg-4b for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 18:05:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsGnL-0001Ys-Ko for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 18:05:42 -0400 Received: from [195.159.176.226] (port=39158 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsGnL-0001WD-DA for emacs-orgmode@gnu.org; Thu, 06 Oct 2016 18:05:39 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bsGnA-0007ty-BI for emacs-orgmode@gnu.org; Fri, 07 Oct 2016 00:05:28 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org John Hendy writes: > On Thu, Oct 6, 2016 at 3:28 PM, David Talmage > 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