all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug] Wrong type argument, computation and layout of inline Babel calls
@ 2015-01-14 16:07 Sebastien Vauban
  2015-01-14 18:16 ` Charles C. Berry
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2015-01-14 16:07 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

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

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [bug] Wrong type argument, computation and layout of inline Babel calls
  2015-01-14 16:07 [bug] Wrong type argument, computation and layout of inline Babel calls Sebastien Vauban
@ 2015-01-14 18:16 ` Charles C. Berry
  2015-01-14 19:19   ` Sebastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Charles C. Berry @ 2015-01-14 18:16 UTC (permalink / raw)
  To: Sebastien Vauban, emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1459 bytes --]

Sebastien,

See below.

On Wed, 14 Jan 2015, Sebastien Vauban wrote:

> Hello,
>
> 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,

Chuck

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

* Re: [bug] Wrong type argument, computation and layout of inline Babel calls
  2015-01-14 18:16 ` Charles C. Berry
@ 2015-01-14 19:19   ` Sebastien Vauban
  2015-01-15  3:24     ` Charles C. Berry
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2015-01-14 19:19 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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

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

* Re: [bug] Wrong type argument, computation and layout of inline Babel calls
  2015-01-14 19:19   ` Sebastien Vauban
@ 2015-01-15  3:24     ` Charles C. Berry
  2015-01-15 12:37       ` Sebastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Charles C. Berry @ 2015-01-15  3:24 UTC (permalink / raw)
  To: Sebastien Vauban, emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1828 bytes --]

On Wed, 14 Jan 2015, Sebastien Vauban wrote:

> Hello Charles,
>
> "Charles C. Berry" wrote:
>> On Wed, 14 Jan 2015, Sebastien Vauban wrote:
>>> This ECM exhibits different troubles:

[snip]

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

It does solve the babel-execute part.
But I didn't copy-and-paste that last `.' which affects export.

---

After C-c C-c or org-export-execute-babel-code:

,----
| call_square(x=7)[:results raw] 49.
`----

What this crestes on export is an ordered list with one element whose 
:bullet is followed by an empty paragraph.

A `feature' not a bug?

Note what this yields:

* ordered list

src_emacs-lisp[:results raw]{100}.
src_emacs-lisp[:results raw]{99}.
src_emacs-lisp[:results raw]{98}.
call_square(x=1)[:results raw].


Under ascii backend:

,----
| 1.
| 2.
| 3.
| 4.
`----

HTH,

Chuck

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

* Re: [bug] Wrong type argument, computation and layout of inline Babel calls
  2015-01-15  3:24     ` Charles C. Berry
@ 2015-01-15 12:37       ` Sebastien Vauban
  2015-01-15 17:17         ` Charles C. Berry
  0 siblings, 1 reply; 6+ messages in thread
From: Sebastien Vauban @ 2015-01-15 12:37 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Charles,

"Charles C. Berry" wrote:
> On Wed, 14 Jan 2015, Sebastien Vauban wrote:
>> "Charles C. Berry" wrote:
>>> On Wed, 14 Jan 2015, Sebastien Vauban wrote:
>>>> This ECM exhibits "wrong type argument".
>>>>
>>>> Carré de 7 :
>>>> call_square(x=7)[:results raw].
>>>
>>> Looks like `org-babel-get-lob-one-liner-matches' doesn't always put
>>> point in the right place. Try this [...].
>>
>> 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...
>
> It does solve the babel-execute part.
> But I didn't copy-and-paste that last `.' which affects export.
>
> After C-c C-c or org-export-execute-babel-code:
>
> ,----
> | call_square(x=7)[:results raw] 49.
> `----
>
> What this crestes on export is an ordered list with one element
> whose :bullet is followed by an empty paragraph.
>
> A `feature' not a bug?

OK!  I do understand the problem with the "1." appearing in the LaTeX
document.  Fine by me; there are reasons for that behavior.

Though, there still remains one problem then: the same code generates
a "Wrong type argument: arrayp, nil" error when exporting it to HTML.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [bug] Wrong type argument, computation and layout of inline Babel calls
  2015-01-15 12:37       ` Sebastien Vauban
@ 2015-01-15 17:17         ` Charles C. Berry
  0 siblings, 0 replies; 6+ messages in thread
From: Charles C. Berry @ 2015-01-15 17:17 UTC (permalink / raw)
  To: Sebastien Vauban, emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1214 bytes --]

On Thu, 15 Jan 2015, Sebastien Vauban wrote:

> Hello Charles,
>
> "Charles C. Berry" wrote:
>> On Wed, 14 Jan 2015, Sebastien Vauban wrote:
>>> "Charles C. Berry" wrote:
>>>> On Wed, 14 Jan 2015, Sebastien Vauban wrote:
>>>>> This ECM exhibits "wrong type argument".
>>>>>
>>>>> Carré de 7 :
>>>>> call_square(x=7)[:results raw].
>>>>
>>>> Looks like `org-babel-get-lob-one-liner-matches' doesn't always put
>>>> point in the right place. Try this [...].

[fix deleted]


> OK!  I do understand the problem with the "1." appearing in the LaTeX
> document.  Fine by me; there are reasons for that behavior.
>
> Though, there still remains one problem then: the same code generates
> a "Wrong type argument: arrayp, nil" error when exporting it to HTML.
>

Not for me.

Applying that patch to

   commit e0879b03d08bb4acc663084076370482f61e8698
   Merge: 86588d6 ca21b7b
   Author: Marco Wahl <marcowahlsoft@gmail.com>
   Date:   Mon Jan 12 13:02:20 2015 +0100


and running C-c C-e h H, I get an ordered list:

[...]
<p>
Carré de 7 :
</p>
<ol class="org-ol">
<li></li>
</ol>
[...]


as the result, which seems correct.

And no error message.

Maybe you reset something between running latex and html??

HTH,

Chuck

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

end of thread, other threads:[~2015-01-15 17:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-14 16:07 [bug] Wrong type argument, computation and layout of inline Babel calls Sebastien Vauban
2015-01-14 18:16 ` Charles C. Berry
2015-01-14 19:19   ` Sebastien Vauban
2015-01-15  3:24     ` Charles C. Berry
2015-01-15 12:37       ` Sebastien Vauban
2015-01-15 17:17         ` Charles C. Berry

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.