From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: [BUG] Bad escape with Babel + org-mode Date: Tue, 02 Jun 2015 16:31:29 +0200 Message-ID: <87r3puqj0e.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YznEA-0001co-UR for emacs-orgmode@gnu.org; Tue, 02 Jun 2015 10:31:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YznE5-00056s-W0 for emacs-orgmode@gnu.org; Tue, 02 Jun 2015 10:31:38 -0400 Received: from smtptls1-lmb.cpub.univ-nantes.fr ([193.52.103.110]:37465 helo=smtp-tls.univ-nantes.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YznE5-00053Z-NN for emacs-orgmode@gnu.org; Tue, 02 Jun 2015 10:31:33 -0400 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVbb5BAAoJEBNzVHcrZRiU/IYQAIFTaXX0i/ptj4mIj190fuo8 yr3KaK4CclD+3U4nyGImBziLDSYal4FDRu3MDE2mnpzcCxmbWQNb9kGNRN3LqWW1 yEhaB0qH5C9aDbkHtECwPHYOmImiSxFfNn52pDDp5hg4oT1MI+JGD5L9ND2pknpp P81Zbjq/XrVQSO4u0UXz/l9vnJFIEF2dOy3+uX/gBz37GTq1pBvV48ay3XNgv0sp HegtF8t39t6bImz7gqmXUwgAsdDp8pIZqujBJQM6vp/c8GCfkuBViBXTIbxkw/cs VF+KvKDkHyuKpWoMUVHDaL3g7kn9Owbuclfdz6RtjOpG2y2og830R8bZm3kCsLds Yge8ghNAwNz8pqoMvbZeCLP/fSgaOXJD+e8gSOlJ0wGCN0xVTHbxpP1+Ybjzs6/H Lx5Tr9FFnMvHWy2uo/0KTf1ic+P0mxmpzxFlCyEvyyvP053VLVBNGFyQlcIhPrB9 UUa1+LorpucxQwLd7i7sWtRhyoEwlT909ilPrbwfBVvk5DIJ4nXzn/0U9OnlyR9b luBJAqYmHHNu0g+MZ0MwTwbs7InSSWlD7OvRrXGnDvSsE6WAB3sMj8ZUt7BVA3mY yCP+PGRbQQaGFw/ZhPTOCfKRw9M4hmYo8+BEi07tAcGfXHZMdja2majwJbGm8SUi KqIkPkxT3lUTUJmpJjGG =RbyZ -----END PGP SIGNATURE----- --=-=-=--