[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [bug] Wrong type argument, computation and layout of inline Babe
From: |
Sebastien Vauban |
Subject: |
Re: [O] [bug] Wrong type argument, computation and layout of inline Babel calls |
Date: |
Wed, 14 Jan 2015 20:19:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) |
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=1
>> (* x x)
>> #+end_src
>>
>> ** Good computation, good layout
>>
>> Carré de 6 : *call_square(x=6)[:results raw]*.
>>
>> Carré de 8 : call_square(x=8)[:results raw].
>>
>> ** Bad layout in both HTML and LaTeX
>>
>> Carré de 5 :
>> *call_square(x=5)[:results raw]*.
>>
>> ** Error in HTML (Wrong type argument: arrayp, nil) and bad computation in
>> LaTeX
>>
>> Carré de 7 :
>> call_square(x=7)[: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 (= (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_" nil 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
--
Sebastien Vauban