emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] [PATCH]
@ 2011-02-25 13:50 Martyn Jago
  2011-02-27 22:02 ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Martyn Jago @ 2011-02-25 13:50 UTC (permalink / raw)
  To: emacs-orgmode

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


Hi Babel

I've been working on an exporter and have come across some strange
behaviour regarding 'empty' source blocks with regard to tangling.

If an attempt is made to tangle a block containing two blank (no
white-space) lines, the block is exported as carriage returns (as I
would expect).

If a block contains one or no blank lines, the #+end_src tag appears to
be consumed by the block (along with subsequent text upto the next
#+end_src tag).

I tracked this down to the org-babel-src-block-regexp variable in ob.el
and have modified it to give what appears to be consistent behaviour.

I also found the following unresolved bug report which may be related...

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg29992.html

I've included a simple test file, and resultant tangled files before and
after the patch to attempt to convey the problem.

NOTE: Since the patch itself modifies a defvar, and since I'm not clear
on how a patched defvar should be updated downstream, the patch includes a
setq statement to update the defvar org-babel-src-block-regexp for test
purposes. The patch cannot therefore be applied as is.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: empty-block-tangle-test.org --]
[-- Type: text/x-org, Size: 1441 bytes --]


* Empty Block Tangle Test
** Typical Execution

#+BEGIN_SRC emacs-lisp :tangle no

(org-babel-tangle) ; or org-babel-tangle-file "empty-block.org"

#+END_SRC

#+results:
| test-out |

** Tests
*** Block 1 (Exports OK)

#+BEGIN_SRC sh :tangle test-out
Block 1
#+END_SRC

*** Block 2 (Exports OK - double blank line no white-space in Block)

#+BEGIN_SRC sh :tangle test-out


#+END_SRC

*** Block 3 (Fails - single blank line no white-space in Block)

#+BEGIN_SRC sh :tangle test-out

#+END_SRC

*** Block 4 (Gets consumed by previous Block)

#+BEGIN_SRC sh :tangle test-out
Block 4
#+END_SRC

*** Block 5 (Fails - no lines in Block)

#+BEGIN_SRC sh :tangle test-out
#+END_SRC

*** Block 6 (Gets consumed by previous Block

#+BEGIN_SRC sh :tangle test-out
Block 6
#+END_SRC

*** Block 7 (Exports OK)

#+BEGIN_SRC sh :tangle test-out
Block 7
#+END_SRC

** List params
#+begin_src emacs-lisp 
  (sort* (mapcar (lambda (x)
   (list (car x) (cdr x)))
     params) 'string-lessp :key 'car)
#+end_src

#+results:
| :cache         | no        |
| :colname-names | nil       |
| :colnames      | no        |
| :comments      |           |
| :exports       | results   |
| :hlines        | yes       |
| :noweb         | no        |
| :result-params | (replace) |
| :result-type   | value     |
| :results       | replace   |
| :rowname-names | nil       |
| :session       | none      |
| :shebang       |           |
| :tangle        | test-out  |


[-- Attachment #3: test-out-pre-patch --]
[-- Type: application/octet-stream, Size: 217 bytes --]


Block 1



#+END_SRC

*** Block 4 (Gets consumed by previous Block)

#+BEGIN_SRC sh :tangle test-out
Block 4

#+END_SRC

*** Block 6 (Gets consumed by previous Block

#+BEGIN_SRC sh :tangle test-out
Block 6

Block 7

[-- Attachment #4: test-out-post-patch --]
[-- Type: application/octet-stream, Size: 42 bytes --]


Block 1





Block 4



Block 6

Block 7

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: org-babel-src-block-regexp --]
[-- Type: text/x-diff, Size: 818 bytes --]

diff --git a/lisp/ob.el b/lisp/ob.el
index 6e98263..6d2f0d0 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -138,9 +138,20 @@ remove code block execution from the C-c C-c keybinding."
    ;; (4) header arguments
    "\\([^\n]*\\)\n"
    ;; (5) body
-   "\\([^\000]+?\n\\)[ \t]*#\\+end_src")
+   "\\([^\000]*?\n*\\)[ \t]*#\\+end_src")
   "Regexp used to identify code blocks.")
 
+(setq org-babel-src-block-regexp
+  (concat
+   ;; (1) indentation                     (2) lang
+   "^\\([ \t]*\\)#\\+begin_src[ \t]+\\([^ \f\t\n\r\v]+\\)[ \t]*"
+   ;; (3) switches
+   "\\([^\":\n]*\"[^\"\n*]*\"[^\":\n]*\\|[^\":\n]*\\)"
+   ;; (4) header arguments
+   "\\([^\n]*\\)\n"
+   ;; (5) body
+   "\\([^\000]*?\n*\\)[ \t]*#\\+end_src"))
+
 (defvar org-babel-inline-src-block-regexp
   (concat
    ;; (1) replacement target (2) lang

[-- Attachment #6: Type: text/plain, Size: 144 bytes --]


Regards

Martyn

---
Org-mode version 7.4 (release_7.4.529.gb23d)
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
 of 2011-02-25 

[-- Attachment #7: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] [PATCH]
  2011-02-25 13:50 [babel] [PATCH] Martyn Jago
@ 2011-02-27 22:02 ` Eric Schulte
  2011-02-28 21:11   ` Martyn Jago
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Schulte @ 2011-02-27 22:02 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

Hi Martyn,

Thanks for this patch and for the very nice test file, I've just applied
it along with a related patch in org-exp-blocks.el.

Even with the patch applied I am still seeing undesirable behavior when
exporting the test file.  I believe this is due to upstream processing
of the blocks by the rest of org-mode, as the buffer *after* org-mode
processing looks like this [1]

Thanks -- Eric

ps.  Now that you are signed up as an Org-mode contributor you could
start sending patches using the git format-patch utility, i.e.,

  git format-patch -o ~/Desktop/ HEAD~1

will output a patch file to your desktop holding your last committed
change.  This would allow me to more easily apply your patches, and will
ensure that you get authorship credit in the git logs.

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

> Hi Babel
>
> I've been working on an exporter and have come across some strange
> behaviour regarding 'empty' source blocks with regard to tangling.
>
> If an attempt is made to tangle a block containing two blank (no
> white-space) lines, the block is exported as carriage returns (as I
> would expect).
>
> If a block contains one or no blank lines, the #+end_src tag appears to
> be consumed by the block (along with subsequent text upto the next
> #+end_src tag).
>
> I tracked this down to the org-babel-src-block-regexp variable in ob.el
> and have modified it to give what appears to be consistent behaviour.
>
> I also found the following unresolved bug report which may be related...
>
> http://www.mail-archive.com/emacs-orgmode@gnu.org/msg29992.html
>
> I've included a simple test file, and resultant tangled files before and
> after the patch to attempt to convey the problem.
>
> NOTE: Since the patch itself modifies a defvar, and since I'm not clear
> on how a patched defvar should be updated downstream, the patch includes a
> setq statement to update the defvar org-babel-src-block-regexp for test
> purposes. The patch cannot therefore be applied as is.
>
>
> * Empty Block Tangle Test
> ** Typical Execution
>
> #+BEGIN_SRC emacs-lisp :tangle no
>
> (org-babel-tangle) ; or org-babel-tangle-file "empty-block.org"
>
> #+END_SRC
>
> #+results:
> | test-out |
>
> ** Tests
> *** Block 1 (Exports OK)
>
> #+BEGIN_SRC sh :tangle test-out
> Block 1
> #+END_SRC
>
> *** Block 2 (Exports OK - double blank line no white-space in Block)
>
> #+BEGIN_SRC sh :tangle test-out
>
>
> #+END_SRC
>
> *** Block 3 (Fails - single blank line no white-space in Block)
>
> #+BEGIN_SRC sh :tangle test-out
>
> #+END_SRC
>
> *** Block 4 (Gets consumed by previous Block)
>
> #+BEGIN_SRC sh :tangle test-out
> Block 4
> #+END_SRC
>
> *** Block 5 (Fails - no lines in Block)
>
> #+BEGIN_SRC sh :tangle test-out
> #+END_SRC
>
> *** Block 6 (Gets consumed by previous Block
>
> #+BEGIN_SRC sh :tangle test-out
> Block 6
> #+END_SRC
>
> *** Block 7 (Exports OK)
>
> #+BEGIN_SRC sh :tangle test-out
> Block 7
> #+END_SRC
>
> ** List params
> #+begin_src emacs-lisp 
>   (sort* (mapcar (lambda (x)
>    (list (car x) (cdr x)))
>      params) 'string-lessp :key 'car)
> #+end_src
>
> #+results:
> | :cache         | no        |
> | :colname-names | nil       |
> | :colnames      | no        |
> | :comments      |           |
> | :exports       | results   |
> | :hlines        | yes       |
> | :noweb         | no        |
> | :result-params | (replace) |
> | :result-type   | value     |
> | :results       | replace   |
> | :rowname-names | nil       |
> | :session       | none      |
> | :shebang       |           |
> | :tangle        | test-out  |
>
>
>
>
> diff --git a/lisp/ob.el b/lisp/ob.el
> index 6e98263..6d2f0d0 100644
> --- a/lisp/ob.el
> +++ b/lisp/ob.el
> @@ -138,9 +138,20 @@ remove code block execution from the C-c C-c keybinding."
>     ;; (4) header arguments
>     "\\([^\n]*\\)\n"
>     ;; (5) body
> -   "\\([^\000]+?\n\\)[ \t]*#\\+end_src")
> +   "\\([^\000]*?\n*\\)[ \t]*#\\+end_src")
>    "Regexp used to identify code blocks.")
>  
> +(setq org-babel-src-block-regexp
> +  (concat
> +   ;; (1) indentation                     (2) lang
> +   "^\\([ \t]*\\)#\\+begin_src[ \t]+\\([^ \f\t\n\r\v]+\\)[ \t]*"
> +   ;; (3) switches
> +   "\\([^\":\n]*\"[^\"\n*]*\"[^\":\n]*\\|[^\":\n]*\\)"
> +   ;; (4) header arguments
> +   "\\([^\n]*\\)\n"
> +   ;; (5) body
> +   "\\([^\000]*?\n*\\)[ \t]*#\\+end_src"))
> +
>  (defvar org-babel-inline-src-block-regexp
>    (concat
>     ;; (1) replacement target (2) lang
>
> Regards
>
> Martyn
>
> ---
> Org-mode version 7.4 (release_7.4.529.gb23d)
> GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
>  of 2011-02-25 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Footnotes: 
[1]  buffer *after* org-mode processing
,----
| ** new block regexp tests
| *** Block 1 (Exports OK)
| 
| #+BEGIN_SRC sh :tangle test-out
| Block 1
| #+END_SRC
| 
| *** Block 2 (Exports OK - double blank line no white-space in Block)
| 
| #+BEGIN_SRC sh :tangle test-out
| 
| 
| #+END_SRC
| 
| *** Block 3 (Fails - single blank line no white-space in Block)
| 
| #+BEGIN_SRC sh :tangle test-out
| 
| #+END_SRC
| 
| *** Block 4 (Gets consumed by previous Block)
| 
| #+BEGIN_SRC sh :tangle test-out
| Block 4
| #+END_SRC
| 
| *** Block 5 (Fails - no lines in Block)
| 
| #+BEGIN_SRC sh :tangle test-out
| #+END_SRC
| 
| *** Block 6 (Gets consumed by previous Block
| 
| #+BEGIN_SRC sh :tangle test-out
| Block 6
| #+END_SRC
`----

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

* Re: [babel] [PATCH]
  2011-02-27 22:02 ` Eric Schulte
@ 2011-02-28 21:11   ` Martyn Jago
  2011-03-01 17:06     ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Martyn Jago @ 2011-02-28 21:11 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

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

Hi Eric

> Hi Martyn,
>
> Thanks for this patch and for the very nice test file, I've just applied
> it along with a related patch in org-exp-blocks.el.
>
> Even with the patch applied I am still seeing undesirable behavior when
> exporting the test file.  I believe this is due to upstream processing
> of the blocks by the rest of org-mode, as the buffer *after* org-mode
> processing looks like this [1]
>
> Thanks -- Eric
>

Thanks. That works great. One thing - I'm not seeing any undesirable
behaviour that you mentioned - am I missing something?

>   git format-patch -o ~/Desktop/ HEAD~1

Thanks for the tip - also, apologies for the 'too short' title (hope I
didn't start anything ;) - I'm still getting used to gnus!

One other thing, I've just been trying to get the tests running, and
most of them are, but the noweb test is failing and I don't understand
why. Has the noweb argument changed in any way...

This doesn't expand on export to html and therefore fails the tests...

--8<---------------cut here---------------start------------->8---

#+source: noweb-example
#+begin_src emacs-lisp
  (message "expanded")
#+end_src

#+begin_src emacs-lisp :noweb yes
  ;; noweb-yes-start
  <<noweb-example>>
  ;; noweb-yes-end
#+end_src

--8<---------------cut here---------------end--------------->8--

Regards

Martyn

>
> will output a patch file to your desktop holding your last committed
> change.  This would allow me to more easily apply your patches, and will
> ensure that you get authorship credit in the git logs.
>
> Martyn Jago <martyn.jago@btinternet.com> writes:
>
>> Hi Babel

[...]

>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> Footnotes: 
> [1]  buffer *after* org-mode processing
> ,----
> | ** new block regexp tests
> | *** Block 1 (Exports OK)
> | 
> | #+BEGIN_SRC sh :tangle test-out
> | Block 1
> | #+END_SRC
> | 
> | *** Block 2 (Exports OK - double blank line no white-space in Block)
> | 
> | #+BEGIN_SRC sh :tangle test-out
> | 
> | 
> | #+END_SRC
> | 
> | *** Block 3 (Fails - single blank line no white-space in Block)
> | 
> | #+BEGIN_SRC sh :tangle test-out
> | 
> | #+END_SRC
> | 
> | *** Block 4 (Gets consumed by previous Block)
> | 
> | #+BEGIN_SRC sh :tangle test-out
> | Block 4
> | #+END_SRC
> | 
> | *** Block 5 (Fails - no lines in Block)
> | 
> | #+BEGIN_SRC sh :tangle test-out
> | #+END_SRC
> | 
> | *** Block 6 (Gets consumed by previous Block
> | 
> | #+BEGIN_SRC sh :tangle test-out
> | Block 6
> | #+END_SRC
> `----



---
Org-mode version 7.4 (release_7.4.529.gb23d)
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
 of 2011-02-25 

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

* Re: [babel] [PATCH]
  2011-02-28 21:11   ` Martyn Jago
@ 2011-03-01 17:06     ` Eric Schulte
  2011-03-02 18:37       ` Martyn Jago
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Schulte @ 2011-03-01 17:06 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

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

> "Eric Schulte" <schulte.eric@gmail.com> writes:
>
> Hi Eric
>
>> Hi Martyn,
>>
>> Thanks for this patch and for the very nice test file, I've just applied
>> it along with a related patch in org-exp-blocks.el.
>>
>> Even with the patch applied I am still seeing undesirable behavior when
>> exporting the test file.  I believe this is due to upstream processing
>> of the blocks by the rest of org-mode, as the buffer *after* org-mode
>> processing looks like this [1]
>>
>> Thanks -- Eric
>>
>
> Thanks. That works great. One thing - I'm not seeing any undesirable
> behaviour that you mentioned - am I missing something?
>

I don't have time to test this out again right now, but if you see no
smoke, I'm happy to call no fire. :)

>
>>   git format-patch -o ~/Desktop/ HEAD~1
>
> Thanks for the tip - also, apologies for the 'too short' title (hope I
> didn't start anything ;) - I'm still getting used to gnus!
>
> One other thing, I've just been trying to get the tests running, and
> most of them are, but the noweb test is failing and I don't understand
> why. Has the noweb argument changed in any way...
>
> This doesn't expand on export to html and therefore fails the tests...
>

I don't believe that there have been any recent changes to the noweb
syntax, and the example below should indeed expand---and does for me
when interactively evaluated.  I'm not sure what needs to be changed for
the test to pass...

Also, I'm really pleased that you are looking into the test suite.  I do
believe that a well maintained test suite would be a huge boon, both for
Babel and for Org-mode at large, however, recently I have only had
enough time to respond to issues raised on the mailing list, and haven't
had the time needed to maintain the test suite---I know, I should be
responding to mailing list issues by writing tests for all of the new
development, but it hasn't yet integrated into my work flow.

Best -- Eric

>
>
> #+source: noweb-example
> #+begin_src emacs-lisp
>   (message "expanded")
> #+end_src
>
> #+begin_src emacs-lisp :noweb yes
>   ;; noweb-yes-start
>   <<noweb-example>>
>   ;; noweb-yes-end
> #+end_src
>
>
> Regards
>
> Martyn
>
>>
>> will output a patch file to your desktop holding your last committed
>> change.  This would allow me to more easily apply your patches, and will
>> ensure that you get authorship credit in the git logs.
>>
>> Martyn Jago <martyn.jago@btinternet.com> writes:
>>
>>> Hi Babel
>
> [...]
>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>> Footnotes: 
>> [1]  buffer *after* org-mode processing
>> ,----
>> | ** new block regexp tests
>> | *** Block 1 (Exports OK)
>> | 
>> | #+BEGIN_SRC sh :tangle test-out
>> | Block 1
>> | #+END_SRC
>> | 
>> | *** Block 2 (Exports OK - double blank line no white-space in Block)
>> | 
>> | #+BEGIN_SRC sh :tangle test-out
>> | 
>> | 
>> | #+END_SRC
>> | 
>> | *** Block 3 (Fails - single blank line no white-space in Block)
>> | 
>> | #+BEGIN_SRC sh :tangle test-out
>> | 
>> | #+END_SRC
>> | 
>> | *** Block 4 (Gets consumed by previous Block)
>> | 
>> | #+BEGIN_SRC sh :tangle test-out
>> | Block 4
>> | #+END_SRC
>> | 
>> | *** Block 5 (Fails - no lines in Block)
>> | 
>> | #+BEGIN_SRC sh :tangle test-out
>> | #+END_SRC
>> | 
>> | *** Block 6 (Gets consumed by previous Block
>> | 
>> | #+BEGIN_SRC sh :tangle test-out
>> | Block 6
>> | #+END_SRC
>> `----
>
>
>
> ---
> Org-mode version 7.4 (release_7.4.529.gb23d)
> GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
>  of 2011-02-25 

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

* Re: [babel] [PATCH]
  2011-03-01 17:06     ` Eric Schulte
@ 2011-03-02 18:37       ` Martyn Jago
  2011-03-02 18:45         ` Eric Schulte
  0 siblings, 1 reply; 7+ messages in thread
From: Martyn Jago @ 2011-03-02 18:37 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

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

[...]

> Also, I'm really pleased that you are looking into the test suite.  I do
> believe that a well maintained test suite would be a huge boon, both for
> Babel and for Org-mode at large, however, recently I have only had
> enough time to respond to issues raised on the mailing list, and haven't
> had the time needed to maintain the test suite---I know, I should be
> responding to mailing list issues by writing tests for all of the new
> development, but it hasn't yet integrated into my work flow.
>
> Best -- Eric
>

Hi Eric 

I appreciate you are very busy. I'm happy to build the test suite up
since I'm familiar with ERT and believe in testing. Its also a great way
to learn how org fits together! 

Regards

Martyn

[...]

---
Org-mode version 7.4 (release_7.4.581.g84dfb)
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
 of 2011-02-25 


-- 
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] [PATCH]
  2011-03-02 18:37       ` Martyn Jago
@ 2011-03-02 18:45         ` Eric Schulte
  2011-03-02 19:00           ` Martyn Jago
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Schulte @ 2011-03-02 18:45 UTC (permalink / raw)
  To: Martyn Jago; +Cc: emacs-orgmode

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

> "Eric Schulte" <schulte.eric@gmail.com> writes:
>
> [...]
>
>> Also, I'm really pleased that you are looking into the test suite.  I do
>> believe that a well maintained test suite would be a huge boon, both for
>> Babel and for Org-mode at large, however, recently I have only had
>> enough time to respond to issues raised on the mailing list, and haven't
>> had the time needed to maintain the test suite---I know, I should be
>> responding to mailing list issues by writing tests for all of the new
>> development, but it hasn't yet integrated into my work flow.
>>
>> Best -- Eric
>>
>
> Hi Eric 
>
> I appreciate you are very busy. I'm happy to build the test suite up
> since I'm familiar with ERT and believe in testing. Its also a great way
> to learn how org fits together! 
>

FANTASTIC! much appreciated, I think the entire community of Babel users
will benefit from increased application of the unit tests.

If you ever feel the need for test suite fodder, I maintain a file of
small examples generated from my mailing list responses and development.
See https://github.com/eschulte/babel-dev/raw/master/scraps.org

Cheers -- Eric

>
> Regards
>
> Martyn
>
> [...]
>
> ---
> Org-mode version 7.4 (release_7.4.581.g84dfb)
> GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
>  of 2011-02-25 

-- 
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [babel] [PATCH]
  2011-03-02 18:45         ` Eric Schulte
@ 2011-03-02 19:00           ` Martyn Jago
  0 siblings, 0 replies; 7+ messages in thread
From: Martyn Jago @ 2011-03-02 19:00 UTC (permalink / raw)
  To: Eric Schulte; +Cc: emacs-orgmode

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

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

> Martyn Jago <martyn.jago@btinternet.com> writes:
>
>> "Eric Schulte" <schulte.eric@gmail.com> writes:
>>
>> [...]
>>
>>> Also, I'm really pleased that you are looking into the test suite.  I do
>>> believe that a well maintained test suite would be a huge boon, both for
>>> Babel and for Org-mode at large, however, recently I have only had
>>> enough time to respond to issues raised on the mailing list, and haven't
>>> had the time needed to maintain the test suite---I know, I should be
>>> responding to mailing list issues by writing tests for all of the new
>>> development, but it hasn't yet integrated into my work flow.
>>>
>>> Best -- Eric
>>>
>>
>> Hi Eric 
>>
>> I appreciate you are very busy. I'm happy to build the test suite up
>> since I'm familiar with ERT and believe in testing. Its also a great way
>> to learn how org fits together! 
>>
>
> FANTASTIC! much appreciated, I think the entire community of Babel users
> will benefit from increased application of the unit tests.
>
> If you ever feel the need for test suite fodder, I maintain a file of
> small examples generated from my mailing list responses and development.
> See https://github.com/eschulte/babel-dev/raw/master/scraps.org
>
> Cheers -- Eric
>

Thanks, I'll take a look. By the way I forgot to commit the ERT package
link - its here


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Added link to recent ERT library package --]
[-- Type: text/x-diff, Size: 3096 bytes --]

From b4d7b8f2d5059cc244dcfda88d48958075fa6dd0 Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Wed, 2 Mar 2011 18:55:05 +0000
Subject: [PATCH] Added link to recent ERT library package in testing/README.org

---
 testing/README.org |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/testing/README.org b/testing/README.org
index c6c3eef..c852480 100644
--- a/testing/README.org
+++ b/testing/README.org
@@ -15,31 +15,37 @@ Org-mode test framework.
      git submodule update
    #+end_src
 
-2) Load the [[file:org-test.el][org-test.el]] file
+2) The ERT testing library is included in Emacs 24. On Emacs prior to
+   version 24 it is required to install a recent version of ERT and
+   set up its load-path in your init file. A recent package can be
+   downloaded [[https://github.com/ohler/ert/archives/fb3c278d3c8ddc6a558779d2c5262acc7cea4204][here.]] Copy the files into testing/ert and follow the
+   installation instructions in README.txt
+
+3) Load the [[file:org-test.el][org-test.el]] file
    #+begin_src emacs-lisp
      (load-file "org-test.el")
    #+end_src
 
-3) The =org-test-jump= command is now bound to =M-C-j= in all
+4) The =org-test-jump= command is now bound to =M-C-j= in all
    emacs-lisp files.  Call this command from any file in the =lisp/=
    directory of the org-mode repository to jump to the related test
    file in the =testing/= directory.  Call this functions with a
    prefix argument, and the corresponding test file will be stubbed
    out if it doesn't already exist.
 
-4) Ingest the library-of-babel.org file since some tests require this.
+5) Ingest the library-of-babel.org file since some tests require this.
    #+begin_src emacs-lisp
      (org-babel-lob-ingest "../contrib/babel/library-of-babel.org")
    #+end_src
 
-5) [[info:ert#Top][Review the ERT documentation]] 
+6) [[info:ert#Top][Review the ERT documentation]] 
 
-6) A number of org-mode-specific functions and macros are provided in
+7) A number of org-mode-specific functions and macros are provided in
    =org-test.el= see the [[file:org-test.el::%3B%3B%3B%20Functions%20for%20writing%20tests][;;; Functions for Writing Tests]] subsection of
    that file.  Some of these functions make use of example org-mode
    files located in the [[file:examples][examples/]] directory.
 
-7) Functions for loading and running the Org-mode tests are provided
+8) Functions for loading and running the Org-mode tests are provided
    in the [[file:org-test.el::%3B%3B%3B%20Load%20and%20Run%20tests][;;; Load and Run Tests]] subsection, the most important of
    which are
    - =org-test-load= which loads the entire Org-mode test suite
@@ -49,7 +55,7 @@ Org-mode test framework.
    - =org-test-run-all-tests= which runs the entire Org-mode test suite
    - also note that the =ert= command can also be used to run tests
 
-8) Load and run all tests
+9) Load and run all tests
    #+begin_src emacs-lisp 
      (load-file "org-test.el")
      (org-babel-lob-ingest "../contrib/babel/library-of-babel.org")
-- 
1.7.2.3


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


Regards 

Martyn

---
Org-mode version 7.4 (release_7.4.582.gb4d7)
GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.0)
 of 2011-02-25 

[-- Attachment #4: Type: text/plain, Size: 157 bytes --]

-- 
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2011-03-02 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 13:50 [babel] [PATCH] Martyn Jago
2011-02-27 22:02 ` Eric Schulte
2011-02-28 21:11   ` Martyn Jago
2011-03-01 17:06     ` Eric Schulte
2011-03-02 18:37       ` Martyn Jago
2011-03-02 18:45         ` Eric Schulte
2011-03-02 19:00           ` 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).