emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daimrod <daimrod@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] Bad escape with Babel + org-mode
Date: Tue, 02 Jun 2015 16:31:29 +0200	[thread overview]
Message-ID: <87r3puqj0e.fsf@gmail.com> (raw)

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

Hi,

I've encountered a bug when using org-mode in source blocks. I'm using
the latest version of org-mode from git:
Org-mode version 8.3beta (release_8.3beta-1195-g1a7364 [...])

I have no problem with the following snippet:
#+BEGIN_SRC org
,* test 1
,* test 2
,* test 3
,* test 4
,* test 5
,* test 6
,* test 7
,* test 8
,* test 9
,* test 10

#+END_SRC

But I have an error with this one when I hit C-' to go back to my org
file:

error in `org-escape-code-in-region'> while: Invalid search bound (wrong side of point)
#+BEGIN_SRC org
,* test 1
,* test 2
,* test 3
,* test 4
,* test 5
,* test 6
,* test 7
,* test 8
,* test 9
,* test 10
,* test 11

#+END_SRC

And with the following snippet:
#+BEGIN_SRC org
,* test 1
,* test 2
,* test 3
,* test 4
,* test 5
,* test 6
,* test 7
,* test 8
,* test 9
,* test 10
,* test 11
,* test 12
#+END_SRC

When I hit C-' to go back to the org file the block isn't properly
escaped, it becomes:

#+BEGIN_SRC org
,* test 1
,* test 2
,* test 3
,* test 4
,* test 5
,* test 6
,* test 7
,* test 8
,* test 9
,* test 10
,* test 11
* test 12
#+END_SRC

I've tried to understand what's the problem and it looks like the
position returned by `re-search-forward' in `org-escape-code-in-region'
is wrong, but I don't know why. By wrong, I mean that the position
returned isn't immediately after the expression found but slightly
after, and the error increases which is why it doesn't fail with 10
items or less.

e.g.
* test 1
 ^ point
* test 2
  ^ point
* test 3
   ^ point
...

Best,

--
Daimrod/Greg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

             reply	other threads:[~2015-06-02 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 14:31 Daimrod [this message]
2015-06-02 15:19 ` [BUG] Bad escape with Babel + org-mode Nicolas Goaziou
2015-06-02 17:05   ` Daimrod

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=87r3puqj0e.fsf@gmail.com \
    --to=daimrod@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).