emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug][babel] #+call: execution broken
@ 2011-11-17 12:44 Martyn Jago
  2011-11-17 16:21 ` Eric Schulte
  0 siblings, 1 reply; 3+ messages in thread
From: Martyn Jago @ 2011-11-17 12:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

Hi

C-c C-c on a #+call: block() statement no longer causes the block to
execute.

This regression occurred on Nov 8th:

commit a4273cbe0e0480bd02c59464cafb985951b1c5a2
Author: Eric Schulte <schulte.eric@gmail.com>
Date:   Tue Nov 8 19:42:59 2011 -0700
call lines are more careful about being in example or verbatim blocks
    
I've supplied a patch which provides a couple of failing tests which
highlight the problem.

Best, Martyn


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Tests for testing basic `#+call: --]
[-- Type: text/x-patch, Size: 1692 bytes --]

From 68a64d29222548eff3f414b8881f583f50ea4a96 Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Thu, 17 Nov 2011 12:33:08 +0000
Subject: [PATCH] Tests for testing basic `#+call: block-name()' actually cause block execution
 * testing/lisp/test-ob.el:

---
 testing/lisp/test-ob.el |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index d145f4e..3fefe91 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -499,4 +499,42 @@ on two lines
 
 (provide 'test-ob)
 
+(ert-deftest test-org-babel/basic-call-execution-bol()
+    "Test that executing #+call: with point on # executes the block"
+  (org-test-with-temp-text
+   "
+#+call: my-test()
+#+srcname: my-test
+#+begin_src emacs-lisp 
+  (+ 2 3)
+#+end_src "
+
+   (should (search-forward "#+call:"))
+   (beginning-of-line)
+   (org-ctrl-c-ctrl-c)
+   (should (search-forward "#+results: my-test()"))
+   (forward-line)
+   (should (string= ": 5"
+		    (buffer-substring-no-properties
+		     (point-at-bol) (point-at-eol))))))
+
+(ert-deftest test-org-babel/basic-call-execution-eol()
+    "Test that executing #+call: with point at eol executes the block"
+  (org-test-with-temp-text
+   "
+#+call: my-test()
+#+srcname: my-test
+#+begin_src emacs-lisp 
+  (* 2 3)
+#+end_src "
+
+   (should (search-forward "#+call:"))
+   (end-of-line)
+   (org-ctrl-c-ctrl-c)
+   (should (search-forward "#+results: my-test()"))
+   (forward-line)
+   (should (string= ": 6"
+		    (buffer-substring-no-properties
+		     (point-at-bol) (point-at-eol))))))
+
 ;;; test-ob ends here
-- 
1.7.3.4


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

* Re: [bug][babel] #+call: execution broken
  2011-11-17 12:44 [bug][babel] #+call: execution broken Martyn Jago
@ 2011-11-17 16:21 ` Eric Schulte
  2011-11-18  8:03   ` Martyn Jago
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Schulte @ 2011-11-17 16:21 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Martyn Jago <martyn.jago@btinternet.com> writes:

> Hi
>
> C-c C-c on a #+call: block() statement no longer causes the block to
> execute.
>
> This regression occurred on Nov 8th:
>
> commit a4273cbe0e0480bd02c59464cafb985951b1c5a2
> Author: Eric Schulte <schulte.eric@gmail.com>
> Date:   Tue Nov 8 19:42:59 2011 -0700
> call lines are more careful about being in example or verbatim blocks
>     
> I've supplied a patch which provides a couple of failing tests which
> highlight the problem.
>

Hi Martyn,

The reason that your tests are failing is because they use the old
"#+srcname:" rather than the new "#+name:" syntax for naming a code
block.

After making this change both tests pass.

Cheers -- Eric

>
> Best, Martyn
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

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

* Re: [bug][babel] #+call: execution broken
  2011-11-17 16:21 ` Eric Schulte
@ 2011-11-18  8:03   ` Martyn Jago
  0 siblings, 0 replies; 3+ messages in thread
From: Martyn Jago @ 2011-11-18  8:03 UTC (permalink / raw)
  To: emacs-orgmode

Eric Schulte <schulte.eric@gmail.com> writes:

> Martyn Jago <martyn.jago@btinternet.com> writes:
>
>> Hi
>>
>> C-c C-c on a #+call: block() statement no longer causes the block to
>> execute.
>>
>> This regression occurred on Nov 8th:
>>
>> commit a4273cbe0e0480bd02c59464cafb985951b1c5a2
>> Author: Eric Schulte <schulte.eric@gmail.com>
>> Date:   Tue Nov 8 19:42:59 2011 -0700
>> call lines are more careful about being in example or verbatim blocks
>>     
>> I've supplied a patch which provides a couple of failing tests which
>> highlight the problem.
>>
>
> Hi Martyn,
>
> The reason that your tests are failing is because they use the old
> "#+srcname:" rather than the new "#+name:" syntax for naming a code
> block.
>
> After making this change both tests pass.
>

Doh! Clearly I need to keep up with the times.

Best, Martyn

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

end of thread, other threads:[~2011-11-18  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 12:44 [bug][babel] #+call: execution broken Martyn Jago
2011-11-17 16:21 ` Eric Schulte
2011-11-18  8:03   ` Martyn Jago

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