emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Source blocks confused by Org syntax
@ 2019-02-14 20:14 Galen Menzel
  2019-02-14 20:37 ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: Galen Menzel @ 2019-02-14 20:14 UTC (permalink / raw)
  To: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

Hi all,

I’m finding that org source blocks are getting confused if their text 
contains org syntax. For example, in the text below, org considers all 
the lines beginning with asterisks in the text below to be org headers, 
and will fold them accordingly:

```
#+BEGIN_SRC text
This source block folds just fine
#+END_SRC

#+BEGIN_SRC text
This source block doesn't fold properly because it contains an org 
headline
* See?
#+END_SRC

#+BEGIN_SRC emacs-lisp
(surely this problem doesnt apply in emacs-lisp mode)
* Does it?
** Sadly it does
  #+END_SRC

  #+BEGIN_QUOTE
  The problem also pertains to quotes
* as you can see
#+END_QUOTE

#+BEGIN_EXAMPLE
And examples are no exception
* As you can see again
#+END_EXAMPLE
```

Since all these “headlines” occur inside source, quote, or example 
blocks, they shouldn’t be considered org headlines. In addition, the 
blocks that contain lines beginning with asterisks won’t fold 
properly.

I’m seeing this behavior in both 9.2.1 and 9.1.9. Are others seeing 
this? Please let me know if I can provide any further information!

Best,

Galen

[-- Attachment #2: Type: text/html, Size: 2105 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Source blocks confused by Org syntax
  2019-02-14 20:14 Source blocks confused by Org syntax Galen Menzel
@ 2019-02-14 20:37 ` John Kitchin
  2019-02-14 20:55   ` Galen Menzel
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2019-02-14 20:37 UTC (permalink / raw)
  To: Galen Menzel; +Cc: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 1934 bytes --]

you can escape those by putting a , in front of them. You may have to type
C-q , to get it put in if you see strange messages about user-error:
Priority must be between ‘A’ and ‘C’.

In fact org-mode will do that for you if you are in special edit mode when
you exit it. You may not be able to use C-c ' to get into this mode though
with the * in the block until you put , in front of them.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Feb 14, 2019 at 3:15 PM Galen Menzel <galen.menzel@utexas.edu>
wrote:

> Hi all,
>
> I’m finding that org source blocks are getting confused if their text
> contains org syntax. For example, in the text below, org considers all the
> lines beginning with asterisks in the text below to be org headers, and
> will fold them accordingly:
>
> #+BEGIN_SRC text
> This source block folds just fine
> #+END_SRC
>
> #+BEGIN_SRC text
> This source block doesn't fold properly because it contains an org headline
> * See?
> #+END_SRC
>
> #+BEGIN_SRC emacs-lisp
> (surely this problem doesnt apply in emacs-lisp mode)
> * Does it?
> ** Sadly it does
>  #+END_SRC
>
>  #+BEGIN_QUOTE
>  The problem also pertains to quotes
> * as you can see
> #+END_QUOTE
>
> #+BEGIN_EXAMPLE
> And examples are no exception
> * As you can see again
> #+END_EXAMPLE
>
> Since all these “headlines” occur inside source, quote, or example blocks,
> they shouldn’t be considered org headlines. In addition, the blocks that
> contain lines beginning with asterisks won’t fold properly.
>
> I’m seeing this behavior in both 9.2.1 and 9.1.9. Are others seeing this?
> Please let me know if I can provide any further information!
>
> Best,
>
> Galen
>

[-- Attachment #2: Type: text/html, Size: 2651 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Source blocks confused by Org syntax
  2019-02-14 20:37 ` John Kitchin
@ 2019-02-14 20:55   ` Galen Menzel
  2019-02-14 20:57     ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: Galen Menzel @ 2019-02-14 20:55 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

Ah, thanks — using C-c ' is a functional work around for most of my 
needs.

Still, is there no way to create a proper verbatim text block in org?

Galen

On 14 Feb 2019, at 12:37, John Kitchin wrote:

> you can escape those by putting a , in front of them. You may have to 
> type C-q , to get it put in if you see strange messages about 
> user-error:
> Priority must be between ‘A’ and ‘C’.
>
> In fact org-mode will do that for you if you are in special edit mode 
> when you exit it. You may not be able to use C-c ' to get into this 
> mode though with the * in the block until you put , in front of them.
>
> John
>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Thu, Feb 14, 2019 at 3:15 PM Galen Menzel <galen.menzel@utexas.edu>
> wrote:
>
>> Hi all,
>>
>> I’m finding that org source blocks are getting confused if their 
>> text
>> contains org syntax. For example, in the text below, org considers 
>> all the
>> lines beginning with asterisks in the text below to be org headers, 
>> and
>> will fold them accordingly:
>>
>> #+BEGIN_SRC text
>> This source block folds just fine
>> #+END_SRC
>>
>> #+BEGIN_SRC text
>> This source block doesn't fold properly because it contains an org 
>> headline
>> * See?
>> #+END_SRC
>>
>> #+BEGIN_SRC emacs-lisp
>> (surely this problem doesnt apply in emacs-lisp mode)
>> * Does it?
>> ** Sadly it does
>>  #+END_SRC
>>
>>  #+BEGIN_QUOTE
>>  The problem also pertains to quotes
>> * as you can see
>> #+END_QUOTE
>>
>> #+BEGIN_EXAMPLE
>> And examples are no exception
>> * As you can see again
>> #+END_EXAMPLE
>>
>> Since all these “headlines” occur inside source, quote, or 
>> example blocks,
>> they shouldn’t be considered org headlines. In addition, the blocks 
>> that
>> contain lines beginning with asterisks won’t fold properly.
>>
>> I’m seeing this behavior in both 9.2.1 and 9.1.9. Are others seeing 
>> this?
>> Please let me know if I can provide any further information!
>>
>> Best,
>>
>> Galen
>>



[-- Attachment #2: Type: text/html, Size: 4972 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Source blocks confused by Org syntax
  2019-02-14 20:55   ` Galen Menzel
@ 2019-02-14 20:57     ` John Kitchin
  0 siblings, 0 replies; 4+ messages in thread
From: John Kitchin @ 2019-02-14 20:57 UTC (permalink / raw)
  To: Galen Menzel; +Cc: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 2636 bytes --]

That is considered the proper way to do it as far as I know.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Feb 14, 2019 at 3:55 PM Galen Menzel <galen.menzel@utexas.edu>
wrote:

> Ah, thanks — using C-c ' is a functional work around for most of my needs.
>
> Still, is there no way to create a proper verbatim text block in org?
>
> Galen
>
> On 14 Feb 2019, at 12:37, John Kitchin wrote:
>
> you can escape those by putting a , in front of them. You may have to type
> C-q , to get it put in if you see strange messages about user-error:
> Priority must be between ‘A’ and ‘C’.
>
> In fact org-mode will do that for you if you are in special edit mode when
> you exit it. You may not be able to use C-c ' to get into this mode though
> with the * in the block until you put , in front of them.
>
> John
>
> -----------------------------------
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
>
> On Thu, Feb 14, 2019 at 3:15 PM Galen Menzel <galen.menzel@utexas.edu>
> wrote:
>
>> Hi all,
>>
>> I’m finding that org source blocks are getting confused if their text
>> contains org syntax. For example, in the text below, org considers all the
>> lines beginning with asterisks in the text below to be org headers, and
>> will fold them accordingly:
>>
>> #+BEGIN_SRC text
>> This source block folds just fine
>> #+END_SRC
>>
>> #+BEGIN_SRC text
>> This source block doesn't fold properly because it contains an org headline
>> * See?
>> #+END_SRC
>>
>> #+BEGIN_SRC emacs-lisp
>> (surely this problem doesnt apply in emacs-lisp mode)
>> * Does it?
>> ** Sadly it does
>>  #+END_SRC
>>
>>  #+BEGIN_QUOTE
>>  The problem also pertains to quotes
>> * as you can see
>> #+END_QUOTE
>>
>> #+BEGIN_EXAMPLE
>> And examples are no exception
>> * As you can see again
>> #+END_EXAMPLE
>>
>> Since all these “headlines” occur inside source, quote, or example
>> blocks, they shouldn’t be considered org headlines. In addition, the blocks
>> that contain lines beginning with asterisks won’t fold properly.
>>
>> I’m seeing this behavior in both 9.2.1 and 9.1.9. Are others seeing this?
>> Please let me know if I can provide any further information!
>>
>> Best,
>>
>> Galen
>>
>

[-- Attachment #2: Type: text/html, Size: 4195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-14 21:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-14 20:14 Source blocks confused by Org syntax Galen Menzel
2019-02-14 20:37 ` John Kitchin
2019-02-14 20:55   ` Galen Menzel
2019-02-14 20:57     ` John Kitchin

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).