Re: [O] [bug][babel] #+call: execution broken

2011-11-18 Thread Martyn Jago
Eric Schulte schulte.e...@gmail.com writes:

 Martyn Jago martyn.j...@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.e...@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




[O] [bug][babel] #+call: execution broken

2011-11-17 Thread Martyn Jago
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.e...@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

From 68a64d29222548eff3f414b8881f583f50ea4a96 Mon Sep 17 00:00:00 2001
From: Martyn Jago martyn.j...@btinternet.com
Date: Thu, 17 Nov 2011 12:33:08 +
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



Re: [O] [bug][babel] #+call: execution broken

2011-11-17 Thread Eric Schulte
Martyn Jago martyn.j...@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.e...@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/