emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fixes to inline src block execution
@ 2011-09-05 22:43 Martyn Jago
  2011-09-06  3:31 ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Martyn Jago @ 2011-09-05 22:43 UTC (permalink / raw)
  To: emacs-orgmode

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


Hi

Some fixes to inline src block execution via org-ctrl-c-ctrl-c
where point is beyond white-space in the inline src block body...

* Start Pomodoro
 #src_emacs-lisp[:results silent]{( org-timer-set-timer 25 )} 
                         ^
,------------------------'
| C-c C-c execution
| was broken beyond 
| here
`------------------

Also fixes to inline src block execution where the inline src block 
happens to be on the first line of a buffer. 

I've included tests and test data.

Regards

Martyn


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fixes to inline src block execution --]
[-- Type: text/x-patch, Size: 6140 bytes --]

From b559789474920f0471f5844b4675be67a74a8283 Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Mon, 5 Sep 2011 22:53:07 +0100
Subject: [PATCH] Bug fixes to inline source block execution triggering.
 * lisp/ob.el: Created org-babel-get-inline-src-block-matches() to fix
 problems with org-ctrl-c-ctrl-c not triggering inline src block
 execution when point is on or after a space within the inline src
 block body. Also fixed execution problems where inline src block is on
 buffer line 1.
 * testing/examples/babel.org: Test data for
 org-babel-get-inline-src-block-matches()

* testing/lisp/test-ob.el: Tests for
  org-babel-get-inline-src-block-matches()
---
 lisp/ob.el                 |   48 ++++++++++++++++++++++++++++++++++---------
 testing/examples/babel.org |    9 ++++++++
 testing/lisp/test-ob.el    |   23 +++++++++++++++++++++
 3 files changed, 70 insertions(+), 10 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index e424ff1..2964f82 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -159,6 +159,39 @@ not match KEY should be returned."
 	 (lambda (p) (when (funcall (if others #'not #'identity) (eq (car p) key)) p))
 	 params)))
 
+(defun org-babel-get-inline-src-block-matches()
+  "Set match data if within body of an inline source block.
+Returns non-nil if match-data set"
+  (let ((src-at-0-p (save-excursion
+		      (beginning-of-line 1)
+		      (string= "src" (thing-at-point 'word))))
+	(first-line-p (= 1 (line-number-at-pos)))
+      (orig (point)))
+    (let ((search-for (cond (src-at-0-p "src_")
+			    (first-line-p " src_")
+			    (t "[ \f\t\n\r\v]src_")))
+	  (lower-limit (if (= 1 (line-number-at-pos))
+			   nil
+			 (- (point-at-bol) 1))))
+      (save-excursion
+	(when (or (and src-at-0-p (bobp))
+		  (and (re-search-forward "}" (point-at-eol) t)
+		       (re-search-backward search-for lower-limit t)
+		       (> orig (point))))
+	  (when (looking-at org-babel-inline-src-block-regexp)
+	    t ))))))
+
+(defun org-babel-get-lob-one-liner-matches()
+  "Set match data if on line of an lob one liner.
+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))
+    (if (looking-at org-babel-inline-lob-one-liner-regexp)
+	t
+      nil)))
+
 (defun org-babel-get-src-block-info (&optional light)
   "Get information on the current source block.
 
@@ -191,8 +224,7 @@ Returns a list
 			     (org-babel-ref-split-args (match-string 6)))
 		     (nth 2 info))))))
       ;; inline source block
-      (when (save-excursion (re-search-backward "[ \f\t\n\r\v]" nil t)
-			    (looking-at org-babel-inline-src-block-regexp))
+      (when (org-babel-get-inline-src-block-matches)
 	(setq info (org-babel-parse-inline-src-block-match))))
     ;; resolve variable references and add summary parameters
     (when (and info (not light))
@@ -1387,10 +1419,8 @@ following the source block."
     (let* ((on-lob-line (save-excursion
 			  (beginning-of-line 1)
 			  (looking-at org-babel-lob-one-liner-regexp)))
-	   (inlinep (save-excursion
-		      (re-search-backward "[ \f\t\n\r\v]" nil t)
-		      (when (looking-at org-babel-inline-src-block-regexp)
-			(match-end 0))))
+	   (inlinep (when (org-babel-get-inline-src-block-matches)
+			(match-end 0)))
 	   (name (if on-lob-line
 		     (nth 0 (org-babel-lob-get-info))
 		   (nth 4 (or info (org-babel-get-src-block-info 'light)))))
@@ -1578,10 +1608,8 @@ code ---- the results are extracted in the syntax of the source
     (save-excursion
       (let* ((inlinep
 	      (save-excursion
-		(unless (= (point) (point-at-bol)) ;; move before inline block
-		  (re-search-backward "[ \f\t\n\r\v]" nil t))
-		(when (or (looking-at org-babel-inline-src-block-regexp)
-			  (looking-at org-babel-inline-lob-one-liner-regexp))
+		(when (or (org-babel-get-inline-src-block-matches)
+			  (org-babel-get-lob-one-liner-matches))
 		  (goto-char (match-end 0))
 		  (insert (if (listp result) "\n" " "))
 		  (point))))
diff --git a/testing/examples/babel.org b/testing/examples/babel.org
index 3dc603d..f85e1f0 100644
--- a/testing/examples/babel.org
+++ b/testing/examples/babel.org
@@ -279,3 +279,12 @@ this is simple
    :ID:       d4faa7b3-072b-4dcf-813c-dd7141c633f3
    :END:
 has length 14
+* org-babel-get-inline-src-block-matches
+  :PROPERTIES:  
+  :results:  silent
+  :ID:       0D0983D4-DE33-400A-8A05-A225A567BC74
+  :END:
+src_sh{echo "One"} block at start of line
+ One spaced block in  src_sh{ echo "middle" } of line 
+src_sh{echo 2} blocks on the src_emacs-lisp{"same"} line
+ Inline block with src_sh[:results silent]{ echo "parameters" }.
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index dbc7dbd..71ea7e2 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -223,6 +223,29 @@
       (next) (should (equal 2 (org-babel-execute-src-block)))
       (next) (should (equal 3 (org-babel-execute-src-block))))))
 
+(ert-deftest test-org-babel/org-babel-get-inline-src-block-matches ()
+  (org-test-at-id "0D0983D4-DE33-400A-8A05-A225A567BC74"
+    (should (fboundp 'org-babel-get-inline-src-block-matches))
+    (should (re-search-forward "src_" nil t)) ;; 1
+    (should (= 6132 (match-end 0)))
+    (should (org-babel-get-inline-src-block-matches))
+    (should (re-search-forward "}" nil (point-at-bol))) ;; 1
+    (should-not (org-babel-get-inline-src-block-matches))
+    (should (re-search-forward "in" nil t)) ;; 2
+    (should-not (org-babel-get-inline-src-block-matches))
+    (should (re-search-forward "echo" nil t)) ;; 2
+    (should (org-babel-get-inline-src-block-matches))
+    (should (re-search-forward "blocks" nil t)) ;; 3
+    (left-char 8) ;; 3
+    (should (org-babel-get-inline-src-block-matches))
+    (right-char 1) ;;3
+    (should-not (org-babel-get-inline-src-block-matches))
+    (should (re-search-forward ":results" nil t)) ;; 4
+    (should (org-babel-get-inline-src-block-matches))
+    (end-of-line)
+    (should-not (org-babel-get-inline-src-block-matches))
+    ))
+
 (provide 'test-ob)
 
 ;;; test-ob ends here
-- 
1.7.3.4


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

* Re: [PATCH] Fixes to inline src block execution
  2011-09-05 22:43 [PATCH] Fixes to inline src block execution Martyn Jago
@ 2011-09-06  3:31 ` Eric Schulte
  2011-09-06  8:19   ` Martyn Jago
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2011-09-06  3:31 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

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

> Hi
>
> Some fixes to inline src block execution via org-ctrl-c-ctrl-c
> where point is beyond white-space in the inline src block body...
>
> * Start Pomodoro
>  #src_emacs-lisp[:results silent]{( org-timer-set-timer 25 )} 
>                          ^
> ,------------------------'
> | C-c C-c execution
> | was broken beyond 
> | here
> `------------------
>
> Also fixes to inline src block execution where the inline src block 
> happens to be on the first line of a buffer. 
>
> I've included tests and test data.
>

Hi Martyn,

This looks great.  I would like to apply this patch but it breaks unit
tests at least one of which existed previously and was passing.  Would
you mind taking a look at these unit tests to see if your patch breaks
existing behavior?

,----[ert output from `org-test-run-all-tests']
| F test-org-babel/inline-src-blocks
|     (wrong-type-argument consp nil)
| 
| F test-org-babel/org-babel-get-inline-src-block-matches
|     (ert-test-failed
|      ((should
|        (org-babel-get-inline-src-block-matches))
|       :form
|       (org-babel-get-inline-src-block-matches)
|       :value nil))
| 
| F test-org-babel/parse-header-args
|     (ert-test-failed
|      ((should
|        (= 14
|           (org-babel-execute-src-block)))
|       :form
|       (= 14 13)
|       :value nil))
`----

Thanks! -- Eric

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

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

* Re: [PATCH] Fixes to inline src block execution
  2011-09-06  3:31 ` Eric Schulte
@ 2011-09-06  8:19   ` Martyn Jago
  2011-09-06 15:12     ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Martyn Jago @ 2011-09-06  8:19 UTC (permalink / raw)
  To: emacs-orgmode

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

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

Hi Eric

> Martyn Jago <martyn.jago@btinternet.com> writes:
>
>> Hi
>>
>> Some fixes to inline src block execution via org-ctrl-c-ctrl-c
>> where point is beyond white-space in the inline src block body...
>>
>> * Start Pomodoro
>>  src_emacs-lisp[:results silent]{( org-timer-set-timer 25 )} 

[...]

> This looks great.  I would like to apply this patch but it breaks unit
> tests at least one of which existed previously and was passing.  Would
> you mind taking a look at these unit tests to see if your patch breaks
> existing behavior?

Yes my bad - even my supplied tests failed (it was very late). I've fixed 
my code and fixed a failing test due to a previous regression.

All tests now pass here on Mac OSX

[...]

Regards

Martyn


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix to ob.el, fix to test, test refactor --]
[-- Type: text/x-patch, Size: 4884 bytes --]

From 3dacd351550ec691beb49c1560ce247033711a76 Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Tue, 6 Sep 2011 09:00:24 +0100
Subject: [PATCH] Inline source block and test fixes
 * lisp/ob.el: Fixed late night refactoring error
 * testing/examples/babel.org: whitespace
 * testing/lisp/test-ob.el:
 Fixed test-org-babel/inline-src-block-regexp (regression error)
 Renamed test-org-babel/parse-header-args2 since duplicate test heading
 Made test-org-babel/parse-header-args less brittle

---
 lisp/ob.el                 |    8 +++---
 testing/examples/babel.org |    1 +
 testing/lisp/test-ob.el    |   45 ++++++++++++++++++++++---------------------
 3 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/lisp/ob.el b/lisp/ob.el
index 2964f82..d6b0ba3 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -166,11 +166,11 @@ Returns non-nil if match-data set"
 		      (beginning-of-line 1)
 		      (string= "src" (thing-at-point 'word))))
 	(first-line-p (= 1 (line-number-at-pos)))
-      (orig (point)))
-    (let ((search-for (cond (src-at-0-p "src_")
-			    (first-line-p " src_")
+	(orig (point)))
+    (let ((search-for (cond ((and src-at-0-p first-line-p  "src_"))
+			    (first-line-p "[ \t]src_")
 			    (t "[ \f\t\n\r\v]src_")))
-	  (lower-limit (if (= 1 (line-number-at-pos))
+	  (lower-limit (if first-line-p
 			   nil
 			 (- (point-at-bol) 1))))
       (save-excursion
diff --git a/testing/examples/babel.org b/testing/examples/babel.org
index f85e1f0..5b7f2ef 100644
--- a/testing/examples/babel.org
+++ b/testing/examples/babel.org
@@ -279,6 +279,7 @@ this is simple
    :ID:       d4faa7b3-072b-4dcf-813c-dd7141c633f3
    :END:
 has length 14
+
 * org-babel-get-inline-src-block-matches
   :PROPERTIES:  
   :results:  silent
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 71ea7e2..f9884dd 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -108,7 +108,7 @@
 
 
 (ert-deftest test-org-babel/inline-src-block-regexp ()
-  (should(equal (concat "[^-[:alnum:]]\\(src_\\([^ \f\t\n\r\v]+\\)"
+  (should(equal (concat "\\(?:^\\|[^-[:alnum:]]\\)\\(src_\\([^ \f\t\n\r\v]+\\)"
 			"\\(\\|\\[\\(.*?\\)\\]\\)"
 			"{\\([^\f\n\r\v]+?\\)}\\)")
 		org-babel-inline-src-block-regexp))
@@ -206,7 +206,7 @@
       (should(equal '(:result-type . output) (assoc :result-type params)))
       (should(equal '(num . 9) (cdr (assoc :var params)))))))
 
-(ert-deftest test-org-babel/parse-header-args ()
+(ert-deftest test-org-babel/parse-header-args2 ()
   (org-test-at-id "2409e8ba-7b5f-4678-8888-e48aa02d8cb4"
     (should (string-match (regexp-quote "this is simple")
 			  (org-babel-ref-resolve "simple-subtree")))
@@ -225,26 +225,27 @@
 
 (ert-deftest test-org-babel/org-babel-get-inline-src-block-matches ()
   (org-test-at-id "0D0983D4-DE33-400A-8A05-A225A567BC74"
-    (should (fboundp 'org-babel-get-inline-src-block-matches))
-    (should (re-search-forward "src_" nil t)) ;; 1
-    (should (= 6132 (match-end 0)))
-    (should (org-babel-get-inline-src-block-matches))
-    (should (re-search-forward "}" nil (point-at-bol))) ;; 1
-    (should-not (org-babel-get-inline-src-block-matches))
-    (should (re-search-forward "in" nil t)) ;; 2
-    (should-not (org-babel-get-inline-src-block-matches))
-    (should (re-search-forward "echo" nil t)) ;; 2
-    (should (org-babel-get-inline-src-block-matches))
-    (should (re-search-forward "blocks" nil t)) ;; 3
-    (left-char 8) ;; 3
-    (should (org-babel-get-inline-src-block-matches))
-    (right-char 1) ;;3
-    (should-not (org-babel-get-inline-src-block-matches))
-    (should (re-search-forward ":results" nil t)) ;; 4
-    (should (org-babel-get-inline-src-block-matches))
-    (end-of-line)
-    (should-not (org-babel-get-inline-src-block-matches))
-    ))
+    (let ((test-point (point)))
+      (should (fboundp 'org-babel-get-inline-src-block-matches))
+      (should (re-search-forward "src_" nil t)) ;; 1
+      (should (= (+ test-point 140) (match-end 0)))
+      (should (org-babel-get-inline-src-block-matches))
+      (should (re-search-forward "}" nil (point-at-bol))) ;; 1
+      (should-not (org-babel-get-inline-src-block-matches))
+      (should (re-search-forward "in" nil t)) ;; 2
+      (should-not (org-babel-get-inline-src-block-matches))
+      (should (re-search-forward "echo" nil t)) ;; 2
+      (should (org-babel-get-inline-src-block-matches))
+      (should (re-search-forward "blocks" nil t)) ;; 3
+      (left-char 8) ;; 3
+      (should (org-babel-get-inline-src-block-matches))
+      (right-char 1) ;;3
+      (should-not (org-babel-get-inline-src-block-matches))
+      (should (re-search-forward ":results" nil t)) ;; 4
+      (should (org-babel-get-inline-src-block-matches))
+      (end-of-line)
+      (should-not (org-babel-get-inline-src-block-matches))
+    )))
 
 (provide 'test-ob)
 
-- 
1.7.3.4


[-- Attachment #3: Type: text/plain, Size: 140 bytes --]



---
Org-mode version 7.7
GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
 of 2011-08-21 on virtualmac.porkrind.org





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

* Re: [PATCH] Fixes to inline src block execution
  2011-09-06  8:19   ` Martyn Jago
@ 2011-09-06 15:12     ` Eric Schulte
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2011-09-06 15:12 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Hi Martyn,

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

> Eric Schulte <schulte.eric@gmail.com> writes:
>
> Hi Eric
>
>> Martyn Jago <martyn.jago@btinternet.com> writes:
>>
>>> Hi
>>>
>>> Some fixes to inline src block execution via org-ctrl-c-ctrl-c
>>> where point is beyond white-space in the inline src block body...
>>>
>>> * Start Pomodoro
>>>  src_emacs-lisp[:results silent]{( org-timer-set-timer 25 )} 
>
> [...]
>
>> This looks great.  I would like to apply this patch but it breaks unit
>> tests at least one of which existed previously and was passing.  Would
>> you mind taking a look at these unit tests to see if your patch breaks
>> existing behavior?
>
> Yes my bad - even my supplied tests failed (it was very late). I've fixed 
> my code and fixed a failing test due to a previous regression.
>
> All tests now pass here on Mac OSX
>

Confirmed, everything is passing for me as well on Ubuntu.  Thanks for
the contribution and thanks for the unit tests.  These patches have now
been applied.

Cheers -- Eric

>
> [...]
>
> Regards
>
> Martyn
>
> From 3dacd351550ec691beb49c1560ce247033711a76 Mon Sep 17 00:00:00 2001
> From: Martyn Jago <martyn.jago@btinternet.com>
> Date: Tue, 6 Sep 2011 09:00:24 +0100
> Subject: [PATCH] Inline source block and test fixes
>  * lisp/ob.el: Fixed late night refactoring error
>  * testing/examples/babel.org: whitespace
>  * testing/lisp/test-ob.el:
>  Fixed test-org-babel/inline-src-block-regexp (regression error)
>  Renamed test-org-babel/parse-header-args2 since duplicate test heading
>  Made test-org-babel/parse-header-args less brittle
>
> ---
>  lisp/ob.el                 |    8 +++---
>  testing/examples/babel.org |    1 +
>  testing/lisp/test-ob.el    |   45 ++++++++++++++++++++++---------------------
>  3 files changed, 28 insertions(+), 26 deletions(-)
>
> diff --git a/lisp/ob.el b/lisp/ob.el
> index 2964f82..d6b0ba3 100644
> --- a/lisp/ob.el
> +++ b/lisp/ob.el
> @@ -166,11 +166,11 @@ Returns non-nil if match-data set"
>  		      (beginning-of-line 1)
>  		      (string= "src" (thing-at-point 'word))))
>  	(first-line-p (= 1 (line-number-at-pos)))
> -      (orig (point)))
> -    (let ((search-for (cond (src-at-0-p "src_")
> -			    (first-line-p " src_")
> +	(orig (point)))
> +    (let ((search-for (cond ((and src-at-0-p first-line-p  "src_"))
> +			    (first-line-p "[ \t]src_")
>  			    (t "[ \f\t\n\r\v]src_")))
> -	  (lower-limit (if (= 1 (line-number-at-pos))
> +	  (lower-limit (if first-line-p
>  			   nil
>  			 (- (point-at-bol) 1))))
>        (save-excursion
> diff --git a/testing/examples/babel.org b/testing/examples/babel.org
> index f85e1f0..5b7f2ef 100644
> --- a/testing/examples/babel.org
> +++ b/testing/examples/babel.org
> @@ -279,6 +279,7 @@ this is simple
>     :ID:       d4faa7b3-072b-4dcf-813c-dd7141c633f3
>     :END:
>  has length 14
> +
>  * org-babel-get-inline-src-block-matches
>    :PROPERTIES:  
>    :results:  silent
> diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
> index 71ea7e2..f9884dd 100644
> --- a/testing/lisp/test-ob.el
> +++ b/testing/lisp/test-ob.el
> @@ -108,7 +108,7 @@
>  
>  
>  (ert-deftest test-org-babel/inline-src-block-regexp ()
> -  (should(equal (concat "[^-[:alnum:]]\\(src_\\([^ \f\t\n\r\v]+\\)"
> +  (should(equal (concat "\\(?:^\\|[^-[:alnum:]]\\)\\(src_\\([^ \f\t\n\r\v]+\\)"
>  			"\\(\\|\\[\\(.*?\\)\\]\\)"
>  			"{\\([^\f\n\r\v]+?\\)}\\)")
>  		org-babel-inline-src-block-regexp))
> @@ -206,7 +206,7 @@
>        (should(equal '(:result-type . output) (assoc :result-type params)))
>        (should(equal '(num . 9) (cdr (assoc :var params)))))))
>  
> -(ert-deftest test-org-babel/parse-header-args ()
> +(ert-deftest test-org-babel/parse-header-args2 ()
>    (org-test-at-id "2409e8ba-7b5f-4678-8888-e48aa02d8cb4"
>      (should (string-match (regexp-quote "this is simple")
>  			  (org-babel-ref-resolve "simple-subtree")))
> @@ -225,26 +225,27 @@
>  
>  (ert-deftest test-org-babel/org-babel-get-inline-src-block-matches ()
>    (org-test-at-id "0D0983D4-DE33-400A-8A05-A225A567BC74"
> -    (should (fboundp 'org-babel-get-inline-src-block-matches))
> -    (should (re-search-forward "src_" nil t)) ;; 1
> -    (should (= 6132 (match-end 0)))
> -    (should (org-babel-get-inline-src-block-matches))
> -    (should (re-search-forward "}" nil (point-at-bol))) ;; 1
> -    (should-not (org-babel-get-inline-src-block-matches))
> -    (should (re-search-forward "in" nil t)) ;; 2
> -    (should-not (org-babel-get-inline-src-block-matches))
> -    (should (re-search-forward "echo" nil t)) ;; 2
> -    (should (org-babel-get-inline-src-block-matches))
> -    (should (re-search-forward "blocks" nil t)) ;; 3
> -    (left-char 8) ;; 3
> -    (should (org-babel-get-inline-src-block-matches))
> -    (right-char 1) ;;3
> -    (should-not (org-babel-get-inline-src-block-matches))
> -    (should (re-search-forward ":results" nil t)) ;; 4
> -    (should (org-babel-get-inline-src-block-matches))
> -    (end-of-line)
> -    (should-not (org-babel-get-inline-src-block-matches))
> -    ))
> +    (let ((test-point (point)))
> +      (should (fboundp 'org-babel-get-inline-src-block-matches))
> +      (should (re-search-forward "src_" nil t)) ;; 1
> +      (should (= (+ test-point 140) (match-end 0)))
> +      (should (org-babel-get-inline-src-block-matches))
> +      (should (re-search-forward "}" nil (point-at-bol))) ;; 1
> +      (should-not (org-babel-get-inline-src-block-matches))
> +      (should (re-search-forward "in" nil t)) ;; 2
> +      (should-not (org-babel-get-inline-src-block-matches))
> +      (should (re-search-forward "echo" nil t)) ;; 2
> +      (should (org-babel-get-inline-src-block-matches))
> +      (should (re-search-forward "blocks" nil t)) ;; 3
> +      (left-char 8) ;; 3
> +      (should (org-babel-get-inline-src-block-matches))
> +      (right-char 1) ;;3
> +      (should-not (org-babel-get-inline-src-block-matches))
> +      (should (re-search-forward ":results" nil t)) ;; 4
> +      (should (org-babel-get-inline-src-block-matches))
> +      (end-of-line)
> +      (should-not (org-babel-get-inline-src-block-matches))
> +    )))
>  
>  (provide 'test-ob)

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

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

end of thread, other threads:[~2011-09-06 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-05 22:43 [PATCH] Fixes to inline src block execution Martyn Jago
2011-09-06  3:31 ` Eric Schulte
2011-09-06  8:19   ` Martyn Jago
2011-09-06 15:12     ` Eric Schulte

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