From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: [bug] Wrong type argument, computation and layout of inline Babel calls Date: Wed, 14 Jan 2015 20:19:03 +0100 Message-ID: <86iog95fx4.fsf@example.com> References: <86twztqral.fsf@example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello Charles, "Charles C. Berry" wrote: > On Wed, 14 Jan 2015, Sebastien Vauban wrote: >> This ECM exhibits different troubles: >> >> - error when exporting to HTML >> - bad layout >> - bad computation >> >> --8<---------------cut here---------------start------------->8--- >> * Square >> >> #+name: square >> #+begin_src emacs-lisp :tangle no :var x=3D1 >> (* x x) >> #+end_src >> >> ** Good computation, good layout >> >> Carr=C3=A9 de 6 : *call_square(x=3D6)[:results raw]*. >> >> Carr=C3=A9 de 8 : call_square(x=3D8)[:results raw]. >> >> ** Bad layout in both HTML and LaTeX >> >> Carr=C3=A9 de 5 : >> *call_square(x=3D5)[:results raw]*. >> >> ** Error in HTML (Wrong type argument: arrayp, nil) and bad computation = in LaTeX >> >> Carr=C3=A9 de 7 : >> call_square(x=3D7)[:results raw]. >> --8<---------------cut here---------------end--------------->8--- > > Looks like `org-babel-get-lob-one-liner-matches' doesn't always put > point in the right place. Try this: > > ,---- > | diff --git a/lisp/ob-core.el b/lisp/ob-core.el > | index 80542ec..47fcaca 100644 > | --- a/lisp/ob-core.el > | +++ b/lisp/ob-core.el > | @@ -251,7 +251,7 @@ Returns non-nil if match-data set" > | Returns non-nil if match-data set" > | (save-excursion > | (unless (=3D (point) (point-at-bol)) ;; move before inline block > | - (re-search-backward "[ \f\t\n\r\v]" nil t)) > | + (re-search-backward "\\([^[:alnum:]]\\|[ \f\t\n\r\v]\\)call_" ni= l t)) > | (if (looking-at org-babel-inline-lob-one-liner-regexp) > | t > | nil))) > `---- > > HTH, It does solve the "square of 5" problem, in both HTML and LaTeX. Thanks. Though, it does not solve anything regarding the last one ("square of 7"): error in HTML, and results "1" in LaTeX... Best regards, Seb --=20 Sebastien Vauban