emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in org-src.el?
@ 2013-02-01 14:55 Thorsten Jolitz
  2013-02-11 14:45 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Jolitz @ 2013-02-01 14:55 UTC (permalink / raw)
  To: emacs-orgmode


Hi List, 

when I export a (bit complicated) PicoLisp source block with ':results
html', I get an error:

,----------------------------------------------------
| error: "Invalid search bound (wrong side of point)"
`----------------------------------------------------

The error happens in org-src.el in the function:

,-------------------------------------------
| (defun org-escape-code-in-region (beg end)
|   "Escape lines between BEG and END.
`-------------------------------------------

because beg and end are interchanged, i.e. the function is called with 

,--------------------------------------
| (org-escape-code-in-region 2921 2908)
`--------------------------------------

when 

,------------
| +results:
| +BEGIN_HTML # char 2908 at beginning-of-line
| +END_HTML   # char 2921 at beginning-of-line
`------------

Here is the backtrace:

,------------------------------------------------------------------------
| Debugger entered--Lisp error: (error "Invalid search bound (wrong side
|   of point)") re-search-forward("^[ ]*,?\\(\\*\\|#\\+\\)" #<marker at
|   2908 in picodoc-test.org> t) (while (re-search-forward "^[
|   ]*,?\\(\\*\\|#\\+\\)" end t) (replace-match ",\\1" nil nil nil 1))
|   (save-excursion (goto-char beg) (while (re-search-forward "^[
|   ]*,?\\(\\*\\|#\\+\\)" end t) (replace-match ",\\1" nil nil nil 1)))
|   org-escape-code-in-region(2921 #<marker at 2908 in picodoc-test.org>)
| 
|   #[(start finish &optional no-escape) "b\210
|    \305Pc\210\nb\210\305Pc\210\f\204\306`\"\210b\210\307 b\210\310
|    \211\207" [end finish beg start no-escape "\n"
|    org-escape-code-in-region point-at-eol point-marker]
|    3]("#+BEGIN_HTML" "#+END_HTML")
| 
|   org-babel-insert-result(nil ("html" "output" "replace") ("picolisp" "
|   ... [omitted] ))
| 
|   org-babel-execute-src-block-maybe()
|   org-babel-execute-maybe()
|   org-babel-execute-safely-maybe()
|   run-hook-with-args-until-success(org-babel-execute-safely-maybe)
|   org-ctrl-c-ctrl-c(nil)
|   call-interactively(org-ctrl-c-ctrl-c nil nil)
`------------------------------------------------------------------------


and the system-info:

,-------------------------------------------------------------------
| Org-mode version 7.9.3e (7.9.3e-897-g787a07 @
| /home/tj/gitclone/org-mode/lisp/)
| 
| GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4) of
| 2013-01-20 on eric
`-------------------------------------------------------------------


-- 
cheers,
Thorsten

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

* Re: Bug in org-src.el?
  2013-02-01 14:55 Bug in org-src.el? Thorsten Jolitz
@ 2013-02-11 14:45 ` Bastien
  2013-02-12 16:19   ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2013-02-11 14:45 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hi Thorsten,

Thorsten Jolitz <tjolitz@googlemail.com> writes:

> when I export a (bit complicated) PicoLisp source block with ':results
> html', I get an error:
>
> ,----------------------------------------------------
> | error: "Invalid search bound (wrong side of point)"
> `----------------------------------------------------

Yes, I've seen this error too sometimes and it was not easy 
to fix when I tried to.

Can you share the minimal code block to reproduce?

Thanks,

-- 
 Bastien

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

* Re: Bug in org-src.el?
  2013-02-11 14:45 ` Bastien
@ 2013-02-12 16:19   ` Thorsten Jolitz
  2013-02-12 16:49     ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Jolitz @ 2013-02-12 16:19 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@altern.org> writes:

Hi Bastien,

> Yes, I've seen this error too sometimes and it was not easy 
> to fix when I tried to.
>
> Can you share the minimal code block to reproduce?

,------------------------------------------
| * org-src.el bug MWE
| 
| #+begin_src picolisp :results output html
| (+ 3 5)
| #+end_src
| 
| #+results:
| #+BEGIN_HTML
| #+END_HTML
`------------------------------------------

,----------------------------------------------------------------------
| executing Picolisp code block...
| executing Picolisp source code block
| Wrote /tmp/babel-81734R/input-817F22
| org-escape-code-in-region: Invalid search bound (wrong side of point)
`----------------------------------------------------------------------

I discovered this with a much more complicated code block, but with some
(not really successfull) debugging I found out that the problem is
simply an empty result string, i.e. this happens when 'results' is '""'.
So its easy to reproduce with any expression that doesn't produce
output.

-- 
cheers,
Thorsten

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

* Re: Bug in org-src.el?
  2013-02-12 16:19   ` Thorsten Jolitz
@ 2013-02-12 16:49     ` Bastien
  0 siblings, 0 replies; 4+ messages in thread
From: Bastien @ 2013-02-12 16:49 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hi Thorsten,

Thorsten Jolitz <tjolitz@gmail.com> writes:

> I discovered this with a much more complicated code block, but with some
> (not really successfull) debugging I found out that the problem is
> simply an empty result string, i.e. this happens when 'results' is '""'.
> So its easy to reproduce with any expression that doesn't produce
> output.

Indeed!  Fixed in master.  Thanks for pushing following up on 
this one, it has been nagging me several times.

Best,

-- 
 Bastien

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

end of thread, other threads:[~2013-02-12 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-01 14:55 Bug in org-src.el? Thorsten Jolitz
2013-02-11 14:45 ` Bastien
2013-02-12 16:19   ` Thorsten Jolitz
2013-02-12 16:49     ` Bastien

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