emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Bad escape with Babel + org-mode
@ 2015-06-02 14:31 Daimrod
  2015-06-02 15:19 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Daimrod @ 2015-06-02 14:31 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

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

end of thread, other threads:[~2015-06-02 17:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-02 14:31 [BUG] Bad escape with Babel + org-mode Daimrod
2015-06-02 15:19 ` Nicolas Goaziou
2015-06-02 17:05   ` Daimrod

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