[Orgmode] org-babel-read should have option NOT to interpret as elisp
I keep perl regexps in a table, and some of them start with (. I'd like these to be left alone (returned unmodified as a string). (info (org)var) doesn't mention special processing of table cells, but the doc of org-babel-read says: Convert the string value of CELL to a number if appropriate. Otherwise if cell looks like lisp (meaning it starts with a ( or a ') then read it as lisp, otherwise return it unmodified as a string. So it seems to me that this special behavior of org-babel-read should be documented in info, and controllable by a user option. ___ 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
Re: [Orgmode] org-babel-read should have option NOT to interpret as elisp
Vladimir Alexiev vladi...@sirma.bg writes: I keep perl regexps in a table, and some of them start with (. I'd like these to be left alone (returned unmodified as a string). (info (org)var) doesn't mention special processing of table cells, but the doc of org-babel-read says: Convert the string value of CELL to a number if appropriate. Otherwise if cell looks like lisp (meaning it starts with a ( or a ') then read it as lisp, otherwise return it unmodified as a string. So it seems to me that this special behavior of org-babel-read should be documented in info, and controllable by a user option. When passing values directly through header arguments the solution would be to wrap the string in double-quotes so that it is interpreted as a literal string, e.g., #+begin_src perl :var it=(+ 1 1) :results output printf passed in %s, $it #+end_src #+results: : passed in (+ 1 1) However I do agree that this would be onerous to have to wrap every cell of a table in double quotes... I'm attaching a patch which inhibits the lisp evaluation of values read from tables and lists. This should solve your issue above. I'm not directly applying this patch, because it would be a breaking change for anyone who is currently relying on the ability to fill a table or list with to-be-evaluated emacs-lisp statements. If anyone is in that situation please respond to this email in the next couple of days, otherwise I am leaning towards applying this patch to the main repository. Best -- Eric p.s. this patch can be applied with the git am command. From f57ff0b724f0420751dd90600553d988aec507f1 Mon Sep 17 00:00:00 2001 From: Eric Schulte schulte.e...@gmail.com Date: Sun, 27 Feb 2011 08:47:36 -0700 Subject: [PATCH] ob: inhibit lisp evaluation of values read from tables and lists * lisp/ob.el (org-babel-read-table): Inhibit lisp evaluation of values when reading from tables. (org-babel-read-list): Inhibit lisp evaluation of values when reading from lists. (org-babel-read): Add optional argument which can be used to inhibit lisp evaluation of value. --- lisp/ob.el | 23 --- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index 6e98263..b4ce3cd 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -1386,12 +1386,13 @@ following the source block. Read the table at `point' into emacs-lisp. (mapcar (lambda (row) (if (and (symbolp row) (equal row 'hline)) row - (mapcar #'org-babel-read row))) + (mapcar (lambda (el) (org-babel-read el 'inhibit-lisp-eval)) row))) (org-table-to-lisp))) (defun org-babel-read-list () Read the list at `point' into emacs-lisp. - (mapcar #'org-babel-read (mapcar #'cadr (cdr (org-list-parse-list) + (mapcar (lambda (el) (org-babel-read el 'inhibit-lisp-eval)) + (mapcar #'cadr (cdr (org-list-parse-list) (defvar org-link-types-re) (defun org-babel-read-link () @@ -1901,18 +1902,18 @@ block but are passed literally to the \example-block\. (apply #'string (reverse out) str -(defun org-babel-read (cell) +(defun org-babel-read (cell optional inhibit-lisp-eval) Convert the string value of CELL to a number if appropriate. -Otherwise if cell looks like lisp (meaning it starts with a -\(\ or a \'\) then read it as lisp, otherwise return it -unmodified as a string. - -This is taken almost directly from `org-read-prop'. +Otherwise if cell looks like lisp (meaning it starts with a \(\ +or a \'\) then read it as lisp, otherwise return it unmodified +as a string. Optional argument NO-LISP-EVAL inhibits lisp +evaluation for situations in which is it not appropriate. (if (and (stringp cell) (not (equal cell ))) (or (org-babel-number-p cell) - (if (or (equal ( (substring cell 0 1)) - (equal ' (substring cell 0 1)) - (equal ` (substring cell 0 1))) + (if (and (not inhibit-lisp-eval) + (or (equal ( (substring cell 0 1)) + (equal ' (substring cell 0 1)) + (equal ` (substring cell 0 1 (eval (read cell)) (progn (set-text-properties 0 (length cell) nil cell) cell))) cell)) -- 1.7.1 ___ 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
[Orgmode] Org-Babel and R - no latex output
Hi, I recently installed emacs, org-mode fresh on a new install of Arch Linux. Before I had it working on Ubuntu. I've installed everything as before and used the same .emacs file I had, but if I use org to write out some R script and export to pdf via latex, then I get an empty pdf document, with only the title and Contents heading. However if I export to anything else such as html it works, and shows me code and results. I've tried even installing a version of org mode from source, using the build system my distro has, so as it's made and installed to exactly the right place, but I still don't have any luck. The texlive version I'm using is from my distro's package manager. Using C-c C-c to evaluate on the fly works. I had an issue getting org and babel to work with R on Windows 7 as well, but it was because certain tex packages were missing and I recieved a message when I tried to export, but nothing comes up here. Would the recent change: Org-babel is now inside org, remove (require 'org-babel-init) and alike from your .emacs. Look at http://orgmode.org/Changes.html#ob-configuration-changes for overview of the settings. Be causing the entire issue? The .tex file I get out is thus: % Created 2011-02-28 Mon 03:47 \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \usepackage{wrapfig} \usepackage{soul} \usepackage{textcomp} \usepackage{marvosym} \usepackage{wasysym} \usepackage{latexsym} \usepackage{amssymb} \usepackage{hyperref} \tolerance=1000 \providecommand{\alert}[1]{\textbf{#1}} \begin{document} \title{Test} \author{Ben J. Ward} \date{28 February 2011} \maketitle \setcounter{tocdepth}{3} \tableofcontents \vspace*{1cm} \end{document} Thanks, Ben W. ___ 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
[Orgmode] Org Babel and R issue with pdf latex export
Hi, I recently installed emacs, org-mode fresh on a new install of Arch Linux. Before I had it working on Ubuntu. I've installed everything as before and used the same .emacs file I had, but if I use org to write out some R script and export to pdf via latex, then I get an empty pdf document, with only the title and Contents heading. However if I export to anything else such as html it works, and shows me code and results. I've tried even installing a version of org mode from source, using the build system my distro has, so as it's made and installed to exactly the right place, but I still don't have any luck. The texlive version I'm using is from my distro's package manager. Using C-c C-c to evaluate on the fly works. I had an issue getting org and babel to work with R on Windows 7 as well, but it was because certain tex packages were missing and I recieved a message when I tried to export, but nothing comes up here. Would the recent change: Org-babel is now inside org, remove (require 'org-babel-init) and alike from your .emacs. Look at http://orgmode.org/Changes.html#ob-configuration-changes for overview of the settings. Be causing the entire issue? The .tex file I get out is thus: % Created 2011-02-28 Mon 03:47 \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \usepackage{wrapfig} \usepackage{soul} \usepackage{textcomp} \usepackage{marvosym} \usepackage{wasysym} \usepackage{latexsym} \usepackage{amssymb} \usepackage{hyperref} \tolerance=1000 \providecommand{\alert}[1]{\textbf{#1}} \begin{document} \title{Test} \author{Ben J. Ward} \date{28 February 2011} \maketitle \setcounter{tocdepth}{3} \tableofcontents \vspace*{1cm} \end{document} Thanks, Ben W. (Apologies if this has been sent twice, first time an error occured) ___ 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
[Orgmode] org-babel issue with source blocks and latex block
Hi, I have org-babel set up to use minted to format code blocks and it's terrific. I was wondering whether I could also get it to wrap the results it outputs using minted instead of verbatim environments (it seems not right now) when I noticed the following strange behavior. Here's a minimal example. This org file exports to latex as expected, with the src block in a minted environment and the results block as a verbatim environment: (As I say, wanting the results block wrapped by minted was what prompted this issue ...) Org-mode file: -- #+TITLE: Working with Org-Babel #+AUTHOR: Kieran Healy #+OPTIONS: toc:nil num:nil ** An Example #+source: r-example-1 #+begin_src R :exports both 2 + 1 + (5-2) * 5 #+end_src The end. -- Relevant bit of Latex file output: -- \begin{document} \title{Working with Org-Babel} \author{Kieran Healy} \date{15 February 2011} \maketitle \section*{An Example} \label{sec-1} \begin{minted}[]{R} 2 + 1 + (5-2) * 5 \end{minted} \begin{verbatim} 18 \end{verbatim} The end. \end{document} -- But now if I insert a latex-specific section, which causes org-mode no trouble in the normal course of things, R is not called and the export only includes the source block and not the results: Org-mode file: -- #+TITLE: Working with Org-Babel #+AUTHOR: Kieran Healy #+OPTIONS: toc:nil num:nil #+BEGIN_LaTeX Anything can go here. #+END_LaTeX ** An Example #+source: r-example-1 #+begin_src R :exports both 2 + 1 + (5-2) * 5 #+end_src The end. -- Latex output: -- \begin{document} \title{Working with Org-Babel} \author{Kieran Healy} \date{15 February 2011} \maketitle Anything can go here. \section*{An Example} \label{sec-1} \begin{minted}[]{R} 2 + 1 + (5-2) * 5 \end{minted} The end. \end{document} -- Is this behavior expected? Kieran -- Kieran Healy :: http://www.kieranhealy.org ___ 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
Re: [Orgmode] org-babel: Bugs with inline src_* blocks
Paul Sexton psex...@xnet.co.nz writes: I am experiencing a couple of significant bugs with inline src blocks in org-babel -- ie blocks of the form src_LANG{EXPRESSION}. I am using the development version of org, checked out a few days ago. Pressing C-c C-c with the cursor on such a block is supposed to evaluate it and echo the result to the minibuffer. However in recent versions of org (the last 3 months or so) this behaviour has become broken, at least for me. The following is an example file. --start--- #+BABEL: :session s1 :exports value latex :results raw #+BEGIN_SRC R :results none :exports none 1+2+3 #+END_SRC src_R{1+1} --end Pressing C-c C-c with the cursor on the inline block produces the error: 'R' is not recognized as an internal or external command, operable program or batch file. This happens even if the session named s1 is already running. However, if I first evaluate the BEGIN_SRC ... END_SRC block, using org-babel-execute-src-block, and then reattempt to evaluate the inline block, it will work. If I then press C-c C-c on the '#+BABEL:' line at the start of the file, the inline block goes back to producing the error. I just tried your example from above, and I can not reproduce this error. Maybe as Suvayu suggested you should try grabbing the latest version of Org-mode and see if that fixes this issue. The second, and more aggravating, error is do with the consequences of evaluating inline blocks. Formerly the result would be echoed in the minibuffer, and the document itself would not be altered. Now org has taken to inserting the result after the block, the same behaviour as a non-inline block. The header arguments used for this insertion seem to carry over either from the previous non-inline block, or possibly the global settings (BABEL: line). So for example, if I press C-c C-c on the src_R{1+1} above, I get: --- src_R{1+1} #+BEGIN_LaTeX 2#+END_LaTeX --- I want inline code blocks to replace themselves with their result when exporting the document to latex etc. I *never* want them to paste their results into the document while editing - that is what non-inline blocks are for. Hi, I agree with your intuition here, but I changed the default inline header argument so that others would be able to use inline code blocks and have the results inserted. To regain the behavior you describe, simply adjust the value of `org-babel-default-inline-header-args' as follows in your .emacs file. #+begin_src emacs-lisp (setf org-babel-default-inline-header-args '((:session . none) (:results . silent) (:exports . results))) #+end_src Best -- Eric Is this change in behaviour intentional? If so is there a setting that will revert to the old behaviour? Paul ___ 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 ___ 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
Re: [Orgmode] org-babel issue with source blocks and latex block
Kieran Healy kjhe...@gmail.com writes: Hi, I have org-babel set up to use minted to format code blocks and it's terrific. I was wondering whether I could also get it to wrap the results it outputs using minted instead of verbatim environments (it seems not right now) when I noticed the following strange behavior. Here's a minimal example. This org file exports to latex as expected, with the src block in a minted environment and the results block as a verbatim environment: (As I say, wanting the results block wrapped by minted was what prompted this issue ...) Hi Kieran, This may be possible through the use of the :results src header argument e.g., the following minimal code block #+begin_src R :results code 8 #+end_src evaluates to the following #+results: #+BEGIN_SRC R 8 #+END_SRC which should be exported using minted. Hope this helps -- Eric ___ 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
Re: [Orgmode] org-babel issue with source blocks and latex block
Hi Eric, On Feb 15, 2011, at 1:49 PM, Eric Schulte wrote: This may be possible through the use of the :results src header argument e.g., the following minimal code block #+begin_src R :results code 8 #+end_src evaluates to the following #+results: #+BEGIN_SRC R 8 #+END_SRC That does work — thank you. But while experimenting with this I found that while doing #+begin_src R :results value code :exports both x - c(1:10) mean(x) #+end_src works as expected, with both code and result wrapped in a minted environment, replacing mean(x) with summary(x) #+begin_src R :results value code :exports both x - c(1:10) summary(x) #+end_src gives this garbled output: \begin{minted}[]{R} x - c(1:10) summary(x) \end{minted} \end{SRC} \begin{SRC}R This also fails in HTML export, where the corresponding reversed/garbled bit is p /div div class=SRC R /p Finally, it's still the case that if the code block is preceded by a #+BEGIN_LaTeX block, e.g., #+BEGIN_LaTeX \thispagestyle{kjhgit} % but anything will do it #+END_LaTeX Then R is not called at all and I just get the src block in the exported .tex or .html file, and no results. Kieran -- Kieran Healy :: http://www.kieranhealy.org ___ 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
[Orgmode] org-babel: Bugs with inline src_* blocks
I am experiencing a couple of significant bugs with inline src blocks in org-babel -- ie blocks of the form src_LANG{EXPRESSION}. I am using the development version of org, checked out a few days ago. Pressing C-c C-c with the cursor on such a block is supposed to evaluate it and echo the result to the minibuffer. However in recent versions of org (the last 3 months or so) this behaviour has become broken, at least for me. The following is an example file. --start--- #+BABEL: :session s1 :exports value latex :results raw #+BEGIN_SRC R :results none :exports none 1+2+3 #+END_SRC src_R{1+1} --end Pressing C-c C-c with the cursor on the inline block produces the error: 'R' is not recognized as an internal or external command, operable program or batch file. This happens even if the session named s1 is already running. However, if I first evaluate the BEGIN_SRC ... END_SRC block, using org-babel-execute-src-block, and then reattempt to evaluate the inline block, it will work. If I then press C-c C-c on the '#+BABEL:' line at the start of the file, the inline block goes back to producing the error. The second, and more aggravating, error is do with the consequences of evaluating inline blocks. Formerly the result would be echoed in the minibuffer, and the document itself would not be altered. Now org has taken to inserting the result after the block, the same behaviour as a non-inline block. The header arguments used for this insertion seem to carry over either from the previous non-inline block, or possibly the global settings (BABEL: line). So for example, if I press C-c C-c on the src_R{1+1} above, I get: --- src_R{1+1} #+BEGIN_LaTeX 2#+END_LaTeX --- I want inline code blocks to replace themselves with their result when exporting the document to latex etc. I *never* want them to paste their results into the document while editing - that is what non-inline blocks are for. Is this change in behaviour intentional? If so is there a setting that will revert to the old behaviour? Paul ___ 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
Re: [Orgmode] org-babel: Bugs with inline src_* blocks
Hi Paul, On Tue, 15 Feb 2011 02:31:27 + (UTC) Paul Sexton psex...@xnet.co.nz wrote: Is this change in behaviour intentional? If so is there a setting that will revert to the old behaviour? I don't know the answer to your question however my question would be how up to date is your org-mode install? I remember there was a bugfix for a problem similar to this very recently (sometime in the last 2 weeks). Maybe all you are missing is a =git pull=? Paul GL -- Suvayu Open source is the future. It sets us free. ___ 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
[Orgmode] org-babel, R, and org-babel-open-src-block-result
I recently started using org-babel with R, and so far I think it's pretty great! I'm still getting accustomed to org-babel workflow and am playing with available options. I have a couple of questions: I noticed that C-c C-o (org-babel-open-src-block-result) always gives me an empty *Org-Babel Results* buffer, even if there's output printed to #+results section. Is this a bug? Am I doing something wrong? On a similar note, is there an option for the #+ results session to be completely suppressed?.. I can see situations where I might simply want to send the code to the inferior process and examine the results there using :results output :session, or perhaps I'm running the code just for the side effects. It would be nice if I could say e.g. :results none. Thanks and keep up the good work with org-babel! --Leo ___ 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
Re: [Orgmode] org-babel, R, and org-babel-open-src-block-result
On 01/11/2011 04:22 AM, Leo Alekseyev wrote: I recently started using org-babel with R, and so far I think it's pretty great! I'm still getting accustomed to org-babel workflow and am playing with available options. I have a couple of questions: I noticed that C-c C-o (org-babel-open-src-block-result) always gives me an empty *Org-Babel Results* buffer, even if there's output printed to #+results section. Is this a bug? Am I doing something wrong? On a similar note, is there an option for the #+ results session to be completely suppressed?.. I can see situations where I might simply want to send the code to the inferior process and examine the results there using :results output :session, or perhaps I'm running the code just for the side effects. It would be nice if I could say e.g. :results none. From the manual: The following results options indicate what happens with the results once they are collected. * silent The results will be echoed in the minibuffer but will not be inserted into the Org-mode buffer. E.g., :results output silent. ___ 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
Re: [Orgmode] org-babel, R, and org-babel-open-src-block-result
Leo Alekseyev dnqu...@gmail.com writes: I recently started using org-babel with R, and so far I think it's pretty great! I'm still getting accustomed to org-babel workflow and am playing with available options. I have a couple of questions: I noticed that C-c C-o (org-babel-open-src-block-result) always gives me an empty *Org-Babel Results* buffer, even if there's output printed to #+results section. Is this a bug? Am I doing something wrong? I have not noticed this myself, can you share an example? On a similar note, is there an option for the #+ results session to be completely suppressed?.. I can see situations where I might simply want to send the code to the inferior process and examine the results there using :results output :session, or perhaps I'm running the code just for the side effects. It would be nice if I could say e.g. :results none. Yes, for a complete list of the available header arguments and their effects please see http://orgmode.org/manual/Working-With-Source-Code.html Thanks and keep up the good work with org-babel! --Leo ___ 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 ___ 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
Re: [Orgmode] [org-babel] Dynamic Tangle?
Hi Nathan, The easiest way I can think of to accomplish templates would be through some abuse of code block evaluation. Maybe something like the following would work... ** tangle templates #+source: template-heading #+begin_src emacs-lisp some stuff here #+end_src #+source: template-footing #+begin_src emacs-lisp some other stuff here #+end_src #+source: template #+begin_src sh :results output :noweb yes :var body=body stuff heading=$(catEOF template-heading EOF ) footing=$(catEOF template-footing EOF ) echo $heading echo $body echo $footing #+end_src #+call: template[:noweb yes](body=something new) #+results: template[:noweb yes](body=something new) : some stuff here : something new : some other stuff here I hope this makes sense, and isn't too gross looking, for a really clean implementation the template function could be located in a different org file using the library of babel. Note, that this relies upon an improvement to variable escaping that I just pushed up to the latest version in git. Best -- Eric Nathan Neff nathan.n...@gmail.com writes: I'm preparing a presentation and I'm getting using tangle to show code /and/ produce working code examples -- this is really cool. It is possible to define a template and pass code blocks to it? For example: (Using pseudo-org-babel-code for brevity) #+template header code code_that_is_passed_to_me footer code #+example1 :render #+template with 111 11 #+example2 :render #+template with 22 2 The tangled output would be: header code 111 footer code header code 22 footer code I'm already able to use org-babel like below, but I have to put a footer and a header in each code block. Here's my existing setup: #+header header code #+footer footer code #+example1 header-- I have to specify these header and footer in each code block 111 footer #+example2 header 22 footer Thanks again for org-babel -- I'll post my presentation when I get it done. --Nate ___ 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 ___ 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
[Orgmode] [org-babel] Dynamic Tangle?
I'm preparing a presentation and I'm getting using tangle to show code /and/ produce working code examples -- this is really cool. It is possible to define a template and pass code blocks to it? For example: (Using pseudo-org-babel-code for brevity) #+template header code code_that_is_passed_to_me footer code #+example1 :render #+template with 111 11 #+example2 :render #+template with 22 2 The tangled output would be: header code 111 footer code header code 22 footer code I'm already able to use org-babel like below, but I have to put a footer and a header in each code block. Here's my existing setup: #+header header code #+footer footer code #+example1 header-- I have to specify these header and footer in each code block 111 footer #+example2 header 22 footer Thanks again for org-babel -- I'll post my presentation when I get it done. --Nate ___ 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
[Orgmode] [org-babel-R] Help: In converting an .org file to pdf, do I need to re-run the R code even if I ran them previously?
Hello Org-moders: I am trying to use org-mode, instead of Sweave, to write a report for a statistical analysis. During the process of writing, I prefer to export the org file to pdf to see the output (for sanity check). However, every time I do this, I get a question in minibuffer to choose if I want to run the R code. I have three questions related to this: 1. Can I turn this feature off and let org-babel-R (sorry if this is something else) automatically choose YES if the code has not been run already and NO if the code has been already run. 2. Currently, if the code was run already, I choose NO. I am assuming this won't affect the results. Am I correct? (If I change something in the code I run it using C-c in org-mode before exporting it to pdf) 3. Is there a way to know which R code chunk is org-babel-R asking to run, when it asks the question about running the R code. I looked in the uses of org-babel-R webpage on worg, but could not see anything related to this. Sorry if I missed something or the query is too basic. Thank you. Regards, S. ___ 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
Re: [Orgmode] [org-babel-R] Help: In converting an .org file to pdf, do I need to re-run the R code even if I ran them previously?
Aloha Sunny, On Dec 1, 2010, at 11:05 PM, Sunny Srivastava wrote: Hello Org-moders: I am trying to use org-mode, instead of Sweave, to write a report for a statistical analysis. During the process of writing, I prefer to export the org file to pdf to see the output (for sanity check). However, every time I do this, I get a question in minibuffer to choose if I want to run the R code. I have three questions related to this: 1. Can I turn this feature off and let org-babel-R (sorry if this is something else) automatically choose YES if the code has not been run already and NO if the code has been already run. This is the :cache header argument. The setting you want is :cache yes. 2. Currently, if the code was run already, I choose NO. I am assuming this won't affect the results. Am I correct? (If I change something in the code I run it using C-c in org-mode before exporting it to pdf) 3. Is there a way to know which R code chunk is org-babel-R asking to run, when it asks the question about running the R code. This behavior has changed relatively recently. I believe that with a recent version, answering NO won't abandon the evaluation of subsequent code blocks, and that the code block name is visible when the question is asked. This is something I don't use, so you'd have to pull and see for yourself. For me, it is preferable to disable the query. To disable the query, I set this: #+begin_src emacs-lisp :tangle yes (setq org-confirm-babel-evaluate nil) #+end_src hth, Tom I looked in the uses of org-babel-R webpage on worg, but could not see anything related to this. Sorry if I missed something or the query is too basic. Thank you. Regards, S. ___ 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 ___ 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
Re: [Orgmode] [org-babel-R] Help: In converting an .org file to pdf, do I need to re-run the R code even if I ran them previously?
Thank you Thomas. On Thu, Dec 2, 2010 at 10:33 AM, Thomas S. Dye t...@tsdye.com wrote: Aloha Sunny, On Dec 1, 2010, at 11:05 PM, Sunny Srivastava wrote: Hello Org-moders: I am trying to use org-mode, instead of Sweave, to write a report for a statistical analysis. During the process of writing, I prefer to export the org file to pdf to see the output (for sanity check). However, every time I do this, I get a question in minibuffer to choose if I want to run the R code. I have three questions related to this: 1. Can I turn this feature off and let org-babel-R (sorry if this is something else) automatically choose YES if the code has not been run already and NO if the code has been already run. This is the :cache header argument. The setting you want is :cache yes. 2. Currently, if the code was run already, I choose NO. I am assuming this won't affect the results. Am I correct? (If I change something in the code I run it using C-c in org-mode before exporting it to pdf) 3. Is there a way to know which R code chunk is org-babel-R asking to run, when it asks the question about running the R code. This behavior has changed relatively recently. I believe that with a recent version, answering NO won't abandon the evaluation of subsequent code blocks, and that the code block name is visible when the question is asked. This is something I don't use, so you'd have to pull and see for yourself. For me, it is preferable to disable the query. To disable the query, I set this: #+begin_src emacs-lisp :tangle yes (setq org-confirm-babel-evaluate nil) #+end_src hth, Tom I looked in the uses of org-babel-R webpage on worg, but could not see anything related to this. Sorry if I missed something or the query is too basic. Thank you. Regards, S. ___ 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 ___ 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
Re: [Orgmode] [org-babel] R, :session and empty line in #+results
Aloha Bernd, On Nov 30, 2010, at 1:23 PM, Bernd Weiss wrote: Dear all, I would like to use R objects across/among code blocks. Therefore, I included the header argument :session which then produces the following results: #+BEGIN_SRC R :results output :session x - 1 x x + 1 #+END_SRC #+results: : : [1] 1 : [1] 2 #+BEGIN_SRC R :results output :session x #+END_SRC #+results: : [1] 1 How can I get rid of the first line of the first #+results-block? BTW: if I remove the :session argument this empty line disappears. #+BEGIN_SRC R x - 1 x x + 1 #+END_SRC #+results: : 2 hth, Tom Thanks for your help, Bernd P.S. As far as I can see my question is not related to Dr. Bate's question on Removing the blank lines between code and results blocks in LaTeX export http://www.mail-archive.com/emacs-orgmode@gnu.org/msg29957.html ___ 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 ___ 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
Re: [Orgmode] [org-babel] R, :session and empty line in #+results
Am 01.12.2010 02:19, schrieb Thomas S. Dye: Aloha Bernd, On Nov 30, 2010, at 1:23 PM, Bernd Weiss wrote: Dear all, I would like to use R objects across/among code blocks. Therefore, I included the header argument :session which then produces the following results: #+BEGIN_SRC R :results output :session x - 1 x x + 1 #+END_SRC #+results: : : [1] 1 : [1] 2 #+BEGIN_SRC R :results output :session x #+END_SRC #+results: : [1] 1 How can I get rid of the first line of the first #+results-block? BTW: if I remove the :session argument this empty line disappears. #+BEGIN_SRC R x - 1 x x + 1 #+END_SRC #+results: : 2 Hi Tom, Thanks for your reply! I should have noted that I am preparing a beamer presentation and I need all the code and the results. So, your answer does not solve my problem. Maybe this is another information I should have given: To control org-babel's behaviour, I am defining the following buffer-wide header arguments: #+BABEL: :results output replace :exports both :comments both :session Bernd ___ 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
Re: [Orgmode] [org-babel] R, :session and empty line in #+results
Hi Bernd, I've just pushed up a change which should remove these empty lines. Best -- Eric Bernd Weiss bernd.we...@uni-koeln.de writes: Am 01.12.2010 02:19, schrieb Thomas S. Dye: Aloha Bernd, On Nov 30, 2010, at 1:23 PM, Bernd Weiss wrote: Dear all, I would like to use R objects across/among code blocks. Therefore, I included the header argument :session which then produces the following results: #+BEGIN_SRC R :results output :session x - 1 x x + 1 #+END_SRC #+results: : : [1] 1 : [1] 2 #+BEGIN_SRC R :results output :session x #+END_SRC #+results: : [1] 1 How can I get rid of the first line of the first #+results-block? BTW: if I remove the :session argument this empty line disappears. #+BEGIN_SRC R x - 1 x x + 1 #+END_SRC #+results: : 2 Hi Tom, Thanks for your reply! I should have noted that I am preparing a beamer presentation and I need all the code and the results. So, your answer does not solve my problem. Maybe this is another information I should have given: To control org-babel's behaviour, I am defining the following buffer-wide header arguments: #+BABEL: :results output replace :exports both :comments both :session Bernd ___ 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 ___ 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
Re: [Orgmode] [org-babel] R, :session and empty line in #+results
Am 01.12.2010 10:01, schrieb Eric Schulte: Hi Bernd, I've just pushed up a change which should remove these empty lines. Just updated my org-mode repository and it works great. Thanks a lot! Bernd ___ 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
[Orgmode] [org-babel] R, :session and empty line in #+results
Dear all, I would like to use R objects across/among code blocks. Therefore, I included the header argument :session which then produces the following results: #+BEGIN_SRC R :results output :session x - 1 x x + 1 #+END_SRC #+results: : : [1] 1 : [1] 2 #+BEGIN_SRC R :results output :session x #+END_SRC #+results: : [1] 1 How can I get rid of the first line of the first #+results-block? BTW: if I remove the :session argument this empty line disappears. Thanks for your help, Bernd P.S. As far as I can see my question is not related to Dr. Bate's question on Removing the blank lines between code and results blocks in LaTeX export http://www.mail-archive.com/emacs-orgmode@gnu.org/msg29957.html ___ 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
Re: [Orgmode] Org-Babel - Clojure Lazy Sequences Bug
Hey Rick, Rick Moynihan rick.moyni...@gmail.com writes: Hey Eric, I've just run your ob-clojure, and it seems to work fine, though as you mention it would be nice if it'd start slime (if it isn't already running). Alright, I'm going to fold this into the master branch (we'll still have the entirety of the existing ob-clojure in git for resurrection if need be). I'm not sure what you mean by external evaluation, but have found that if I do M-x slime-connect (to connect to an existing clojure/swank vm) that I have access to the same vm, via the *slime-repl* buffer, which is nice. Is this what you were referring to, or was it something else? So what I mean was execution outside of slime, e.g. by writing a code block to a temporary file and then executing that file with clj-env or some such Clojure scripting command. However the more I think about this the more I'm satisfied with slime, as it allows access to both local and remote virtual machines... Having access to other sessions seems like a useful feature, but I've not begun to use these more advanced babel features. Anyway, great work; I really appreciate you working on this! My pleasure, I use Clojure from within Org-mode files on a regular basis (these days I'm probably writing more Clojure than elisp), so this helps me too. Cheers -- Eric R. On 25 November 2010 17:40, Eric Schulte schulte.e...@gmail.com wrote: Hi Rick, I'm not quite sure what the best permanent solution would be. I'm tempted to switch to a drastically stripped down version of Clojure interaction which relies very heavily on slime. I'm attaching a first pass at this which allows for slime-based execution, can assign variables, handles lazy evaluation, etc... The downside to this new version is that it doesn't support buffer-based sessions or external evaluation, but the upside is that it is incredibly simple, and by relying so heavily on slime it should be very robust. Once this is enhanced with some code to start slime, and a simple :session setup (namely the ability to grab the slime context from a buffer specified by :session) I may prefer this to the existing ob-clojure. I'd be interested to hear what others think. Personally I'm happy to lose external evaluation and switch to purely slime-based evaluation, but I don't want to trash it if it is an important part of someones work flow. Best -- Eric Rick Moynihan rick.moyni...@gmail.com writes: Hi Eric, Sorry for the delay in getting back to you. I can confirm the fix you quoted below works for me also. I've not been using any of the multiple session features, so I haven't run into the other problems you mention. Any idea on what a more permanent solution might be? R. On 6 November 2010 17:58, Eric Schulte schulte.e...@gmail.com wrote: Hi Rick, I've noticed this as well. I'm not the original author of ob-clojure.el (Joel Boehland is), so I'm not sure how the clojure interaction currently works, although I know it makes heavy usage of slime. There must be an existing mechanism used by slime to unroll these lazy evaluations, for example in the repl (range 10) *is* expanded user (range 10) (0 1 2 3 4 5 6 7 8 9) I'm using clojure extensively in my studies so I have all the more reason to try to figure this out. I'll put this on my stack. BTW: I've noticed that I am unable to get Clojure code blocks to play nicely with existing slime sessions, say for example I have some large piece of data in scope in a slime sessions and I'd like to access that data from a clojure code block and dump some analysis to an Org-mode document. I have not yet found out how to make this work. If you have, I'd love to hear how, otherwise I'll look into this as well. Best -- Eric Having just looked at this quickly, the following function over-defines `org-babel-execute:clojure' s.t. the body of the code block is sent to the superior list in the same manner as when calling `slime-eval-defun' from within a .clj file. While this doesn't handle starting up clojure instances or differentiate between session and external evaluation it should fix the issues mentioned above and could be the beginning of a permanent solution. #+begin_src emacs-lisp (defun org-babel-execute:clojure (body params) (with-temp-buffer (insert body) (read (slime-eval `(swank:interactive-eval-region ,(buffer-substring-no-properties (point-min) (point-max))) #+end_src which then results in #+begin_src clojure (map (fn [el] (list el (* el el))) (range 10)) #+end_src evaluating to #+results: | 0 | 0 | | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | | 6 | 36 | | 7 | 49 | | 8 | 64 | | 9 | 81 | Rick Moynihan rick.moyni...@gmail.com writes: I have the following org file: #+BEGIN_SRC clojure (range 10) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Where as I would expect to see the sequence.
Re: [Orgmode] Org-Babel - Clojure Lazy Sequences Bug
On 26 November 2010 20:29, Eric Schulte schulte.e...@gmail.com wrote: Alright, I'm going to fold this into the master branch (we'll still have the entirety of the existing ob-clojure in git for resurrection if need be). That's great news! I'm not sure what you mean by external evaluation, but have found that if I do M-x slime-connect (to connect to an existing clojure/swank vm) that I have access to the same vm, via the *slime-repl* buffer, which is nice. Is this what you were referring to, or was it something else? So what I mean was execution outside of slime, e.g. by writing a code block to a temporary file and then executing that file with clj-env or some such Clojure scripting command. However the more I think about this the more I'm satisfied with slime, as it allows access to both local and remote virtual machines... Yeah, Slime is great in this regard... Having access to other sessions seems like a useful feature, but I've not begun to use these more advanced babel features. Anyway, great work; I really appreciate you working on this! My pleasure, I use Clojure from within Org-mode files on a regular basis (these days I'm probably writing more Clojure than elisp), so this helps me too. Well if it's your pleasure then I have another feature request for you :-) Basically it looks like the different :results types haven't yet been implemented... The one I was missing was 'code' e.g. the following works for elisp: #+begin_src emacs-lisp :results code '(+ 10 1) #+end_src displaying: #+results: #+BEGIN_SRC emacs-lisp (+ 10 1) #+END_SRC But in clojure I get: #+begin_src clojure :results code '(+ 10 1) #+end_src #+results: | + | 10 | 1 | I looked at implementing this myself, ontop of your recent changes, by running it through edebug, which I've only begun to discover, but I couldn't work it out in the hour I spent looking at it. Any suggestions on where I should look to fix this? R. ___ 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
[Orgmode] Org-babel games screencast
Here's a presentation I made, sorry it's a bit rough but here goes: http://lispgamesdev.blogspot.com/2010/11/lisp-game-development-screencast-1.html ___ 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
Re: [Orgmode] Org-Babel - Clojure Lazy Sequences Bug
Rick Moynihan rick.moyni...@gmail.com writes: Basically it looks like the different :results types haven't yet been implemented... The one I was missing was 'code' e.g. the following works for elisp: #+begin_src emacs-lisp :results code '(+ 10 1) #+end_src displaying: #+results: #+BEGIN_SRC emacs-lisp (+ 10 1) #+END_SRC But in clojure I get: #+begin_src clojure :results code '(+ 10 1) #+end_src #+results: | + | 10 | 1 | I've just pushed up an implementation of this feature. It uses Clojure's pretty printer which has different settings for printing code and data. This can be controlled through use of the code (for code) and pp (for data) arguments to :results, here's example output with the new implementation. #+begin_src clojure :results pp '(defn cl-format An implementation of a Common Lisp compatible format function [stream format-in args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+end_src #+results: #+begin_example (defn cl-format An implementation of a Common Lisp compatible format function [stream format-in args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+end_example #+begin_src clojure :results code '(defn cl-format An implementation of a Common Lisp compatible format function [stream format-in args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+end_src #+results: #+BEGIN_SRC clojure (defn cl-format An implementation of a Common Lisp compatible format function [stream format-in args] (let [compiled-format (if (string? format-in) (compile-format format-in) format-in) navigator (init-navigator args)] (execute-format stream compiled-format navigator))) #+END_SRC ___ 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
Re: [Orgmode] Org-babel games screencast
Hi David, This looks great, and is a very good introduction to code block usage in Org-mode. Would you mind adding a link to this video to the Babel/uses page? http://orgmode.org/worg/org-contrib/babel/uses.php At some point I'd like to start generating and compiling Babel screencasts, but until that happens I think the uses page is the best place to collect these things. Thanks for sharing! -- Eric David O'Toole dto1...@gmail.com writes: Here's a presentation I made, sorry it's a bit rough but here goes: http://lispgamesdev.blogspot.com/2010/11/lisp-game-development-screencast-1.html ___ 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 ___ 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
Re: [Orgmode] Org-Babel - Clojure Lazy Sequences Bug
Hi Rick, I'm not quite sure what the best permanent solution would be. I'm tempted to switch to a drastically stripped down version of Clojure interaction which relies very heavily on slime. I'm attaching a first pass at this which allows for slime-based execution, can assign variables, handles lazy evaluation, etc... The downside to this new version is that it doesn't support buffer-based sessions or external evaluation, but the upside is that it is incredibly simple, and by relying so heavily on slime it should be very robust. Once this is enhanced with some code to start slime, and a simple :session setup (namely the ability to grab the slime context from a buffer specified by :session) I may prefer this to the existing ob-clojure. I'd be interested to hear what others think. Personally I'm happy to lose external evaluation and switch to purely slime-based evaluation, but I don't want to trash it if it is an important part of someones work flow. Best -- Eric ob-clojure.el Description: application/emacs-lisp Rick Moynihan rick.moyni...@gmail.com writes: Hi Eric, Sorry for the delay in getting back to you. I can confirm the fix you quoted below works for me also. I've not been using any of the multiple session features, so I haven't run into the other problems you mention. Any idea on what a more permanent solution might be? R. On 6 November 2010 17:58, Eric Schulte schulte.e...@gmail.com wrote: Hi Rick, I've noticed this as well. I'm not the original author of ob-clojure.el (Joel Boehland is), so I'm not sure how the clojure interaction currently works, although I know it makes heavy usage of slime. There must be an existing mechanism used by slime to unroll these lazy evaluations, for example in the repl (range 10) *is* expanded user (range 10) (0 1 2 3 4 5 6 7 8 9) I'm using clojure extensively in my studies so I have all the more reason to try to figure this out. I'll put this on my stack. BTW: I've noticed that I am unable to get Clojure code blocks to play nicely with existing slime sessions, say for example I have some large piece of data in scope in a slime sessions and I'd like to access that data from a clojure code block and dump some analysis to an Org-mode document. I have not yet found out how to make this work. If you have, I'd love to hear how, otherwise I'll look into this as well. Best -- Eric Having just looked at this quickly, the following function over-defines `org-babel-execute:clojure' s.t. the body of the code block is sent to the superior list in the same manner as when calling `slime-eval-defun' from within a .clj file. While this doesn't handle starting up clojure instances or differentiate between session and external evaluation it should fix the issues mentioned above and could be the beginning of a permanent solution. #+begin_src emacs-lisp (defun org-babel-execute:clojure (body params) (with-temp-buffer (insert body) (read (slime-eval `(swank:interactive-eval-region ,(buffer-substring-no-properties (point-min) (point-max))) #+end_src which then results in #+begin_src clojure (map (fn [el] (list el (* el el))) (range 10)) #+end_src evaluating to #+results: | 0 | 0 | | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | | 6 | 36 | | 7 | 49 | | 8 | 64 | | 9 | 81 | Rick Moynihan rick.moyni...@gmail.com writes: I have the following org file: #+BEGIN_SRC clojure (range 10) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Where as I would expect to see the sequence. Evaluating the code inside a doall doesn't seem to do anything either: #+BEGIN_SRC clojure (doall (range 10)) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Is there any parameter I can pass to the block to get the code to execute in a doall and return the sequence values rather than the lazy-seq object itself? R. ___ 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 ___ 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
Re: [Orgmode] Org-Babel - Clojure Lazy Sequences Bug
Hey Eric, I've just run your ob-clojure, and it seems to work fine, though as you mention it would be nice if it'd start slime (if it isn't already running). I'm not sure what you mean by external evaluation, but have found that if I do M-x slime-connect (to connect to an existing clojure/swank vm) that I have access to the same vm, via the *slime-repl* buffer, which is nice. Is this what you were referring to, or was it something else? Having access to other sessions seems like a useful feature, but I've not begun to use these more advanced babel features. Anyway, great work; I really appreciate you working on this! R. On 25 November 2010 17:40, Eric Schulte schulte.e...@gmail.com wrote: Hi Rick, I'm not quite sure what the best permanent solution would be. I'm tempted to switch to a drastically stripped down version of Clojure interaction which relies very heavily on slime. I'm attaching a first pass at this which allows for slime-based execution, can assign variables, handles lazy evaluation, etc... The downside to this new version is that it doesn't support buffer-based sessions or external evaluation, but the upside is that it is incredibly simple, and by relying so heavily on slime it should be very robust. Once this is enhanced with some code to start slime, and a simple :session setup (namely the ability to grab the slime context from a buffer specified by :session) I may prefer this to the existing ob-clojure. I'd be interested to hear what others think. Personally I'm happy to lose external evaluation and switch to purely slime-based evaluation, but I don't want to trash it if it is an important part of someones work flow. Best -- Eric Rick Moynihan rick.moyni...@gmail.com writes: Hi Eric, Sorry for the delay in getting back to you. I can confirm the fix you quoted below works for me also. I've not been using any of the multiple session features, so I haven't run into the other problems you mention. Any idea on what a more permanent solution might be? R. On 6 November 2010 17:58, Eric Schulte schulte.e...@gmail.com wrote: Hi Rick, I've noticed this as well. I'm not the original author of ob-clojure.el (Joel Boehland is), so I'm not sure how the clojure interaction currently works, although I know it makes heavy usage of slime. There must be an existing mechanism used by slime to unroll these lazy evaluations, for example in the repl (range 10) *is* expanded user (range 10) (0 1 2 3 4 5 6 7 8 9) I'm using clojure extensively in my studies so I have all the more reason to try to figure this out. I'll put this on my stack. BTW: I've noticed that I am unable to get Clojure code blocks to play nicely with existing slime sessions, say for example I have some large piece of data in scope in a slime sessions and I'd like to access that data from a clojure code block and dump some analysis to an Org-mode document. I have not yet found out how to make this work. If you have, I'd love to hear how, otherwise I'll look into this as well. Best -- Eric Having just looked at this quickly, the following function over-defines `org-babel-execute:clojure' s.t. the body of the code block is sent to the superior list in the same manner as when calling `slime-eval-defun' from within a .clj file. While this doesn't handle starting up clojure instances or differentiate between session and external evaluation it should fix the issues mentioned above and could be the beginning of a permanent solution. #+begin_src emacs-lisp (defun org-babel-execute:clojure (body params) (with-temp-buffer (insert body) (read (slime-eval `(swank:interactive-eval-region ,(buffer-substring-no-properties (point-min) (point-max))) #+end_src which then results in #+begin_src clojure (map (fn [el] (list el (* el el))) (range 10)) #+end_src evaluating to #+results: | 0 | 0 | | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | | 6 | 36 | | 7 | 49 | | 8 | 64 | | 9 | 81 | Rick Moynihan rick.moyni...@gmail.com writes: I have the following org file: #+BEGIN_SRC clojure (range 10) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Where as I would expect to see the sequence. Evaluating the code inside a doall doesn't seem to do anything either: #+BEGIN_SRC clojure (doall (range 10)) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Is there any parameter I can pass to the block to get the code to execute in a doall and return the sequence values rather than the lazy-seq object itself? R. ___ 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 ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org
[Orgmode] org-babel problem
Hi all, I am trying to run some org-babel code, but while this used to work in the past, I am now getting an error which says Symbol's function definition is void: org-babel-get-header Somehow I am puzzled, since this function is defined in lisp/ob.el and since this file provides 'ob and I have (require 'ob) in my .emacs I don't see why this should happen. Is there any check I should perform to see where and why this is failing? I am using GNU Emacs 23.1. with Org-mode version 7.3 (release_7.3.130.g9cc1) even though I somehow suspect that it's not either of the software versions that is responsible for this. Any hints appreciated. Thanks, Erik ___ 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
Re: [Orgmode] Org-Babel - Clojure Lazy Sequences Bug
Hi Rick, I've noticed this as well. I'm not the original author of ob-clojure.el (Joel Boehland is), so I'm not sure how the clojure interaction currently works, although I know it makes heavy usage of slime. There must be an existing mechanism used by slime to unroll these lazy evaluations, for example in the repl (range 10) *is* expanded user (range 10) (0 1 2 3 4 5 6 7 8 9) I'm using clojure extensively in my studies so I have all the more reason to try to figure this out. I'll put this on my stack. BTW: I've noticed that I am unable to get Clojure code blocks to play nicely with existing slime sessions, say for example I have some large piece of data in scope in a slime sessions and I'd like to access that data from a clojure code block and dump some analysis to an Org-mode document. I have not yet found out how to make this work. If you have, I'd love to hear how, otherwise I'll look into this as well. Best -- Eric Having just looked at this quickly, the following function over-defines `org-babel-execute:clojure' s.t. the body of the code block is sent to the superior list in the same manner as when calling `slime-eval-defun' from within a .clj file. While this doesn't handle starting up clojure instances or differentiate between session and external evaluation it should fix the issues mentioned above and could be the beginning of a permanent solution. #+begin_src emacs-lisp (defun org-babel-execute:clojure (body params) (with-temp-buffer (insert body) (read (slime-eval `(swank:interactive-eval-region ,(buffer-substring-no-properties (point-min) (point-max))) #+end_src which then results in #+begin_src clojure (map (fn [el] (list el (* el el))) (range 10)) #+end_src evaluating to #+results: | 0 | 0 | | 1 | 1 | | 2 | 4 | | 3 | 9 | | 4 | 16 | | 5 | 25 | | 6 | 36 | | 7 | 49 | | 8 | 64 | | 9 | 81 | Rick Moynihan rick.moyni...@gmail.com writes: I have the following org file: #+BEGIN_SRC clojure (range 10) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Where as I would expect to see the sequence. Evaluating the code inside a doall doesn't seem to do anything either: #+BEGIN_SRC clojure (doall (range 10)) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Is there any parameter I can pass to the block to get the code to execute in a doall and return the sequence values rather than the lazy-seq object itself? R. ___ 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 ___ 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
[Orgmode] Org-Babel - Clojure Lazy Sequences Bug
I have the following org file: #+BEGIN_SRC clojure (range 10) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Where as I would expect to see the sequence. Evaluating the code inside a doall doesn't seem to do anything either: #+BEGIN_SRC clojure (doall (range 10)) #+END_SRC #+results: : clojure.lang.lazy...@f35bf8c6 Is there any parameter I can pass to the block to get the code to execute in a doall and return the sequence values rather than the lazy-seq object itself? R. ___ 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
[Orgmode] org babel and alternative output file when using +call
Dear list, When I do #+source: test(myarg=blabla) #+begin_src R :session :file test.pdf plot(1:10, main=myarg) #+end_src I get the expected result: #+results: test [[file:test.pdf]] but if I later do #+call: test(myarg=hiho) :file test2.pdf I still get a file named according to the header argument specified in the original source block: #+results: test(myarg=hiho) [[file:test.pdf]] instead of what I hoped for: #+results: test(myarg=hiho) [[file:test2.pdf]] Is this intended? I think it would be very useful if I could change the file name in '+calls' like this to get different plots for different arguments. Using: GNU Emacs 23.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.18.0) of 2009-09-27 on crested, modified by Debian Org-mode version 7.01trans Best regards, -- /Henning Redestig Metabolome Informatics Unit | Yokohama RIKEN Plant Science Center ___ 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
[Orgmode] org-babel-gnuplot broken today?
I refreshed today 7.01trans and noticed I couldn't get my gnuplots to plot anymore: data from a table within the org file is no longer digested nicely by gnuplot. To test, I used the snippet below from the worg http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php: ** Data Table Plot Plotting data points from a table could look like this: #+tblname: basic-plot | x | y1 | y2 | |-++| | 0.1 | 0.425 | 0.375 | | 0.2 | 0.3125 | 0.3375 | | 0.3 | 0.2493 | 0.2838 | | 0.4 | 0.275 |0.28125 | | 0.5 | 0.26 | 0.27 | | 0.6 | 0.2588 | 0.2493 | | 0.7 | 0.24642845 | 0.23928553 | | 0.8 |0.23125 | 0.2375 | | 0.9 | 0.2323 | 0.232 | | 1 | 0.2225 | 0.22 | #+begin_src gnuplot :var data=basic-plot :exports code :file basic-plot.png set title Putting it All Together set xlabel X set xrange [0:1] set xtics 0,0.1,1 set ylabel Y set yrange [0.2:0.5] set ytics 0.2,0.05,0.5 plot data u 1:2 w p lw 2 title 'x vs. y1', \ data u 1:3 w lp lw 1 title 'x vx. y2' #+end_src #+results: [[file:basic-plot.png]] Exporting or executing the gnuplot piece, Gnuplot (Gnuplot 4.4 patch level 1) complains: gnuplot plot data u 1:2 w p lw 2 title 'x vs. y1', \ data u 1:3 w lp lw 1 title 'x vx. y2' warning: Skipping unreadable file ((0.1 0.425 0.375) (0.2 0.3125 0.3375) (0.3 0.2493 0.2838) (0.4 0.275 0.28125) (0.5 0.26 0.27) (0.6 0.2588 0.2493) (0.7 0.24642845 0.23928553) (0.8 0.23125 0.2375) (0.9 0.2323 0.232) (1 0.2225 0.22)) warning: Skipping unreadable file ((0.1 0.425 0.375) (0.2 0.3125 0.3375) (0.3 0.2493 0.2838) (0.4 0.275 0.28125) (0.5 0.26 0.27) (0.6 0.2588 0.2493) (0.7 0.24642845 0.23928553) (0.8 0.23125 0.2375) (0.9 0.2323 0.232) (1 0.2225 0.22)) No data in plot So of course no basic-plot.png is created As far as I know, my gnuplots were happy sometime within the past week refreshing org-mode from git basically daily... ___ 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
Re: [Orgmode] org-babel-gnuplot broken today?
On Tue, Oct 26, 2010 at 3:10 PM, Nigel Beck m...@nigelbeck.com wrote: I refreshed today 7.01trans and noticed I couldn't get my gnuplots to plot anymore: data from a table within the org file is no longer digested nicely by gnuplot. That's odd. I wrote the tutorial and thus my heart skipped a beat for a moment! To test, I used the snippet below from the worg http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.php: ** Data Table Plot Plotting data points from a table could look like this: #+tblname: basic-plot 8 Exporting or executing the gnuplot piece, Gnuplot (Gnuplot 4.4 patch level 1) complains: gnuplot plot data u 1:2 w p lw 2 title 'x vs. y1', \ 8 No data in plot So of course no basic-plot.png is created As far as I know, my gnuplots were happy sometime within the past week refreshing org-mode from git basically daily... That's odd indeed. I copied and pasted your exact table and code from the email and was able to generate the plot. The error is quite odd. It almost makes me wonder if something is different about how gnuplot is receiving the data. Like a syntax error or something. I would say that at this point it's not the table or code, per se, since I can generate the plot. Hopefully someone will chime in with more experience who may have seen this error? One thing to try in the meantime... Gather up some gnuplot test data file and try to run it from the command line perhaps? It would at least be one way to see if it's working outside of org-mode? Best regards, John ___ 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 ___ 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
Re: [Orgmode] [org-babel] Using the power of ESS inside an R source code block
Hi Bernd, It seems that you have already found the best solution in the indirect edit buffers (by calling C-c ' from inside of a code block). I would only add that in the email you mentioned below, I was specifically talking about syntax highlighting of R code in Org-mode buffers, which at the time I believed was not possible. It would seem I was wrong, as such syntax highlighting is now implemented in recent versions of Org-mode through setting the `org-src-fontify-natively' variable. Hope you enjoy using Org-mode with Ess. Best -- Eric Bernd Weiss bernd.we...@uni-koeln.de writes: Am 24.10.2010 05:44, schrieb Bernd Weiss: Dear all, Yesterday, I spent some time (re-)discovering the power of org-babel and R. Everything works well but there is one issue that I find somewhat annoying (I apologise if this word is too rude). As a long-time ESS user I wish that I could use things like ESS syntax highlighting, indentation or some keybindings (e.g. for -) inside an R source code block. However, with respect to an e-mail from Eric Schulte http://www.mail-archive.com/emacs-orgmode@gnu.org/msg22301.html (or this one: https://stat.ethz.ch/pipermail/ess-help/2009-September/005544.html ) this seems to be a feature wich is hard to realise inside org-babel. Is this (still) correct? Or is it a problem with my installation/initialisation of org-mode/org-babel?[1] Ok, one workaround are indirect buffers, right? This blog post is really helpful (see A note about syntax highlighting in Emacs) http://blogisticreflections.wordpress.com/2010/05/23/introduction-to-using-r-with-org-babel-part-1/ Bernd ___ 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 ___ 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
[Orgmode] [org-babel] Using the power of ESS inside an R source code block
Dear all, Yesterday, I spent some time (re-)discovering the power of org-babel and R. Everything works well but there is one issue that I find somewhat annoying (I apologise if this word is too rude). As a long-time ESS user I wish that I could use things like ESS syntax highlighting, indentation or some keybindings (e.g. for -) inside an R source code block. However, with respect to an e-mail from Eric Schulte http://www.mail-archive.com/emacs-orgmode@gnu.org/msg22301.html (or this one: https://stat.ethz.ch/pipermail/ess-help/2009-September/005544.html ) this seems to be a feature wich is hard to realise inside org-babel. Is this (still) correct? Or is it a problem with my installation/initialisation of org-mode/org-babel?[1] Thanks, Bernd [1] This is the org-mode part in my .emacs: ;; The following lines are always needed. Choose your own keys. (add-to-list 'auto-mode-alist '(\\.org\\' . org-mode)) (global-set-key \C-cl 'org-store-link) (global-set-key \C-ca 'org-agenda) (global-set-key \C-cb 'org-iswitchb) (global-font-lock-mode 1) ; for all buffers (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only ;;(setq org-ditaa-jar-path D:/programme/emacs/site-lisp/org-mode/contrib/scripts/ditaa.jar) (setq org-directory e:/projects/org/) (setq org-confirm-babel-evaluate nil) ;; active Babel languages (setq org-babel-load-languages (quote ((emacs-lisp . t) (R . t) (python . t) ) ) ) (setq org-src-fontify-natively t) ___ 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
[Orgmode] [Org-Babel] Export environments for shell results?
#+TITLE: Org-Babel export environments for shell results * Example ** Medium output #+srcname: is-converted-to-listings #+begin_src sh :results output :exports both grep autoload ~/Downloads/emacs/site-lisp/org-mode/lisp/ob.el | cut -d # -f 4 #+end_src #+results: is-converted-to-listings #+begin_example autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload #+end_example gets translated (in LaTeX) to: #+begin_src latex \begin{lstlisting} autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload autoload \end{lstlisting} #+end_src ** Short output ... while #+srcname: is-converted-to-verbatim #+begin_src sh :results output :exports both grep autoload ~/Downloads/emacs/site-lisp/org-mode/lisp/ob.el | cut -d # -f 4 | head -n 3 #+end_src #+results: is-converted-to-verbatim : autoload : autoload : autoload gets translated (in LaTeX) to: #+begin_src latex \begin{verbatim} autoload autoload autoload \end{verbatim} #+end_src with a leading space (that you don't see when running the command in the shell). The only difference is the shell command is adding =head -n 3=. * Questions 1. Why that difference of behavior? 2. What's the determining factor for switching between =verbatim= and =lstlisting= environments? 3. Why is there a leading space in the =verbatim= environment? Best regards, Seb -- Sébastien Vauban ___ 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
[Orgmode] [org-babel] :no-expand header expands noweb refs
Hi all, I may have understood the :no-expand header incorrectly, but I thought it suppressed expanding noweb references while exporting but seems to expand them. For example I have an org file that looks like this (simplified) : * Root #+begin_src fundamental :noweb yes :no-expand :tangle Root.txt Chunk1 Chunk2 #+end_src * Chunk 1 #+source: Chunk1 #+begin_src fundamental code for chunk 1 #+end_src * Chunk 2 #+source: Chunk2 #+begin_src fundamental code for chunk 2 #+end_src When I 'org-export-as-ascii-to-buffer' I expect this : Root Table of Contents = 1 Root ~~~ Chunk1 Chunk2 ... But I get this: Root Table of Contents = 1 Root 2 ... 1 Root ~~~ code for chunk 1 code for chunk 2 ... Thanks for the help! -deech ___ 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
[Orgmode] org-babel: feature-request: allow table-cells to be passed as strings
Hello ! Currently org-babel, when passing a table as input to a source-code-block, behaves like this: If the cell looks like a number, it will be converted to an integer or a float. Otherwise the cell-content is passed unconverted as a string. Now, dealing with very large numbers (which I want to process with calc), I found this behavior annoying, because babel converts my large numbers to float, loosing precision in the process. Now my request would be, to have a switch (maybe as a header argument) which would tell babel to pass all cells as unconverted strings. I have checked the documentation and the sources and have not been able to find such a switch. with kind regards, Marc-Oliver Ihm ___ 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
Re: [Orgmode] org-babel: feature-request: allow table-cells to be passed as strings
Hi, Could you send an example of the contents of such a cell, and what it is converted to? Maybe it will be possible to improve the parsing of numerals in Babel s.t. we don't lose precision in these cases. Thanks -- Eric Marc-Oliver Ihm i...@online.de writes: Hello ! Currently org-babel, when passing a table as input to a source-code-block, behaves like this: If the cell looks like a number, it will be converted to an integer or a float. Otherwise the cell-content is passed unconverted as a string. Now, dealing with very large numbers (which I want to process with calc), I found this behavior annoying, because babel converts my large numbers to float, loosing precision in the process. Now my request would be, to have a switch (maybe as a header argument) which would tell babel to pass all cells as unconverted strings. I have checked the documentation and the sources and have not been able to find such a switch. with kind regards, Marc-Oliver Ihm ___ 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 ___ 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
Re: [Orgmode] org-babel - utility to ease chopping src chunks into smaller org entries
Hi Richard, This is a good idea, I too frequently find myself splitting code blocks. How about this following alternative implementation which should be smart enough to notice if it is inside of a code block, and should work across any code block type. --8---cut here---start-8--- (defun org-babel-split-block-maybe (optional arg) Split the current source code block on the cursor. (interactive P) ((lambda (info) (if info (let ((lang (nth 0 info)) (indent (make-string (nth 6 info) ? )) (stars (concat (make-string (org-current-level) ?*) ))) (insert (concat (if (looking-at ^) \n) indent #+end_src\n (if arg stars indent) \n indent #+begin_src lang (if (looking-at [\n\r]) \n ))) (when arg (previous-line) (move-end-of-line 1))) (message Not in src block.))) (org-babel-get-src-block-info))) --8---cut here---end---8--- Let me know what you think. I notice your implementation uses regions, where as this one does not, so it's possible I left out some functionality. I'd like to include some version of this functionality into Org-mode core. Best -- Eric Richard Riley rile...@gmail.com writes: I often find myself chopping a large source code block into smaller entities with their own notes, tags and comments etc. This small utility facilitates that by wrapping the current region with org entry markers and src code delimiters. It assumes you are in a currently src block. http://splash-of-open-sauce.blogspot.com/2010/09/mark-region-as-src-code-if-prefix-used.html Its currently hardcoded for emacs-lisp but it might be useful nonetheless. (Anyone know how to make blogspot line wrap?) r. ___ 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 ___ 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
Re: [Orgmode] org-babel caching question
Hi Ista, You're correct, currently the caching mechanism employed by Babel only checks that the same code blocks are used to assign variable, and doesn't check that the results of those code blocks are the same. I'll look into what would be required to include variable values in cache hash calculation. Any fix to this will require changing when variable references are resolved and will most likely involve slight changes to many of the language-specific file, and therefore may take some time to implement. Thanks for raising this issue. Best -- Eric Ista Zahn iz...@psych.rochester.edu writes: Hi all, I am just starting to get org-babel figured out, but I've run into an issue that I could use help with. Basically, with :cache yes turned on, subsequent code blocks to not pick up changes in earlier code blocks. I would like to know if there is a way to make org babel pick up these changes. An example follows. ---8--begin example--8--- Test org-babel caching mechanism * Instructions 1. Assign the value 1 to variable a in source block1. 2. Run org-babel-execute-buffer. 3. Change variable a by assigning it the value 2 in source block1. 4. Run org-babel-execute-buffer, and notice that a is still equal to 1, 2 in source block2, when it should be 2, 2. * Create R object a #+srcname block1 #+begin_src R :session R1 :cache yes a - 1 #+end_src * Change the value of a #+srcname block2 #+begin_src R :session R1 :cache yes a - c(a, 2) #+end_src * Commentary It appears that the org-babel caching mechanism does not notice that input values have changed. This is inconvenient, because if I make a mistake in an earlier code block I have to turn caching off in order to get the values to be updated in subsequent code blocks. Is there any way to make babel check to see if the input values have changed? ---8--end example--8--- ___ 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
[Orgmode] org-babel caching question
Hi all, I am just starting to get org-babel figured out, but I've run into an issue that I could use help with. Basically, with :cache yes turned on, subsequent code blocks to not pick up changes in earlier code blocks. I would like to know if there is a way to make org babel pick up these changes. An example follows. ---8--begin example--8--- Test org-babel caching mechanism * Instructions 1. Assign the value 1 to variable a in source block1. 2. Run org-babel-execute-buffer. 3. Change variable a by assigning it the value 2 in source block1. 4. Run org-babel-execute-buffer, and notice that a is still equal to 1, 2 in source block2, when it should be 2, 2. * Create R object a #+srcname block1 #+begin_src R :session R1 :cache yes a - 1 #+end_src * Change the value of a #+srcname block2 #+begin_src R :session R1 :cache yes a - c(a, 2) #+end_src * Commentary It appears that the org-babel caching mechanism does not notice that input values have changed. This is inconvenient, because if I make a mistake in an earlier code block I have to turn caching off in order to get the values to be updated in subsequent code blocks. Is there any way to make babel check to see if the input values have changed? ---8--end example--8--- -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org ___ 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
[Orgmode] org-babel - utility to ease chopping src chunks into smaller org entries
I often find myself chopping a large source code block into smaller entities with their own notes, tags and comments etc. This small utility facilitates that by wrapping the current region with org entry markers and src code delimiters. It assumes you are in a currently src block. http://splash-of-open-sauce.blogspot.com/2010/09/mark-region-as-src-code-if-prefix-used.html Its currently hardcoded for emacs-lisp but it might be useful nonetheless. (Anyone know how to make blogspot line wrap?) r. ___ 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
[Orgmode] org-babel matlab example
Hi everybody, I am learning to use org-babel to evaluate in-line Matlab code block, but I cannot make it works when I press the C-c C-c, nor C-c C-v e. The export of code works, but the results was not there. My in-line code is like this: #+begin_src matlab :export results n = [1:10]; x = 5*n+4; x #+end_src Is there someone can provide me a working example? Thanks a lot. - etimecow...@gmail.com _.,,._ .:'`:. .' `. .'`. : : `.'`':'`'`/' `. \ | / ,' \ \ | / / `\_..,,.._/' {`'-,_`'-} {`'-,_`'-} {`'-,_`'-} `YY' ~^^~ ___ 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
[Orgmode] org-babel and empty code blocks : publishing html
On my journal capture template I include a #begin_src and #end_src block as I frequently want to journal code. Being lazy I dont necessarily want to delete this block even if I have no code in that org-entry. Is it possible to suppress the output nil which is generated for the html export for empty code blocks? ___ 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
Re: [Orgmode] org-babel and empty code blocks : publishing html
I'd think adding an :exports none header argument should be sufficient. Best -- Eric Richard Riley rile...@gmail.com writes: On my journal capture template I include a #begin_src and #end_src block as I frequently want to journal code. Being lazy I dont necessarily want to delete this block even if I have no code in that org-entry. Is it possible to suppress the output nil which is generated for the html export for empty code blocks? ___ 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 ___ 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
Re: [Orgmode] org-babel and empty code blocks : publishing html
What are your buffer-wide values for :exports and :results ? Richard Riley wrote: On my journal capture template I include a #begin_src and #end_src block as I frequently want to journal code. Being lazy I dont necessarily want to delete this block even if I have no code in that org-entry. Is it possible to suppress the output nil which is generated for the html export for empty code blocks? ___ 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 ___ 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
Re: [Orgmode] org-babel and empty code blocks : publishing html
Eric Schulte wrote: I'd think adding an :exports none header argument should be sufficient. If the code block is empty, I doesn't appear so. If you put in a literal nil in the code block, then :exports none does as expected. Best -- Eric Richard Riley rile...@gmail.com writes: On my journal capture template I include a #begin_src and #end_src block as I frequently want to journal code. Being lazy I dont necessarily want to delete this block even if I have no code in that org-entry. Is it possible to suppress the output nil which is generated for the html export for empty code blocks? ___ 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 ___ 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 ___ 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
Re: [Orgmode] org-babel and empty code blocks : publishing html
Erik Iverson er...@ccbr.umn.edu writes: Eric Schulte wrote: I'd think adding an :exports none header argument should be sufficient. If the code block is empty, I doesn't appear so. If you put in a literal nil in the code block, then :exports none does as expected. Best -- Eric Richard Riley rile...@gmail.com writes: On my journal capture template I include a #begin_src and #end_src block as I frequently want to journal code. Being lazy I dont necessarily want to delete this block even if I have no code in that org-entry. Is it possible to suppress the output nil which is generated for the html export for empty code blocks? ___ 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 ___ 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 Thanks fellas. -- ☘ http://www.shamrockirishbar.com, http://www.richardriley.net Learning French is trivial: the word for horse is 'cheval' and everything follows thusly. ___ 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
[Orgmode] org-babel-post-tangle-hook just opening tangled file
Hi Should (add-hook 'org-babel-post-tangle-hook (lambda () (save-window-excursion (find-file (buffer-file-name) work in .emacs? The purpose is simply opening the tangled file but I think the opening happens before the tangled file has finished of being written. I have tried (add-hook 'org-babel-post-tangle-hook (lambda () (save-window-excursion (find-file anyfile and no problem, but the first code does nothing, apparently. I am a beginner with elisp, so I beg your pardon. Miguel Ruiz. ___ 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
Re: [Orgmode] org-babel and gnuplot
Erik, That was the issue, the :file reference needed to be on the line above. Thanks. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson er...@ccbr.umn.edu wrote: On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. AFAIK, you can't break source code header argument lines across multiple lines. Is that how you actually have it in your org file? #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com http://www.developernotes.com ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org mailto:Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ 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 ___ 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
Re: [Orgmode] org-babel and gnuplot
That's great! I actually figured that was from pasting it. A lot of pasted examples come in a bit jumbled. Glad you're on your way! John On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker ni...@developernotes.comwrote: Erik, That was the issue, the :file reference needed to be on the line above. Thanks. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson er...@ccbr.umn.edu wrote: On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. AFAIK, you can't break source code header argument lines across multiple lines. Is that how you actually have it in your org file? #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com http://www.developernotes.com ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org mailto:Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ 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 ___ 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
Re: [Orgmode] org-babel and gnuplot
Nick, This got me curious to see the output. I tried to generate it on my computer and get this in the *gnuplot* buffer after running the code: - gnuplot plot data using 1:2:3 notitle ^ warning: Skipping data file with no valid points ^ x range is invalid - This is working for you, though? #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot data using 1:2:3 notitle #+end_src John On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker ni...@developernotes.comwrote: Erik, That was the issue, the :file reference needed to be on the line above. Thanks. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson er...@ccbr.umn.edu wrote: On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. AFAIK, you can't break source code header argument lines across multiple lines. Is that how you actually have it in your org file? #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com http://www.developernotes.com ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org mailto:Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ 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 ___ 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
SOLVED? [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
I am following up with a workaround for this old issue (from July). This problem persists with latest `git pull` on orgmode version 7.01 This minimal init file will cause it: (require 'org-install) ;(require 'org) (require 'ob-perl) uncomment the 2nd line, and the problem goes away. Cheers, Malcolm Cook Stowers Institute for Medical Research - Bioinformatics Kansas City, Missouri USA ___ 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
Re: [Orgmode] org-babel and gnuplot
John, I am reworking the gnuplot script, it is not done at this point, but this is what I currently have: #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set xtics nomirror rotate by -45 set key noenhanced set style data linespoints plot $data using 2:xtic(1) title columnheader(1), \ for [i=2:3] '' using i title columnheader(i) #+end_src Nick Parker www.developernotes.com On Wed, Sep 8, 2010 at 9:39 AM, John Hendy jw.he...@gmail.com wrote: Nick, This got me curious to see the output. I tried to generate it on my computer and get this in the *gnuplot* buffer after running the code: - gnuplot plot data using 1:2:3 notitle ^ warning: Skipping data file with no valid points ^ x range is invalid - This is working for you, though? #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot data using 1:2:3 notitle #+end_src John On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker ni...@developernotes.comwrote: Erik, That was the issue, the :file reference needed to be on the line above. Thanks. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson er...@ccbr.umn.edu wrote: On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. AFAIK, you can't break source code header argument lines across multiple lines. Is that how you actually have it in your org file? #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com http://www.developernotes.com ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org mailto:Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ 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 ___ 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
Re: SOLVED? [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Hi Malcolm, I've just pushed up a change that should fix this issue. After updating from git you will have to run make clean make to ensure that the org-install.el file is regenerated. Please let me know if the problem persists -- Eric Cook, Malcolm m...@stowers.org writes: I am following up with a workaround for this old issue (from July). This problem persists with latest `git pull` on orgmode version 7.01 This minimal init file will cause it: (require 'org-install) ;(require 'org) (require 'ob-perl) uncomment the 2nd line, and the problem goes away. Cheers, Malcolm Cook Stowers Institute for Medical Research - Bioinformatics Kansas City, Missouri USA ___ 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 ___ 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
Re: [Orgmode] org-babel-post-tangle-hook just opening tangled file
Hi Miguel, The hook is run as part of the tangle process, and the tangle process ensures that if the tangled file was not open before tangling it will not be open after tangling, so the code you pasted below will have no effect. You could use the following function instead of ob-tangle to get the behavior you've described. (defun schulte/tangle-then-open () (interactive) (mapc #'find-file (org-babel-tangle))) Best -- Eric Miguel Ruiz rbeni...@yahoo.es writes: Hi Should (add-hook 'org-babel-post-tangle-hook (lambda () (save-window-excursion (find-file (buffer-file-name) work in .emacs? The purpose is simply opening the tangled file but I think the opening happens before the tangled file has finished of being written. I have tried (add-hook 'org-babel-post-tangle-hook (lambda () (save-window-excursion (find-file anyfile and no problem, but the first code does nothing, apparently. I am a beginner with elisp, so I beg your pardon. Miguel Ruiz. ___ 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 ___ 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
RE: SOLVED? [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
fix confirmed. thanks! Malcolm Cook Stowers Institute for Medical Research - Bioinformatics Kansas City, Missouri USA -Original Message- From: Eric Schulte [mailto:schulte.e...@gmail.com] Sent: Wednesday, September 08, 2010 12:35 PM To: Cook, Malcolm Cc: 'emacs-orgmode@gnu.org' Subject: Re: SOLVED? [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring? Hi Malcolm, I've just pushed up a change that should fix this issue. After updating from git you will have to run make clean make to ensure that the org-install.el file is regenerated. Please let me know if the problem persists -- Eric Cook, Malcolm m...@stowers.org writes: I am following up with a workaround for this old issue (from July). This problem persists with latest `git pull` on orgmode version 7.01 This minimal init file will cause it: (require 'org-install) ;(require 'org) (require 'ob-perl) uncomment the 2nd line, and the problem goes away. Cheers, Malcolm Cook Stowers Institute for Medical Research - Bioinformatics Kansas City, Missouri USA ___ 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 ___ 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
Re: [Orgmode] org-babel and gnuplot
Nick, How about this?? Just fiddled around a little and wonder what you think. There might be a better way, but essentially, I've done the following: - Left y-axis = distance - Right y-axis = time - I couldn't get the xtic(1) option to work, so I replaced things with what I've found to work x:y:xticlabels(col#) - Beefed up the points to make them a little easier to see - Used your data to calibrate your speed --- The left y-axis is from 9-21min --- The right y-axis is from 1.5min - 3.5min --- This means the axes are 'calibrated' to 10mph What does the calibration do? It means that at a quick glance you can see your speed based on a target rate you set: - if speed/distance are on top of each other, you're right at your target - if speed (green) is higher than distance (red), you were faster than your target - if speed (green) is lower than distance (red), you were slower than your target Resetting your target is as easy as changing (in the code below): - Time: yrange [y1:y2] - Distance: y2range [y3:y4] All you have to do is make sure that y3/y1 = y4/y2 = target speed Also, remove the references to L/R and Red/Green if you'd like from the labels. I just tried to make the labels as easy as possible to follow so that no matter where you looked for a reference you would be forced to see what color/axis matched what value. I attached a sample graph. Sorry if I overstepped my bounds -- I realize it's *your* workout tracker. Take what you like and ditch the rest. I wanted to know how to do two different y axes anyway so it helped me learn. Code is here: --- gnuplot code --- #+tblname: sessions | Date| ID | Time | Distance | |-++---+--| | 9/1/2010| 1 | 14:00 | 2.4 | | 9/2/2010| 2 | 15:13 | 2.5 | | 9/10/2010 | 3 | 13:45 | 2.3 | | 9/11| 4 | 12:20 | 2.0 | | Spd 10mph | 5 | 16:35 | 2.8 | | Spd = 10mph | 6 |10 |1.666 | | Spd 10mph | 7 |20 | 2.8 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both reset set title Running Stats set size ratio square set xlabel Date set xtics nomirror rotate by -45 set yrange [9:21] set ylabel Time (min) -- Red set ytics nomirror set y2range [1.5:3.5] set y2label Distance (mi) -- Green set y2tics 0,0.5,3.5 set style data points plot data u 2:3:xticlabels(1) axis x1y1 lw 3 title 'Time (L axis)', \ data u 2:4 axis x2y2 lw 3 title 'Distance (R axis)' #+end_src --- end gnuplot code - Best regards, John On Wed, Sep 8, 2010 at 11:52 AM, Nick Parker ni...@developernotes.comwrote: John, I am reworking the gnuplot script, it is not done at this point, but this is what I currently have: #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set xtics nomirror rotate by -45 set key noenhanced set style data linespoints plot $data using 2:xtic(1) title columnheader(1), \ for [i=2:3] '' using i title columnheader(i) #+end_src Nick Parker www.developernotes.com On Wed, Sep 8, 2010 at 9:39 AM, John Hendy jw.he...@gmail.com wrote: Nick, This got me curious to see the output. I tried to generate it on my computer and get this in the *gnuplot* buffer after running the code: - gnuplot plot data using 1:2:3 notitle ^ warning: Skipping data file with no valid points ^ x range is invalid - This is working for you, though? #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot data using 1:2:3 notitle #+end_src John On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker ni...@developernotes.comwrote: Erik, That was the issue, the :file reference needed to be on the line above. Thanks. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson er...@ccbr.umn.eduwrote: On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. AFAIK, you can't break source code header argument lines across multiple lines. Is that how you actually have it in your org
Re: [Orgmode] org-babel and gnuplot
John, Thanks for you're input, I'll give it a whirl. Nick Parker www.developernotes.com On Wed, Sep 8, 2010 at 2:04 PM, John Hendy jw.he...@gmail.com wrote: Nick, How about this?? Just fiddled around a little and wonder what you think. There might be a better way, but essentially, I've done the following: - Left y-axis = distance - Right y-axis = time - I couldn't get the xtic(1) option to work, so I replaced things with what I've found to work x:y:xticlabels(col#) - Beefed up the points to make them a little easier to see - Used your data to calibrate your speed --- The left y-axis is from 9-21min --- The right y-axis is from 1.5min - 3.5min --- This means the axes are 'calibrated' to 10mph What does the calibration do? It means that at a quick glance you can see your speed based on a target rate you set: - if speed/distance are on top of each other, you're right at your target - if speed (green) is higher than distance (red), you were faster than your target - if speed (green) is lower than distance (red), you were slower than your target Resetting your target is as easy as changing (in the code below): - Time: yrange [y1:y2] - Distance: y2range [y3:y4] All you have to do is make sure that y3/y1 = y4/y2 = target speed Also, remove the references to L/R and Red/Green if you'd like from the labels. I just tried to make the labels as easy as possible to follow so that no matter where you looked for a reference you would be forced to see what color/axis matched what value. I attached a sample graph. Sorry if I overstepped my bounds -- I realize it's *your* workout tracker. Take what you like and ditch the rest. I wanted to know how to do two different y axes anyway so it helped me learn. Code is here: --- gnuplot code --- #+tblname: sessions | Date| ID | Time | Distance | |-++---+--| | 9/1/2010| 1 | 14:00 | 2.4 | | 9/2/2010| 2 | 15:13 | 2.5 | | 9/10/2010 | 3 | 13:45 | 2.3 | | 9/11| 4 | 12:20 | 2.0 | | Spd 10mph | 5 | 16:35 | 2.8 | | Spd = 10mph | 6 |10 |1.666 | | Spd 10mph | 7 |20 | 2.8 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both reset set title Running Stats set size ratio square set xlabel Date set xtics nomirror rotate by -45 set yrange [9:21] set ylabel Time (min) -- Red set ytics nomirror set y2range [1.5:3.5] set y2label Distance (mi) -- Green set y2tics 0,0.5,3.5 set style data points plot data u 2:3:xticlabels(1) axis x1y1 lw 3 title 'Time (L axis)', \ data u 2:4 axis x2y2 lw 3 title 'Distance (R axis)' #+end_src --- end gnuplot code - Best regards, John On Wed, Sep 8, 2010 at 11:52 AM, Nick Parker ni...@developernotes.comwrote: John, I am reworking the gnuplot script, it is not done at this point, but this is what I currently have: #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set xtics nomirror rotate by -45 set key noenhanced set style data linespoints plot $data using 2:xtic(1) title columnheader(1), \ for [i=2:3] '' using i title columnheader(i) #+end_src Nick Parker www.developernotes.com On Wed, Sep 8, 2010 at 9:39 AM, John Hendy jw.he...@gmail.com wrote: Nick, This got me curious to see the output. I tried to generate it on my computer and get this in the *gnuplot* buffer after running the code: - gnuplot plot data using 1:2:3 notitle ^ warning: Skipping data file with no valid points ^ x range is invalid - This is working for you, though? #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot data using 1:2:3 notitle #+end_src John On Wed, Sep 8, 2010 at 8:10 AM, Nick Parker ni...@developernotes.comwrote: Erik, That was the issue, the :file reference needed to be on the line above. Thanks. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 10:27 PM, Erik Iverson er...@ccbr.umn.eduwrote: On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes
[Orgmode] org-babel-where-is-src-block-head
[1] E.g. `org-babel-where-is-src-block-head' may not be the proper way to detect if we're in a src block. I wonder what the proper way is ... At different points in the past, I had looked for org-at-babel-p or something similar. I invariably wound up using org-babel-where-is-src-block-head ... Jambunathan K. ___ 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
Re: [Orgmode] org-babel-where-is-src-block-head
Hello, Jambunathan K writes: [1] E.g. `org-babel-where-is-src-block-head' may not be the proper way to detect if we're in a src block. I wonder what the proper way is ... At different points in the past, I had looked for org-at-babel-p or something similar. I invariably wound up using org-babel-where-is-src-block-head ... I don't know it either but there is `org-in-regexps-block-p' for general use, and in org-list, I used something in the lines of this: (defun in-src-block-p () (save-excursion (let ((case-fold-search t)) (end-of-line) (and (re-search-backward ^[ \t]*#\\+\\(begin\\|end\\)_src nil t) (= (length (match-string 1)) 5) Regards, -- Nicolas ___ 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
[Orgmode] org-babel and gnuplot
Hello, I am attempting to generate a simple chart from gnuplot using the source of an org-table. When I execute the gnuplot src block I get the message Source block produced no output. Does anyone have any suggestions as to what might be the cause? I have included a sample of what I am trying to run: #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com ___ 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
Re: [Orgmode] org-babel and gnuplot
Hi Nick, Maybe two things off hand (booted into OS X right now where I can't try your code..) 1) try using straight gnuplot without going through org to verify your commands. This helps make sure that the syntax isn't producing errors. Another way to check this out sometimes is to C-c C-c on the code block, run the code, and then C-x b to the *gnuplot buffer to view any error messages. Those might prove helpful. 2) try changing your plot line to: plot data using 1:2:3 notitle I think I ran into an issue using $data even though it's the gnuplot syntax. I found org examples on the mailing list where just data was used instead (no quotes) and that worked. John P.S. Are you trying to make a 3D graph? plot using 1:2:3 will yield a 3D graph and you didn't mention a z-axis label so I'm wondering if that's really what you want? You may want to split this into two graphs to have date vs. time and date vs. distance? Or date vs. distance/time (speed)? P.P.S Or perhaps judging by the boxwidth option you want the width of the bars in the graph to represent the miles run? In that case you want 'plot data using 1:2:3 with boxes notitle' I think. On Tue, Sep 7, 2010 at 8:29 PM, Nick Parker ni...@developernotes.comwrote: Hello, I am attempting to generate a simple chart from gnuplot using the source of an org-table. When I execute the gnuplot src block I get the message Source block produced no output. Does anyone have any suggestions as to what might be the cause? I have included a sample of what I am trying to run: #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com ___ 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 ___ 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
Re: [Orgmode] org-babel and gnuplot
Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. Nick Parker www.developernotes.com On Tue, Sep 7, 2010 at 8:54 PM, John Hendy jw.he...@gmail.com wrote: Hi Nick, Maybe two things off hand (booted into OS X right now where I can't try your code..) 1) try using straight gnuplot without going through org to verify your commands. This helps make sure that the syntax isn't producing errors. Another way to check this out sometimes is to C-c C-c on the code block, run the code, and then C-x b to the *gnuplot buffer to view any error messages. Those might prove helpful. 2) try changing your plot line to: plot data using 1:2:3 notitle I think I ran into an issue using $data even though it's the gnuplot syntax. I found org examples on the mailing list where just data was used instead (no quotes) and that worked. John P.S. Are you trying to make a 3D graph? plot using 1:2:3 will yield a 3D graph and you didn't mention a z-axis label so I'm wondering if that's really what you want? You may want to split this into two graphs to have date vs. time and date vs. distance? Or date vs. distance/time (speed)? P.P.S Or perhaps judging by the boxwidth option you want the width of the bars in the graph to represent the miles run? In that case you want 'plot data using 1:2:3 with boxes notitle' I think. On Tue, Sep 7, 2010 at 8:29 PM, Nick Parker ni...@developernotes.comwrote: Hello, I am attempting to generate a simple chart from gnuplot using the source of an org-table. When I execute the gnuplot src block I get the message Source block produced no output. Does anyone have any suggestions as to what might be the cause? I have included a sample of what I am trying to run: #+tblname: sessions | Date | Time | Distance | |+---+--| | 09/02/2010 | 15:13 | 2.5 | | 09/01/2010 | 14:00 | 2.4 | #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com ___ 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 ___ 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
Re: [Orgmode] org-babel and gnuplot
On 09/07/2010 10:12 PM, Nick Parker wrote: Hi John, I would actually like to plot different lines per distance, each that correlate to a date and elapsed-time (x and y axis respectively). I get an error with the :file notation, though I read that in a sample babel gnuplot example for generating graphs of commit history on the org-mode git repository. I tried to reference the variable data without the quotes and $ sign without any success. I will continue to fiddle with it, I am new to gnuplot. AFAIK, you can't break source code header argument lines across multiple lines. Is that how you actually have it in your org file? #+begin_src gnuplot :var data=sessions :file org-running.png :exports both set title Running Stats set auto x set style data histogram set style fill solid border -1 set boxwidth .9 set xlabel Date set ylabel Time plot $data using 1:2:3 notitle #+end_src Nick Parker www.developernotes.com http://www.developernotes.com ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org mailto:Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ 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 ___ 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
[Orgmode] [org-babel] References Not Expanding
Hi all, I have the development version of org-mode and org-babel noweb style references are not expanding during evaluation, they are instead copied literally into the temp file. They seem to expand fine when tangling. Here is file that is failing: * Root #+begin_src haskell :noweb yes :tangle Main.hs Imports Test main = print $ test [1,2,3] #+end_src * Imports #+srcname: Imports #+begin_src haskell import Control.Monad.State #+end_src * Append Function #+srcname: Test #+begin_src haskell test = length #+end_src I have tried unsuccessfully to make Imports and Append Function children of Root. Thanks! -deech ___ 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
[Orgmode] [Org-Babel] and R... non-numeric cells
Hello, For a report I'm writing, I've been helped by a colleague of mine (let's call him Albert) for the R graphics generation. Here's an extract of my doc: --8---cut here---start-8--- #+TBLNAME: investissement-2010-2013 #+ATTR_LaTeX: align=l || \s{Année 2010} | \s{Année 2011} | \s{Année 2012} | \s{Année 2013} | |++++| | RFO| 2596376.30 | 150.00 | 50.00 | 50.00 | | RFO réseau structurant | 3804467.00 | 6534066.00 | 3804467.00 | 0.00 | | Équipements| 100.00 | 15.00 | 5.00 | 5.00 | |++++| | Total (HTVA) | 7400843.30 | 8184066.00 | 4354467.00 | 55.00 | #+TBLFM: @5$2=vsum(@-...@-ii);%.2f::@5$3=vsum(@-...@-ii);%.2f::@5$4=vsum(@-...@-ii);%.2f::@5$5=vsum(@-...@-ii);%.2f whose graphical representation is: #+srcname: barplot-investment(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - as.matrix(ptable[2:4, -1]) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[-nrow(ptable),1], legend.location=topright) #+end_src --8---cut here---end---8--- That works perfectly for him (on Ubuntu 9.04, R 2.7.1, Emacs 22.2.1, Org 6.35) Not for me... on Ubuntu 10.04, R 2.10.1, Emacs 23.1.1, Org 7.01, ESS 5.10: I get the message *Error in as.matrix(ptable[2:4, -1])/1e+06 : non-numeric argument to binary operator* As 1M is numeric, the non-numeric operand must be =as.matrix(ptable[2:4, -1])=... Verification: --8---cut here---start-8--- ptable V1 V2 V3 V4 1\\s{Année 2010} \\s{Année 2011} \\s{Année 2012} 2RFO 2596376.3 150.050.0 3 RFO réseau structurant 3804467.0 6534066.0 3804467.0 4Équipements 100.015.0 5.0 5 Total (HTVA) 7400843.3 8184066.0 4354467.0 V5 1 \\s{Année 2013} 250.0 3 0.0 4 5.0 555.0 as.matrix(ptable[2:4, -1]) V2 V3 V4 V5 2 2596376.3 150.0 50.0 50.0 3 3804467.0 6534066.0 3804467.0 0.0 4 100.0 15.0 5.0 5.0 --8---cut here---end---8--- The numerics are written between double quotes... Why!? I had temporarily patched the above problem in my document by updating the line with the assignment: --8---cut here---start-8--- #+srcname: barplot-investment-sva(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-sva-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - matrix(as.numeric(as.matrix(ptable[2:4, -1])), nrow=3, ncol=4) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[2:4,1], legend.location=topright) #+end_src --8---cut here---end---8--- and I even just noticed that, instead of complexifying the expression, I can simplify it, in my case, as my =ptable= is numeric already: --8---cut here---start-8--- ptable[2:4, -1] V2V3V4 V5 2 2596376.3 150.0 50.0 50.0 3 3804467.0 6534066.0 3804467.0 0.0 4 100.0 15.0 5.0 5.0 --8---cut here---end---8--- But I still don't understand what is reponsible of a different treatment of string and numerics between our 2 machines. Any idea? Best regards, Seb -- Sébastien Vauban ___ 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
Re: [Orgmode] [Org-Babel] and R... non-numeric cells
Hello, I'm *guessing* that this is more likely an issue of R than of org-mode. Have you tried tangling the code and simply running the scripts through R? Essentially, the as.matrix function call is returning a character matrix, which could mean your object 'alldata' has some factors instead of numeric columns. R 2.7.1 is, by R standards, ancient, so it would not surprise me a bit if the differences were because of that old version. Unless you can show that this is somehow org-mode related, I'd construct a reproducible example and ask R-help. In any case, reproducible example will help in solving the problem. Good luck! --Erik Sébastien Vauban wrote: Hello, For a report I'm writing, I've been helped by a colleague of mine (let's call him Albert) for the R graphics generation. Here's an extract of my doc: --8---cut here---start-8--- #+TBLNAME: investissement-2010-2013 #+ATTR_LaTeX: align=l || \s{Année 2010} | \s{Année 2011} | \s{Année 2012} | \s{Année 2013} | |++++| | RFO| 2596376.30 | 150.00 | 50.00 | 50.00 | | RFO réseau structurant | 3804467.00 | 6534066.00 | 3804467.00 | 0.00 | | Équipements| 100.00 | 15.00 | 5.00 | 5.00 | |++++| | Total (HTVA) | 7400843.30 | 8184066.00 | 4354467.00 | 55.00 | #+TBLFM: @5$2=vsum(@-...@-ii);%.2f::@5$3=vsum(@-...@-ii);%.2f::@5$4=vsum(@-...@-ii);%.2f::@5$5=vsum(@-...@-ii);%.2f whose graphical representation is: #+srcname: barplot-investment(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - as.matrix(ptable[2:4, -1]) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[-nrow(ptable),1], legend.location=topright) #+end_src --8---cut here---end---8--- That works perfectly for him (on Ubuntu 9.04, R 2.7.1, Emacs 22.2.1, Org 6.35) Not for me... on Ubuntu 10.04, R 2.10.1, Emacs 23.1.1, Org 7.01, ESS 5.10: I get the message *Error in as.matrix(ptable[2:4, -1])/1e+06 : non-numeric argument to binary operator* As 1M is numeric, the non-numeric operand must be =as.matrix(ptable[2:4, -1])=... Verification: --8---cut here---start-8--- ptable V1 V2 V3 V4 1\\s{Année 2010} \\s{Année 2011} \\s{Année 2012} 2RFO 2596376.3 150.050.0 3 RFO réseau structurant 3804467.0 6534066.0 3804467.0 4Équipements 100.015.0 5.0 5 Total (HTVA) 7400843.3 8184066.0 4354467.0 V5 1 \\s{Année 2013} 250.0 3 0.0 4 5.0 555.0 as.matrix(ptable[2:4, -1]) V2 V3 V4 V5 2 2596376.3 150.0 50.0 50.0 3 3804467.0 6534066.0 3804467.0 0.0 4 100.0 15.0 5.0 5.0 --8---cut here---end---8--- The numerics are written between double quotes... Why!? I had temporarily patched the above problem in my document by updating the line with the assignment: --8---cut here---start-8--- #+srcname: barplot-investment-sva(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-sva-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - matrix(as.numeric(as.matrix(ptable[2:4, -1])), nrow=3, ncol=4) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[2:4,1], legend.location=topright) #+end_src --8---cut here---end---8--- and I even just noticed that, instead of complexifying the expression, I can simplify it, in my case, as my =ptable= is numeric already: --8---cut here---start-8--- ptable[2:4, -1] V2V3V4 V5 2 2596376.3 150.0 50.0 50.0 3 3804467.0 6534066.0 3804467.0 0.0 4 100.0 15.0 5.0 5.0 --8---cut here---end---8--- But I still don't understand what is reponsible of a different treatment of string and numerics between our 2 machines. Any idea? Best regards, Seb ___ Emacs-orgmode mailing list
Re: [Orgmode] [Org-Babel] and R... non-numeric cells
I have had a similar problem and I traced it back to the presence of horizontal lines in the source table. The two ways that I have dealt with the problem are to either not have horizontal lines in the table or use some R stuff to clean things up. For example, suppose that I have the following table #+TBLNAME: mytbl |column1|column2| ||---| | 45 |34 | | 77 |56 | when I send that to R, it will treat everything as character due to the horizontal line. The following R snippet will clean it up and recast everything as numeric. #+BEGIN_SRC R :var tbl=mytbl names(tbl) - tbl[1,] #renames the variables from V1, V2 etc to what they should be tbl - tb[-1,] #gets rid of the first row that had the errant variable names for (i in 1:ncol(tbl)){ tbl[,i] - as.numeric(tbl[,i]) } # the for-loop goes through each column and recasts it as a numeric variable instead of character. #+END_SRC of course, if you have a column of text in the first column (or any column for that matter) you need to adjust your for-loop accordingly. I hope this helps. -Neil On 2010-08-12, at 9:06 AM, Sébastien Vauban wrote: Hello, For a report I'm writing, I've been helped by a colleague of mine (let's call him Albert) for the R graphics generation. Here's an extract of my doc: --8---cut here---start-8--- #+TBLNAME: investissement-2010-2013 #+ATTR_LaTeX: align=l || \s{Année 2010} | \s{Année 2011} | \s{Année 2012} | \s{Année 2013} | |++++| | RFO| 2596376.30 | 150.00 | 50.00 | 50.00 | | RFO réseau structurant | 3804467.00 | 6534066.00 | 3804467.00 | 0.00 | | Équipements| 100.00 | 15.00 | 5.00 | 5.00 | |++++| | Total (HTVA) | 7400843.30 | 8184066.00 | 4354467.00 | 55.00 | #+TBLFM: @5$2=vsum(@-...@-ii);%.2f::@5$3=vsum(@-...@-ii);%.2f::@5$4=vsum(@-...@-ii);%.2f::@5$5=vsum(@-...@-ii);%.2f whose graphical representation is: #+srcname: barplot-investment(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - as.matrix(ptable[2:4, -1]) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[-nrow(ptable),1], legend.location=topright) #+end_src --8---cut here---end---8--- That works perfectly for him (on Ubuntu 9.04, R 2.7.1, Emacs 22.2.1, Org 6.35) Not for me... on Ubuntu 10.04, R 2.10.1, Emacs 23.1.1, Org 7.01, ESS 5.10: I get the message *Error in as.matrix(ptable[2:4, -1])/1e+06 : non-numeric argument to binary operator* As 1M is numeric, the non-numeric operand must be =as.matrix(ptable[2:4, -1])=... Verification: --8---cut here---start-8--- ptable V1 V2 V3 V4 1\\s{Année 2010} \\s{Année 2011} \\s{Année 2012} 2RFO 2596376.3 150.050.0 3 RFO réseau structurant 3804467.0 6534066.0 3804467.0 4Équipements 100.015.0 5.0 5 Total (HTVA) 7400843.3 8184066.0 4354467.0 V5 1 \\s{Année 2013} 250.0 3 0.0 4 5.0 555.0 as.matrix(ptable[2:4, -1]) V2 V3 V4 V5 2 2596376.3 150.0 50.0 50.0 3 3804467.0 6534066.0 3804467.0 0.0 4 100.0 15.0 5.0 5.0 --8---cut here---end---8--- The numerics are written between double quotes... Why!? I had temporarily patched the above problem in my document by updating the line with the assignment: --8---cut here---start-8--- #+srcname: barplot-investment-sva(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-sva-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - matrix(as.numeric(as.matrix(ptable[2:4, -1])), nrow=3, ncol=4) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[2:4,1], legend.location=topright) #+end_src --8---cut here---end---8--- and I even just noticed that, instead of complexifying the expression, I can simplify it, in my
Re: [Orgmode] [Org-Babel] and R... non-numeric cells
Which version of org-mode are you using? I do not see what you claim to see. What do you get when you run the following: #+TBLNAME: mytbl |column1|column2| ||---| | 45 |34 | | 77 |56 | #+BEGIN_SRC R :var tbl=mytbl :results output str(tbl) #+END_SRC I get the following, which looks right to me. #+results: : 'data.frame': 2 obs. of 2 variables: : $ column1: int 45 77 : $ column2: int 34 56 Neil Hepburn wrote: I have had a similar problem and I traced it back to the presence of horizontal lines in the source table. The two ways that I have dealt with the problem are to either not have horizontal lines in the table or use some R stuff to clean things up. For example, suppose that I have the following table #+TBLNAME: mytbl |column1|column2| ||---| | 45 |34 | | 77 |56 | when I send that to R, it will treat everything as character due to the horizontal line. The following R snippet will clean it up and recast everything as numeric. #+BEGIN_SRC R :var tbl=mytbl names(tbl) - tbl[1,] #renames the variables from V1, V2 etc to what they should be tbl - tb[-1,] #gets rid of the first row that had the errant variable names for (i in 1:ncol(tbl)){ tbl[,i] - as.numeric(tbl[,i]) } # the for-loop goes through each column and recasts it as a numeric variable instead of character. #+END_SRC of course, if you have a column of text in the first column (or any column for that matter) you need to adjust your for-loop accordingly. I hope this helps. -Neil On 2010-08-12, at 9:06 AM, Sébastien Vauban wrote: Hello, For a report I'm writing, I've been helped by a colleague of mine (let's call him Albert) for the R graphics generation. Here's an extract of my doc: --8---cut here---start-8--- #+TBLNAME: investissement-2010-2013 #+ATTR_LaTeX: align=l || \s{Année 2010} | \s{Année 2011} | \s{Année 2012} | \s{Année 2013} | |++++| | RFO| 2596376.30 | 150.00 | 50.00 | 50.00 | | RFO réseau structurant | 3804467.00 | 6534066.00 | 3804467.00 | 0.00 | | Équipements| 100.00 | 15.00 | 5.00 | 5.00 | |++++| | Total (HTVA) | 7400843.30 | 8184066.00 | 4354467.00 | 55.00 | #+TBLFM: @5$2=vsum(@-...@-ii);%.2f::@5$3=vsum(@-...@-ii);%.2f::@5$4=vsum(@-...@-ii);%.2f::@5$5=vsum(@-...@-ii);%.2f whose graphical representation is: #+srcname: barplot-investment(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M alldata - as.matrix(ptable[2:4, -1]) / 100 axisLabels - c(Année, Montant HTVA (M€)) mcStackedBarplot(alldata, Investissements, c(2010:2013), ptable[-nrow(ptable),1], legend.location=topright) #+end_src --8---cut here---end---8--- That works perfectly for him (on Ubuntu 9.04, R 2.7.1, Emacs 22.2.1, Org 6.35) Not for me... on Ubuntu 10.04, R 2.10.1, Emacs 23.1.1, Org 7.01, ESS 5.10: I get the message *Error in as.matrix(ptable[2:4, -1])/1e+06 : non-numeric argument to binary operator* As 1M is numeric, the non-numeric operand must be =as.matrix(ptable[2:4, -1])=... Verification: --8---cut here---start-8--- ptable V1 V2 V3 V4 1\\s{Année 2010} \\s{Année 2011} \\s{Année 2012} 2RFO 2596376.3 150.050.0 3 RFO réseau structurant 3804467.0 6534066.0 3804467.0 4Équipements 100.015.0 5.0 5 Total (HTVA) 7400843.3 8184066.0 4354467.0 V5 1 \\s{Année 2013} 250.0 3 0.0 4 5.0 555.0 as.matrix(ptable[2:4, -1]) V2 V3 V4 V5 2 2596376.3 150.0 50.0 50.0 3 3804467.0 6534066.0 3804467.0 0.0 4 100.0 15.0 5.0 5.0 --8---cut here---end---8--- The numerics are written between double quotes... Why!? I had temporarily patched the above problem in my document by updating the line with the assignment: --8---cut here---start-8--- #+srcname: barplot-investment-sva(ptable = investissement-2010-2013) #+begin_src R :file 1-01-investissement-sva-2010-2013.png :exports none :session source(mcplot.R, local=TRUE) ## select the last row only, exclude first column, scale: unit = 1M
[Orgmode] Org-Babel and Ledger
Hello, I'm trying to really begin working with Ledger for my personal accounting. Of course, trying to do it with as much Org as possible... Though, results of 3 small requests (whose results is snipped, for brievety) is the following: --8---cut here---start-8--- #+TITLE: Scorpios-Ledger #+LANGUAGE: en_US * Balance #+srcname: bal #+begin_src sh ledger -f scorpios-ledger.dat bal #+end_src #+results: bal | -1117.47 | EUR | Assets:Bank | | 1036.15 | EUR | Checking:FR04304429459 | | -631.62 | EUR | Savings:FR00307599427 | | -1522.0 | EUR | Transferred | | -2036.52 | EUR | Expenses| |20.25 | EUR | Bank:Charges| | 175.09 | EUR | Insurance:House | | -2838.1 | EUR | Unknown | | 606.24 | EUR | Utilities:Electricity | | 3153.99 | EUR | Liabilities:Loans:Cecaz | | | | | | -0.0 | EUR | | * Registry #+srcname: reg #+begin_src sh ledger -f scorpios-ledger.dat reg unknown #+end_src #+results: reg | 2009/08/21 | CHEQUE | : | 9953055 | Expenses:Unknown | 166.7| EUR | 166.7| EUR | | | | 2009/09/17 | CHEQUE | : | 7691785 | Expenses:Unknown | 100.0| EUR | 266.7| EUR | | | | 2009/10/16 | REMISE | CHEQUE | N| 86.. | Expenses:Unknown | -525.0 | EUR | -258.3 | EUR | | | 2009/11/06 | CHEQUE | : | 7691786 | Expenses:Unknown | 192.0| EUR | -66.3| EUR | | | | 2009/11/24 | CHEQUE | : | 7691787 | Expenses:Unknown | 833.0| EUR | 766.7| EUR | | | | 2009/11/25 | REMISE | CHEQUE | N| 92.. | Expenses:Unknown | -970.0 | EUR | -203.3 | EUR | | | 2009/12/31 | INTERETS | CAPITALISES | Expenses:Unknown | -8.48| EUR | -211.78 | EUR | | | | | 2010/01/05 | CHEQUE | : | 7691789 | Expenses:Unknown | 733.0| EUR | 521.22 | EUR | | | | 2010/01/05 | REMISE | CHEQUE | N| 93.. | Expenses:Unknown | -525.0 | EUR |-3.78 | EUR | | | 2010/01/14 | REMISE | CHEQUE | N| 98.. | Expenses:Unknown | -525.0 | EUR | -528.78 | EUR | | | 2010/01/16 | FRAIS| PRELEVEMENT | .. | Expenses:Unknown | 10.73| EUR | -518.05 | EUR | | | * Reporting monthly expenses #+srcname: monthly-exp #+begin_src sh ledger -f scorpios-ledger.dat -M reg ^expenses #+end_src #+results: monthly-exp | 2009/08/01 |0 | 2009/08/31 | Expenses:Bank:Charges | 3.05 | EUR | 3.05 | EUR | | Expenses:Unknown |166.7 | EUR|169.75 | EUR | | | | | 2009/09/01 |0 | 2009/09/30 | Expenses:Bank:Charges | 1.1 | EUR | 170.85 | EUR | | Ex:Insurance:House | 15.9 | EUR|186.75 | EUR | | | | | Expenses:Unknown |100.0 | EUR|286.75 | EUR | | | | | 2009/10/01 |0 | 2009/10/31 | Expenses:Bank:Charges | 5.85 | EUR |292.6 | EUR | | Ex:Insurance:House | 15.9 | EUR| 308.5 | EUR | | | | | Expenses:Unknown | -525.0 | EUR|-216.5 | EUR | | | | | Ex:Ut:Electricity |28.38 | EUR| -188.12 | EUR | | | | | 2009/11/01 |0 | 2009/11/30 | Expenses:Bank:Charges | 1.1 | EUR | -187.02 | EUR | | Ex:Insurance:House | 15.9 | EUR| -171.12 | EUR | | | | | Expenses:Unknown | 55.0 | EUR| -116.12 | EUR | | | | --8---cut here---end---8--- As you can see, the tables are completely wrongly made, because they're based on spaces (à la Awk) and not on fixed position of fields (à la Cut). What can I do about this? - Post-process every ledger command with some awk or cut command that will do whatever is needed - Exploit the CSV export format (never tried, don't have Ledger 3 installed yet -- and I'm also using hledger...) - Other ideas? Do you have suggestions about the best way to go? Best regards, Seb -- Sébastien Vauban ___ Emacs-orgmode mailing list
[Orgmode] org-babel and OCaml - help?
Hi everybody, I have just started playing around with org-babel, and it's really awesome! I've had great luck with emacs-lisp source blocks, and when I saw that OCaml source blocks were also supported, I started testing those out. Right away I ran into trouble, though. Observe the example below: --8---cut here---start-8--- #+tblname: example-table | 1 | 2 | | 2 | 3 | | 3 | 5 | | 4 | 6 | #+source: ocaml-length #+begin_src ocaml :var table=example-table List.length table #+end_src #+results: ocaml-length : Characters 14-15: : let table = ((1 2) (2 3) (3 5) (4 6)); : ^ : Error: This expression is not a function; it cannot be applied #+results: ocaml-length --8---cut here---end---8--- It looks as though the 'table' variable is being passed as Lisp code instead of OCaml. Is there something that my setup is missing, or does the OCaml code perhaps need more help? Maybe I did something wrong? (I'd love to work on fixing up the OCaml interface, if that's needed.) -- Erik Arneson dyb...@lnouv.com GPG Key ID: 1024D/62DA1D25 Office: +1.541.291.9776 Skype: callto://pymander ___ 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
Re: [Orgmode] org-babel and OCaml - help?
Hi Erik, dyb...@lnouv.com (Erik L. Arneson) writes: Hi everybody, I have just started playing around with org-babel, and it's really awesome! I've had great luck with emacs-lisp source blocks, and when I saw that OCaml source blocks were also supported, I started testing those out. Right away I ran into trouble, though. Observe the example below: #+tblname: example-table | 1 | 2 | | 2 | 3 | | 3 | 5 | | 4 | 6 | #+source: ocaml-length #+begin_src ocaml :var table=example-table List.length table #+end_src #+results: ocaml-length : Characters 14-15: : let table = ((1 2) (2 3) (3 5) (4 6)); : ^ : Error: This expression is not a function; it cannot be applied #+results: ocaml-length It looks as though the 'table' variable is being passed as Lisp code instead of OCaml. Is there something that my setup is missing, or does the OCaml code perhaps need more help? Maybe I did something wrong? Nope you diagnosed the problem exactly, this isn't an issue with your setup, but rather with the current babel-ocaml integration. The language specific interaction functionality tends to evolve by need, and I don't think many people have been banging on ocaml through Babel up to this point. I've just pushed up a commit with teaches Babel how to feed tables to ocaml, so your example above re-written as below should now work. --8---cut here---start-8--- #+tblname: example-table | 1 | | 2 | | 3 | | 4 | #+source: ocaml-length #+begin_src ocaml :var table=example-table Array.length table;; #+end_src #+results: ocaml-length : 4 --8---cut here---end---8--- (I'd love to work on fixing up the OCaml interface, if that's needed.) I'd love to have your help! The relevant code is located in org/lisp/ob-ocaml.el, you can see in the most recent commit the changes that I've just made for integrating table handling into this file. You'll notice by comparing ob-ocaml to some of the more mature code files like ob-R, ob-python, ob-ruby that there are many areas in which ob-ocaml could grow in functionality. Cheers -- Eric ___ 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
Re: [Orgmode] org-babel and emacs init
Still had some issues with your function Eric, but finally found the time to make it work on my system. Posting it here since I didn't use reply all the first time around, and someone else might find it useful. (defun my-org-babel-load-file (file) (let ((orig-file (expand-file-name file dotfiles-dir)) (tmp-file (make-temp-file my-ob-load nil .org))) (with-temp-file tmp-file (insert-file-contents orig-file)) (org-babel-load-file tmp-file))) Thanks for your help ! Cheers On Sat, Jul 3, 2010 at 3:56 AM, Eric Schulte schulte.e...@gmail.com wrote: Hi Julien, Org-mode prefers when it is used in buffers that are associated with files. The following version creates temporary files for each load. It will litter your /tmp directory instead of your emacs directory -- although it shouldn't be hard to add a quick cleanup at the end of the function. Cheers -- Eric (defun my-org-babel-load-file (file) (let ((tmp-file (make-temp-file my-ob-load))) (with-temp-file tmp-file (insert-file-contents (expand-file-name file dotfiles-dir)) (org-mode) (org-babel-execute-buffer Julien Fantin julien.fan...@gmail.com writes: Hi eric, I'v been trying to find a way to avoid the tangling involved in using org-babel-load-file when loading my config, as it clobbers my emacs directoy with files I don't use. But I'm getting errors with this function : (defun my-org-babel-load-file (file) (with-temp-buffer (insert-file-contents (expand-file-name file dotfiles-dir)) (org-mode) (org-babel-execute-buffer))) (my-org-babel-load-file init.org) It's giving me a hard time apparently due to org-babel-insert-result calling orgtbl-to-orgtbl on blocks of emacs-lisp which return nil. Could you suggest how to do this properly ? cheers and congratulations on the integration ! On Mon, Jun 28, 2010 at 7:59 PM, Eric Schulte schulte.e...@gmail.comwrote: Hi Richard, Happy this is sorted out. A similar startup example is available in the init.el file in my copy of the Emacs Starter Kit [1], which also tangles all configuration from org files. Cheers -- Eric Richard Riley rile...@gmail.com writes: Firstly : Carsten and Eric I emailed you privately as I had no news access - pls ignore. Problem solved. With the latest git pull for org-mode I couldn't start my emacs because my init files are org files untangled using babel. Here is an updated init.el which which uses the new names and pulls in ob-tangle. (setq dotfiles-dir (file-name-directory (or (buffer-file-name) load-file-name))) (let* ((org-dir (expand-file-name lisp (expand-file-name org-mode dotfiles-dir))) (org-contrib-dir (expand-file-name lisp (expand-file-name contrib (expand-file-name .. org-dir (load-path (append (list org-dir org-contrib-dir (concat org-dir /babel)) (or load-path nil (message %s org-dir) ;; load up Org-mode and Org-babel (require 'org-install) (require 'ob) (require 'ob-tangle) ) Footnotes: [1] http://github.com/eschulte/emacs-starter-kit/blob/master/init.el ___ 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 ___ 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
Re: [Orgmode] Org-babel init
Hi Eric, That worked. I am ready to go now! Thank you! Jordi Eric Schulte writes: Hi Jordi, The attached simple-init.el file works for me with emacs -Q -l simple-init.el Emacs started w/o error, and I was able to evaluate python code blocks with no problem. Please give it a try and let me know if it doesn't work -- Eric (note you'll have to update the path to org/lisp) xapplication/emacs-lisp[Click mouse-2 to save to a file] Jordi Inglada jordi.ingl...@cesbio.cnes.fr writes: Eric, Thanks for the answer. If I do that using emacs -q, I get this message when loading the configuration: Symbol's value as variable is void: org-babel-tangle-lang-exts An after that when trying to evaluate this block from the tutorial #+begin_src python import time print(Hello, today's date is %s % time.ctime()) print('Two plus two is') return 2 + 2 #+end_src I get this other message: org-babel-execute-src-block: No org-babel-execute function for python! If I put the configuration in my .emacs, the error I get is: org-babel-result-hash: Symbol's value as variable is void: org-babel-lob-one-liner-regexp I guess I missed something. Thanks. Jordi Eric Schulte writes: Hi Jordi, With the latest Org-mode from Git, Org-babel is now part of Org-mode, so you no longer need to add the contrib directory to your load path, or require org-babel-init. The following should work for you. (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (require 'org-install) (require 'ob-python) note that for a language-specific require, you now prefix the language name with ob- rather than org-babel- For more complete information on the new setup, see http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html Cheers -- Eric Jordi Inglada jordi.ingl...@cesbio.cnes.fr writes: Hi all, I am having the same problem as this user here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg17498.html and the contrib/lisp directory is indeed in my load path. I am using a git changeset cloned today (Org-mode version 6.34trans (release_6.36.608.gc1ef)). I have tried using emacs -q and then loading an .el file containing only the following lines: (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (setq load-path (cons /home/inglada/local/src/org-mode/contrib/lisp load-path)) (require 'org-install) (require 'org-babel-init) (require 'org-babel-python) and I get the same result. Thank you very much for your help. Jordi ___ 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 ___ 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
[Orgmode] Org-babel init
Hi all, I am having the same problem as this user here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg17498.html and the contrib/lisp directory is indeed in my load path. I am using a git changeset cloned today (Org-mode version 6.34trans (release_6.36.608.gc1ef)). I have tried using emacs -q and then loading an .el file containing only the following lines: (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (setq load-path (cons /home/inglada/local/src/org-mode/contrib/lisp load-path)) (require 'org-install) (require 'org-babel-init) (require 'org-babel-python) and I get the same result. Thank you very much for your help. Jordi ___ 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
Re: [Orgmode] Org-babel init
You need to see: http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html Jordi Inglada wrote: Hi all, I am having the same problem as this user here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg17498.html and the contrib/lisp directory is indeed in my load path. I am using a git changeset cloned today (Org-mode version 6.34trans (release_6.36.608.gc1ef)). I have tried using emacs -q and then loading an .el file containing only the following lines: (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (setq load-path (cons /home/inglada/local/src/org-mode/contrib/lisp load-path)) (require 'org-install) (require 'org-babel-init) (require 'org-babel-python) and I get the same result. Thank you very much for your help. Jordi ___ 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 ___ 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
Re: [Orgmode] Org-babel init
Hi Jordi, With the latest Org-mode from Git, Org-babel is now part of Org-mode, so you no longer need to add the contrib directory to your load path, or require org-babel-init. The following should work for you. (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (require 'org-install) (require 'ob-python) note that for a language-specific require, you now prefix the language name with ob- rather than org-babel- For more complete information on the new setup, see http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html Cheers -- Eric Jordi Inglada jordi.ingl...@cesbio.cnes.fr writes: Hi all, I am having the same problem as this user here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg17498.html and the contrib/lisp directory is indeed in my load path. I am using a git changeset cloned today (Org-mode version 6.34trans (release_6.36.608.gc1ef)). I have tried using emacs -q and then loading an .el file containing only the following lines: (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (setq load-path (cons /home/inglada/local/src/org-mode/contrib/lisp load-path)) (require 'org-install) (require 'org-babel-init) (require 'org-babel-python) and I get the same result. Thank you very much for your help. Jordi ___ 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 ___ 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
Re: [Orgmode] Org-babel init
Eric, Thanks for the answer. If I do that using emacs -q, I get this message when loading the configuration: Symbol's value as variable is void: org-babel-tangle-lang-exts An after that when trying to evaluate this block from the tutorial #+begin_src python import time print(Hello, today's date is %s % time.ctime()) print('Two plus two is') return 2 + 2 #+end_src I get this other message: org-babel-execute-src-block: No org-babel-execute function for python! If I put the configuration in my .emacs, the error I get is: org-babel-result-hash: Symbol's value as variable is void: org-babel-lob-one-liner-regexp I guess I missed something. Thanks. Jordi Eric Schulte writes: Hi Jordi, With the latest Org-mode from Git, Org-babel is now part of Org-mode, so you no longer need to add the contrib directory to your load path, or require org-babel-init. The following should work for you. (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (require 'org-install) (require 'ob-python) note that for a language-specific require, you now prefix the language name with ob- rather than org-babel- For more complete information on the new setup, see http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html Cheers -- Eric Jordi Inglada jordi.ingl...@cesbio.cnes.fr writes: Hi all, I am having the same problem as this user here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg17498.html and the contrib/lisp directory is indeed in my load path. I am using a git changeset cloned today (Org-mode version 6.34trans (release_6.36.608.gc1ef)). I have tried using emacs -q and then loading an .el file containing only the following lines: (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (setq load-path (cons /home/inglada/local/src/org-mode/contrib/lisp load-path)) (require 'org-install) (require 'org-babel-init) (require 'org-babel-python) and I get the same result. Thank you very much for your help. Jordi ___ 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 ___ 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
Re: [Orgmode] Org-babel init
Hi Jordi, The attached simple-init.el file works for me with emacs -Q -l simple-init.el Emacs started w/o error, and I was able to evaluate python code blocks with no problem. Please give it a try and let me know if it doesn't work -- Eric (note you'll have to update the path to org/lisp) simple-init.el Description: application/emacs-lisp Jordi Inglada jordi.ingl...@cesbio.cnes.fr writes: Eric, Thanks for the answer. If I do that using emacs -q, I get this message when loading the configuration: Symbol's value as variable is void: org-babel-tangle-lang-exts An after that when trying to evaluate this block from the tutorial #+begin_src python import time print(Hello, today's date is %s % time.ctime()) print('Two plus two is') return 2 + 2 #+end_src I get this other message: org-babel-execute-src-block: No org-babel-execute function for python! If I put the configuration in my .emacs, the error I get is: org-babel-result-hash: Symbol's value as variable is void: org-babel-lob-one-liner-regexp I guess I missed something. Thanks. Jordi Eric Schulte writes: Hi Jordi, With the latest Org-mode from Git, Org-babel is now part of Org-mode, so you no longer need to add the contrib directory to your load path, or require org-babel-init. The following should work for you. (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (require 'org-install) (require 'ob-python) note that for a language-specific require, you now prefix the language name with ob- rather than org-babel- For more complete information on the new setup, see http://eschulte.github.com/babel-dev/DONE-document-configuration-changes-for-Babel-integration.html Cheers -- Eric Jordi Inglada jordi.ingl...@cesbio.cnes.fr writes: Hi all, I am having the same problem as this user here: http://www.mail-archive.com/emacs-orgmode@gnu.org/msg17498.html and the contrib/lisp directory is indeed in my load path. I am using a git changeset cloned today (Org-mode version 6.34trans (release_6.36.608.gc1ef)). I have tried using emacs -q and then loading an .el file containing only the following lines: (setq load-path (cons /home/inglada/local/src/org-mode/lisp load-path)) (setq load-path (cons /home/inglada/local/src/org-mode/contrib/lisp load-path)) (require 'org-install) (require 'org-babel-init) (require 'org-babel-python) and I get the same result. Thank you very much for your help. Jordi ___ 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 ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Great, happy everything is working -- Eric Nicholas Putnam nput...@gmail.com writes: I got it working. I think that before emacs wasn't finding org-mode/contrib/lisp, but not generating any error (that I could see). Thanks again. On Thu, Jul 8, 2010 at 3:28 PM, Eric Schulte schulte.e...@gmail.com wrote: Alright, Fontification is not specifically an Org-babel feature, but is provided by Org-mode at large, the relevant portion of the manual is available online, and may be worth a quick read http://orgmode.org/manual/Literal-examples.html#Literal-examples I suppose it may be possible that you are using an old version of htmlize, I'd recommend looking for a message like the following htmlize.el 1.34 or later is needed for source code formatting in your *Messages* buffer after an html export. Aside from that, and the htmlize variables (which should all be set to their default values) - org-export-htmlize-output-type - org-export-htmlized-org-css-url - org-export-htmlize-css-font-prefix I don't know where the problem could lie. Sorry I can't be of more help -- Eric ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Dear Eric, Updating from the repository, and putting it at the head of my load-path fixed the problem with org-babel-tangle-lang-exts. Thanks. org-version returns org-mode version 6.36trans (release_6.36.576.gec22). I still can't seem to export python to html with syntax coloring when exporting to browser on C-c C-e b. Should this just work? I do see syntax coloring on C-c '. Setting or not setting org-export-htmlize doesn't seem to make any difference. Nik On Thu, Jul 8, 2010 at 12:41 AM, Eric Schulte schulte.e...@gmail.comwrote: Hi Nicholas, There are a couple of problems. The first was a missing autoload in org.el which I've now inserted (thanks for helping this issue come to light). The second has to do with your config. I believe you are loading an old version of Org-mode. Be sure to that the first instance of Org-mode on your load path is the newest version, you can run M-x org-version to see what version you are currently running, when I run that command the output starts with Org-mode version 6.36trans If yours starts with the same then you should be fine. I'm attaching a modified version of your init which worked for me against the latest Org-mode from git. A couple of differences worth noting in my modified version are - I'm putting the path to the org-mode git repository on my load path - I removed the calls to font-lock mode which shouldn't be necessary with current versions of Emacs - I fixed the call to `org-babel-do-load-languages' so that it's second argument is the org-babel-load-languages variable - I'm not loading ruby (which I just did to simplify my test of a minimal Emacs config -- you should be able to replace it) Please do a git pull on the Org-mode repo, re-run make clean make, and then give this new config file a try (with the org-mode load path adjusted to your system) and let me know how it goes. Best -- Eric ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Hi Nicholas, Nicholas Putnam nput...@gmail.com writes: Dear Eric, Updating from the repository, and putting it at the head of my load-path fixed the problem with org-babel-tangle-lang-exts. Thanks. Great, we're making progress org-version returns org-mode version 6.36trans (release_6.36.576.gec22). The Org-mode version looks good. I still can't seem to export python to html with syntax coloring when exporting to browser on C-c C-e b. Should this just work? I do see syntax coloring on C-c '. Setting or not setting org-export-htmlize doesn't seem to make any difference. What version of Emacs are you using? I htmlfontify requires at least Emacs 22 or later. Running 'emacs --version' at the shell will answer this one. If you have a recent enough Emacs, then can you try opening up a source-code buffer (say Python) and running M-x htmlfontify-buffer from withing the buffer. This should open up a buffer of html which when viewed through a web-browser looks very similar to your Emacs buffer fontification. If the above doesn't work, try loading htmlize.el explicitly from org/contrib/lisp/htmlize.el Best -- Eric Nik On Thu, Jul 8, 2010 at 12:41 AM, Eric Schulte schulte.e...@gmail.comwrote: Hi Nicholas, There are a couple of problems. The first was a missing autoload in org.el which I've now inserted (thanks for helping this issue come to light). The second has to do with your config. I believe you are loading an old version of Org-mode. Be sure to that the first instance of Org-mode on your load path is the newest version, you can run M-x org-version to see what version you are currently running, when I run that command the output starts with Org-mode version 6.36trans If yours starts with the same then you should be fine. I'm attaching a modified version of your init which worked for me against the latest Org-mode from git. A couple of differences worth noting in my modified version are - I'm putting the path to the org-mode git repository on my load path - I removed the calls to font-lock mode which shouldn't be necessary with current versions of Emacs - I fixed the call to `org-babel-do-load-languages' so that it's second argument is the org-babel-load-languages variable - I'm not loading ruby (which I just did to simplify my test of a minimal Emacs config -- you should be able to replace it) Please do a git pull on the Org-mode repo, re-run make clean make, and then give this new config file a try (with the org-mode load path adjusted to your system) and let me know how it goes. Best -- Eric ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
My emacs version is GNU Emacs 23.2.1 (x86_64-apple-darwin10.4.0) of 2010-07-07 htmlfontify-buffer on a python buffer worked -- although at first I thought it hadn't because all the font sizes were set to 0pt. How can I get org-babel to htmlfontify my code on html export? Nik On Thu, Jul 8, 2010 at 1:33 PM, Eric Schulte schulte.e...@gmail.com wrote: Hi Nicholas, Nicholas Putnam nput...@gmail.com writes: Dear Eric, Updating from the repository, and putting it at the head of my load-path fixed the problem with org-babel-tangle-lang-exts. Thanks. Great, we're making progress org-version returns org-mode version 6.36trans (release_6.36.576.gec22). The Org-mode version looks good. I still can't seem to export python to html with syntax coloring when exporting to browser on C-c C-e b. Should this just work? I do see syntax coloring on C-c '. Setting or not setting org-export-htmlize doesn't seem to make any difference. What version of Emacs are you using? I htmlfontify requires at least Emacs 22 or later. Running 'emacs --version' at the shell will answer this one. If you have a recent enough Emacs, then can you try opening up a source-code buffer (say Python) and running M-x htmlfontify-buffer from withing the buffer. This should open up a buffer of html which when viewed through a web-browser looks very similar to your Emacs buffer fontification. If the above doesn't work, try loading htmlize.el explicitly from org/contrib/lisp/htmlize.el Best -- Eric ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Alright, Fontification is not specifically an Org-babel feature, but is provided by Org-mode at large, the relevant portion of the manual is available online, and may be worth a quick read http://orgmode.org/manual/Literal-examples.html#Literal-examples I suppose it may be possible that you are using an old version of htmlize, I'd recommend looking for a message like the following htmlize.el 1.34 or later is needed for source code formatting in your *Messages* buffer after an html export. Aside from that, and the htmlize variables (which should all be set to their default values) - org-export-htmlize-output-type - org-export-htmlized-org-css-url - org-export-htmlize-css-font-prefix I don't know where the problem could lie. Sorry I can't be of more help -- Eric Nicholas Putnam nput...@gmail.com writes: My emacs version is GNU Emacs 23.2.1 (x86_64-apple-darwin10.4.0) of 2010-07-07 htmlfontify-buffer on a python buffer worked -- although at first I thought it hadn't because all the font sizes were set to 0pt. How can I get org-babel to htmlfontify my code on html export? Nik On Thu, Jul 8, 2010 at 1:33 PM, Eric Schulte schulte.e...@gmail.com wrote: Hi Nicholas, Nicholas Putnam nput...@gmail.com writes: Dear Eric, Updating from the repository, and putting it at the head of my load-path fixed the problem with org-babel-tangle-lang-exts. Thanks. Great, we're making progress org-version returns org-mode version 6.36trans (release_6.36.576.gec22). The Org-mode version looks good. I still can't seem to export python to html with syntax coloring when exporting to browser on C-c C-e b. Should this just work? I do see syntax coloring on C-c '. Setting or not setting org-export-htmlize doesn't seem to make any difference. What version of Emacs are you using? I htmlfontify requires at least Emacs 22 or later. Running 'emacs --version' at the shell will answer this one. If you have a recent enough Emacs, then can you try opening up a source-code buffer (say Python) and running M-x htmlfontify-buffer from withing the buffer. This should open up a buffer of html which when viewed through a web-browser looks very similar to your Emacs buffer fontification. If the above doesn't work, try loading htmlize.el explicitly from org/contrib/lisp/htmlize.el Best -- Eric ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
I got it working. I think that before emacs wasn't finding org-mode/contrib/lisp, but not generating any error (that I could see). Thanks again. On Thu, Jul 8, 2010 at 3:28 PM, Eric Schulte schulte.e...@gmail.com wrote: Alright, Fontification is not specifically an Org-babel feature, but is provided by Org-mode at large, the relevant portion of the manual is available online, and may be worth a quick read http://orgmode.org/manual/Literal-examples.html#Literal-examples I suppose it may be possible that you are using an old version of htmlize, I'd recommend looking for a message like the following htmlize.el 1.34 or later is needed for source code formatting in your *Messages* buffer after an html export. Aside from that, and the htmlize variables (which should all be set to their default values) - org-export-htmlize-output-type - org-export-htmlized-org-css-url - org-export-htmlize-css-font-prefix I don't know where the problem could lie. Sorry I can't be of more help -- Eric ___ 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
[Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
I'm new to, but loving playing with org-mode. Thanks for this excellent code! I followed the directions for checking out the latest version with git, so have been trying to catch up to the new configuration for babel, at the same time that I'm learning the ropes of org-mode. I am finding that babel will not work unless org-babel-tangle-lang-exts is set -- else I get the following error: Symbol's value as variable is void: org-babel-tangle-lang-exts Adding (setq org-babel-tangle-lang-exts '(fortran . f)) to my .emacs file (even though I'm not using fortran for anything) fixes this problem. Also, I'm trying to get syntax highlighting of source code elements in HTML export. Export looks great, but the code snippets are being exported inside pre class=example tags, without any other markup. Can anyone point me in the right direction? Cheers, Nik Putnam ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Hi Nicholas, I'm happy that you're enjoying Org-mode. Nicholas Putnam nput...@gmail.com writes: I'm new to, but loving playing with org-mode. Thanks for this excellent code! I followed the directions for checking out the latest version with git, so have been trying to catch up to the new configuration for babel, at the same time that I'm learning the ropes of org-mode. I am finding that babel will not work unless org-babel-tangle-lang-exts is set -- else I get the following error: Symbol's value as variable is void: org-babel-tangle-lang-exts Adding (setq org-babel-tangle-lang-exts '(fortran . f)) to my .emacs file (even though I'm not using fortran for anything) fixes this problem. I'm having trouble reproducing this problem. As far as I can tell `org-babel-tangle-lang-exts' is only called from language specific files which should be required after that variable has been defined. Is it possible that your configuration is loading language-specific files or touching org-babel-load-languages before you are calling (require 'org-install)? Also, I'm trying to get syntax highlighting of source code elements in HTML export. Export looks great, but the code snippets are being exported inside pre class=example tags, without any other markup. Can anyone point me in the right direction? Is the `org-export-htmlize' set to a non-nil value on your system? If so then that could be the cause of the problem. If it is set to a truthy value, and htmlize-region is defined in your Emacs, then I'm not sure what the problem could be. Best -- Eric Cheers, Nik Putnam ___ 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 ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
re: org-export-htmlize , Symbol's value as variable is void Here's my .emacs file. The line that sets org-babel-tangle-lang-exts is commented out. Further down, is the debugging output when emacs is started. Requiring ob-R doesn't generate an error, by either ob-ruby or ob-python will, unless org-babel-tangle-lang-exts is set. The call to ob-ruby that generates the error, at the bottom of .emacs, is definitely coming after 'org-install. Thanks again, Nik (setq load-path (append (list nil /usr/local/share/emacs/site-lisp /Users/nputnam/elisp/ruby-mode ) load-path)) (require 'org-install) (add-to-list 'auto-mode-alist '(\\.org\\' . org-mode)) (global-set-key \C-cl 'org-store-link) (global-set-key \C-ca 'org-agenda) (global-set-key \C-cb 'org-iswitchb) (global-font-lock-mode 1) ; for all buffers (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only (transient-mark-mode 1) ;(setq org-babel-tangle-lang-exts '(fortran . f)) ;(setq org-babel-tangle-lang-exts '()) (setq org-babel-do-load-languages '((R . t) (ditaa . nil) (dot . nil) (emacs-lisp . t) (gnuplot . t) (haskell . nil) (ocaml . nil) (python . t) (ruby . t) (screen . nil) (sh . t) (sql . nil) (sqlite . nil))) (require 'ob-R) ;(require 'ob-python) (require 'ob-ruby) Here is the emacs debugging output: Debugger entered--Lisp error: (void-variable org-babel-tangle-lang-exts) add-to-list(org-babel-tangle-lang-exts (ruby . rb)) byte-code(\301\302!\210\301\303!\210\301\304!\210\301\305!\210\306\307\310\\210\311^hb^p\312\311!\20...@\313\311\314\\210\314\207 [current-load-list$ require(ob-ruby) eval-buffer(#buffer *load* nil /Users/nputnam/.emacs nil t) ; Reading at buffer position 958 load-with-code-conversion(/Users/nputnam/.emacs /Users/nputnam/.emacs t t) load(~/.emacs t t) #[nil ^H\205\276^@ \306=\203...@\307^h\310q\202a^@ \311=\20...@\312\307\313\314#\203#^@\315\20...@\312\307\313\316#\203/^...@\317\202a^@\315\202A^@ \3$ command-line() normal-top-level() On Wed, Jul 7, 2010 at 10:29 PM, Eric Schulte schulte.e...@gmail.comwrote: Hi Nicholas, I'm happy that you're enjoying Org-mode. Nicholas Putnam nput...@gmail.com writes: I'm new to, but loving playing with org-mode. Thanks for this excellent code! I followed the directions for checking out the latest version with git, so have been trying to catch up to the new configuration for babel, at the same time that I'm learning the ropes of org-mode. I am finding that babel will not work unless org-babel-tangle-lang-exts is set -- else I get the following error: Symbol's value as variable is void: org-babel-tangle-lang-exts Adding (setq org-babel-tangle-lang-exts '(fortran . f)) to my .emacs file (even though I'm not using fortran for anything) fixes this problem. I'm having trouble reproducing this problem. As far as I can tell `org-babel-tangle-lang-exts' is only called from language specific files which should be required after that variable has been defined. Is it possible that your configuration is loading language-specific files or touching org-babel-load-languages before you are calling (require 'org-install)? Also, I'm trying to get syntax highlighting of source code elements in HTML export. Export looks great, but the code snippets are being exported inside pre class=example tags, without any other markup. Can anyone point me in the right direction? Is the `org-export-htmlize' set to a non-nil value on your system? If so then that could be the cause of the problem. If it is set to a truthy value, and htmlize-region is defined in your Emacs, then I'm not sure what the problem could be. Best -- Eric Cheers, Nik Putnam ___ 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 ___ 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
Re: [Orgmode] org-babel-tangle-lang-exts must be initialized? how to get syntax coloring?
Hi Nicholas, There are a couple of problems. The first was a missing autoload in org.el which I've now inserted (thanks for helping this issue come to light). The second has to do with your config. I believe you are loading an old version of Org-mode. Be sure to that the first instance of Org-mode on your load path is the newest version, you can run M-x org-version to see what version you are currently running, when I run that command the output starts with Org-mode version 6.36trans If yours starts with the same then you should be fine. I'm attaching a modified version of your init which worked for me against the latest Org-mode from git. A couple of differences worth noting in my modified version are - I'm putting the path to the org-mode git repository on my load path - I removed the calls to font-lock mode which shouldn't be necessary with current versions of Emacs - I fixed the call to `org-babel-do-load-languages' so that it's second argument is the org-babel-load-languages variable - I'm not loading ruby (which I just did to simplify my test of a minimal Emacs config -- you should be able to replace it) Please do a git pull on the Org-mode repo, re-run make clean make, and then give this new config file a try (with the org-mode load path adjusted to your system) and let me know how it goes. Best -- Eric minimal.el Description: application/emacs-lisp Nicholas Putnam nput...@gmail.com writes: re: org-export-htmlize , Symbol's value as variable is void Here's my .emacs file. The line that sets org-babel-tangle-lang-exts is commented out. Further down, is the debugging output when emacs is started. Requiring ob-R doesn't generate an error, by either ob-ruby or ob-python will, unless org-babel-tangle-lang-exts is set. The call to ob-ruby that generates the error, at the bottom of .emacs, is definitely coming after 'org-install. Thanks again, Nik (setq load-path (append (list nil /usr/local/share/emacs/site-lisp /Users/nputnam/elisp/ruby-mode ) load-path)) (require 'org-install) (add-to-list 'auto-mode-alist '(\\.org\\' . org-mode)) (global-set-key \C-cl 'org-store-link) (global-set-key \C-ca 'org-agenda) (global-set-key \C-cb 'org-iswitchb) (global-font-lock-mode 1) ; for all buffers (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only (transient-mark-mode 1) ;(setq org-babel-tangle-lang-exts '(fortran . f)) ;(setq org-babel-tangle-lang-exts '()) (setq org-babel-do-load-languages '((R . t) (ditaa . nil) (dot . nil) (emacs-lisp . t) (gnuplot . t) (haskell . nil) (ocaml . nil) (python . t) (ruby . t) (screen . nil) (sh . t) (sql . nil) (sqlite . nil))) (require 'ob-R) ;(require 'ob-python) (require 'ob-ruby) Here is the emacs debugging output: Debugger entered--Lisp error: (void-variable org-babel-tangle-lang-exts) add-to-list(org-babel-tangle-lang-exts (ruby . rb)) byte-code(\301\302!\210\301\303!\210\301\304!\210\301\305!\210\306\307\310\\210\311^hb^p\312\311!\20...@\313\311\314\\210\314\207 [current-load-list$ require(ob-ruby) eval-buffer(#buffer *load* nil /Users/nputnam/.emacs nil t) ; Reading at buffer position 958 load-with-code-conversion(/Users/nputnam/.emacs /Users/nputnam/.emacs t t) load(~/.emacs t t) #[nil ^H\205\276^@ \306=\203...@\307^h\310q\202a^@ \311=\20...@\312\307\313\314#\203#^@\315\20...@\312\307\313\316#\203/^...@\317\202a^@\315\202A^@ \3$ command-line() normal-top-level() On Wed, Jul 7, 2010 at 10:29 PM, Eric Schulte schulte.e...@gmail.comwrote: Hi Nicholas, I'm happy that you're enjoying Org-mode. Nicholas Putnam nput...@gmail.com writes: I'm new to, but loving playing with org-mode. Thanks for this excellent code! I followed the directions for checking out the latest version with git, so have been trying to catch up to the new configuration for babel, at the same time that I'm learning the ropes of org-mode. I am finding that babel will not work unless org-babel-tangle-lang-exts is set -- else I get the following error: Symbol's value as variable is void: org-babel-tangle-lang-exts Adding (setq org-babel-tangle-lang-exts '(fortran . f)) to my .emacs file (even though I'm not using fortran for anything) fixes this problem. I'm having trouble reproducing this problem. As far as I can tell `org-babel-tangle-lang-exts' is only called from language specific files which should be required after that variable has been defined. Is it possible that your configuration is loading language-specific files or touching org-babel-load-languages before you are calling (require 'org-install)? Also, I'm trying to get syntax highlighting of source code elements in HTML export. Export looks great, but the code snippets are being exported inside pre
Re: [Orgmode] org-babel-tangle-w-comments has no effect in R?
On Thu, Jul 1, 2010 at 5:41 PM, Eric Schulte schulte.e...@gmail.com wrote: Hi Rainer, Hi Eric There is one more requirement for tangling with comments, that is the presence of a :comments header argument. If this argument is not set for a code block then that code block *will not* be tangled with comments regardless of the value of `org-babel-tangle-w-comments'. That explains. You can set this variable to default to true for R code blocks with the following (add-to-list 'org-babel-default-header-args:R '(:comments . yes)) OK - it is working. What I actually did, was to add #+BABEL: :comments yes to the headers of the file, so I can control it on a file basis. Hope this helps. Definitely. I think that moving forward it might make sense to remove the org-babel-tangle-w-comments variable, as it's confusing to have two points of control for comments during tangling. Also, it looks like I need to add the :comments header argument to the babel documentation. Both points agreed. In addition: is it possible to customize the format for all comments (on a per file basis and / or a per block basis)? i.e. I don't need the file name, as all blocks are coming from one file. I know about #+srcname: name but is there a variable for the line number (I guess that is covered by the request posted in another thread) one could use? Also, would it be possible to include a link in the comment block, so that clicking on that link actually opens the org-file file at the location of the source block? That would make editing the code really easy. Thanks for helping to sort some of these issues out! Pleasure - I use them and I profit when they are sorted out. In addition: I think org-mode and babel deserve it - they are great tools for programming in R. Cheers, Rainer Best -- Eric Rainer M Krug r.m.k...@gmail.com writes: Hi I am trying to use tangle with comments. Based on a previous thread, I set org-babel-tangle-w-comments to t with (setq org-babel-tangle-w-comments t) in my emacs.org file. The variable is actually set to 1 - I checked vie C-h - v But nothing is changing in the tangled file? Am I doing something wrong? Or are comments not supported in R in org-babel? I attach a small testfile. Cheers, Rainer -- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax:+27 - (0)86 516 2782 Fax:+49 - (0)321 2125 2244 email: rai...@krugs.de Skype: RMkrug Google: r.m.k...@gmail.com ___ 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
Re: [Orgmode] org-babel-tangle-w-comments has no effect in R?
Hi Rainer, There is one more requirement for tangling with comments, that is the presence of a :comments header argument. If this argument is not set for a code block then that code block *will not* be tangled with comments regardless of the value of `org-babel-tangle-w-comments'. You can set this variable to default to true for R code blocks with the following (add-to-list 'org-babel-default-header-args:R '(:comments . yes)) Hope this helps. I think that moving forward it might make sense to remove the org-babel-tangle-w-comments variable, as it's confusing to have two points of control for comments during tangling. Also, it looks like I need to add the :comments header argument to the babel documentation. Thanks for helping to sort some of these issues out! Best -- Eric Rainer M Krug r.m.k...@gmail.com writes: Hi I am trying to use tangle with comments. Based on a previous thread, I set org-babel-tangle-w-comments to t with (setq org-babel-tangle-w-comments t) in my emacs.org file. The variable is actually set to 1 - I checked vie C-h - v But nothing is changing in the tangled file? Am I doing something wrong? Or are comments not supported in R in org-babel? I attach a small testfile. Cheers, Rainer ___ 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
Re: [Orgmode] [org-babel] Does org-babel needs some simplification?
Hi Torsten, I love the idea of a Babel for dummies manual, and I'm an even bigger fan of the manual being produced by user's of Babel (i.e. not myself). I'll be more than happy to support this effort in any way. Also, the beta-testing role you mention could be extremely helpful. In the absence of a comprehensive test suite it can be hard for Dan and I to exhaustively check new features against all of the possible languages and header argument combinations. A filter of language-savvy users exercising new Org-babel changes could very likely save the Every day babel user (is there such a thing?) from many headaches. Maybe something like a sandbox-babel branch of the git repository would be appropriate as a testing ground for new Babel commits. That said the rate at which Babel is currently being developed is not sustainable (at least not if I'm doing all of the development), and the number of daily changes should drop dramatically in the next couple of weeks. So such a group may find itself without much work to do in the not to distant future -- not that that would necessarily be a bad thing. Thanks! -- Eric Torsten Wagner torsten.wag...@gmail.com writes: Hi, many thanks for the nice thoughts and posts. To sum up, I think it might not be easy to remove parts of org-babel since it is difficult to determine and a highly personal decision to define what is important and what is unimportant. Nevertheless Carten and Eric pointed out that the overhelming feature set of org-babel, the fact that you could achive the same thing in different ways and the missing of a org-babel for dummies might be a problem for new org-babel users as well as for infrequent users. Recently org-mode got his org-mode for dummies short manual. I guess in the case of org-babel it might make more sense to create rather typical examples for particular languages. This manuals could consist of a typical example and of a template for this example which makes it easy for beginners to fill in there own code and text. Since Eric and the other org-babel and org-mode contributors are already fully occupied with keeping org-babel and org-mode running, I would suggest to collect a group of org-babel manual supporters. If possible for each supported language one. This group could write up standard situations for the particular language and maintain those manuscripts whenever org-babel introduces some changes. In fact this group could also serve as a kind of beta-testers for org-babel by trying on request from e.g., Eric to compile there examples with the new org-babel versions. I know there are some standard tests but I guess the do not go that fare. I guess, the manual maintainers do NOT have to be experts in both org-mode resp. org-babel nore they have to be experts in the supported language. Its more about the kind of standard stuff and maybe, to complex stuff even scare people. More things like How to create a measurement protocol with org-babel and python, How to evaluate and report data analysis with org-babel and R, etc. To make it more easy for both the readers and the maintainers a kind of template for such manuals might be helpful. This would help to find the same information at the same locations and make a comparison e.g. between the use of R and python possible. I'am not an expert for both org-* and python and I'm often very limited in time. However, I would try to maintain a python and org-babel manual. If there are more people who are interested to act as a kind of manual maintainers I would like to discuss with you how a template might look like. Best regards Torsten On 06/29/2010 12:51 PM, Torsten Wagner wrote: Dear All, as a (quite, but happy) org-bable user of the first hour I followed up the development process actively. Nevertheless, some weeks or months pass where I had no need for org-babel (yes, really strange I know). Whenever I come back to org-babel, it takes me a huge amount of time to find myself back again in the syntax. Often I spend a day or two heavily reading the website and manual again to figure out how to make it working. There are so many options. tangle files, results, scripting mode, sessions, noweb, lot, etc. Just yesterday, I fighted again to make a simple python script running as desired to generate an automatic report. I did this dozen of times and even by using some old report as template I still struggle with it. Comparing old reports I noticed that I did it in many different ways. Tangeling all snipplets, using noweb syntax, with and without session support, etc. Don't get me wrong, I really love org-babel and I think it is really great. I just wonder wether it has become too complex and too difficult to use to attract most of the org-mode people. Esp. considering people who use it not on a regular basis. Best regards Torsten ___ Emacs-orgmode mailing list
Re: [Orgmode] [org-babel] Does org-babel needs some simplification?
Hi, many thanks for the nice thoughts and posts. To sum up, I think it might not be easy to remove parts of org-babel since it is difficult to determine and a highly personal decision to define what is important and what is unimportant. Nevertheless Carten and Eric pointed out that the overhelming feature set of org-babel, the fact that you could achive the same thing in different ways and the missing of a org-babel for dummies might be a problem for new org-babel users as well as for infrequent users. Recently org-mode got his org-mode for dummies short manual. I guess in the case of org-babel it might make more sense to create rather typical examples for particular languages. This manuals could consist of a typical example and of a template for this example which makes it easy for beginners to fill in there own code and text. Since Eric and the other org-babel and org-mode contributors are already fully occupied with keeping org-babel and org-mode running, I would suggest to collect a group of org-babel manual supporters. If possible for each supported language one. This group could write up standard situations for the particular language and maintain those manuscripts whenever org-babel introduces some changes. In fact this group could also serve as a kind of beta-testers for org-babel by trying on request from e.g., Eric to compile there examples with the new org-babel versions. I know there are some standard tests but I guess the do not go that fare. I guess, the manual maintainers do NOT have to be experts in both org-mode resp. org-babel nore they have to be experts in the supported language. Its more about the kind of standard stuff and maybe, to complex stuff even scare people. More things like How to create a measurement protocol with org-babel and python, How to evaluate and report data analysis with org-babel and R, etc. To make it more easy for both the readers and the maintainers a kind of template for such manuals might be helpful. This would help to find the same information at the same locations and make a comparison e.g. between the use of R and python possible. I'am not an expert for both org-* and python and I'm often very limited in time. However, I would try to maintain a python and org-babel manual. If there are more people who are interested to act as a kind of manual maintainers I would like to discuss with you how a template might look like. Best regards Torsten On 06/29/2010 12:51 PM, Torsten Wagner wrote: Dear All, as a (quite, but happy) org-bable user of the first hour I followed up the development process actively. Nevertheless, some weeks or months pass where I had no need for org-babel (yes, really strange I know). Whenever I come back to org-babel, it takes me a huge amount of time to find myself back again in the syntax. Often I spend a day or two heavily reading the website and manual again to figure out how to make it working. There are so many options. tangle files, results, scripting mode, sessions, noweb, lot, etc. Just yesterday, I fighted again to make a simple python script running as desired to generate an automatic report. I did this dozen of times and even by using some old report as template I still struggle with it. Comparing old reports I noticed that I did it in many different ways. Tangeling all snipplets, using noweb syntax, with and without session support, etc. Don't get me wrong, I really love org-babel and I think it is really great. I just wonder wether it has become too complex and too difficult to use to attract most of the org-mode people. Esp. considering people who use it not on a regular basis. Best regards Torsten ___ 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
Re: [Orgmode] [org-babel] Does org-babel needs some simplification?
On Jun 28, 2010, at 5:51 PM, Torsten Wagner wrote: Dear All, as a (quite, but happy) org-bable user of the first hour I followed up the development process actively. Nevertheless, some weeks or months pass where I had no need for org-babel (yes, really strange I know). Whenever I come back to org-babel, it takes me a huge amount of time to find myself back again in the syntax. Often I spend a day or two heavily reading the website and manual again to figure out how to make it working. There are so many options. tangle files, results, scripting mode, sessions, noweb, lot, etc. Just yesterday, I fighted again to make a simple python script running as desired to generate an automatic report. I did this dozen of times and even by using some old report as template I still struggle with it. Comparing old reports I noticed that I did it in many different ways. Tangeling all snipplets, using noweb syntax, with and without session support, etc. Don't get me wrong, I really love org-babel and I think it is really great. I just wonder wether it has become too complex and too difficult to use to attract most of the org-mode people. Esp. considering people who use it not on a regular basis. Best regards Torsten Hi Torsten, Part of the difficulty might be that certain default behaviors changed in the last several months. What worked in, say, February might not work the same way today. I've been thrown for a loop more than once when old files didn't work as they once did. So, this could cause problems for someone away from babel for a few months. What would you simplify? Could the library of babel help with this? All the best, Tom ___ 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
Re: [Orgmode] [org-babel] Does org-babel needs some simplification?
Hi Torsten, Thanks for bringing this up. I think you're right that Org-babel does need to expose some simple points of entry. However in reviewing the points of complexity, - tangling - noweb references - the profusion of header arguments - the library of babel my immersed and subjective perspective is that all of these moving parts do a pretty good job of being orthogonal, i.e. they don't overlap or duplicate functionality and each additional piece adds new functionality which would be otherwise impossible. So assuming that all of these facets of Org-babel are essential (please let me know if anyone thinks that there are chunks which could be re-factored out), then the issue becomes making it straightforward to do most *common* tasks w/o having to dive into much of the complexity. This probably means good default values for all configurable parameters, and better documentation. We have some example usage documents up on worg [1], however those focus on showing off all of the bells and whistles. I like the idea of compiling some simple language-specific demos which walk through the basic usage of Org-babel with pointers-to, but no inclusions-of the more complex features. Hopefully this is something we can improve in the near future. Thanks -- Eric Torsten Wagner torsten.wag...@gmail.com writes: Dear All, as a (quite, but happy) org-bable user of the first hour I followed up the development process actively. Nevertheless, some weeks or months pass where I had no need for org-babel (yes, really strange I know). Whenever I come back to org-babel, it takes me a huge amount of time to find myself back again in the syntax. Often I spend a day or two heavily reading the website and manual again to figure out how to make it working. There are so many options. tangle files, results, scripting mode, sessions, noweb, lot, etc. Just yesterday, I fighted again to make a simple python script running as desired to generate an automatic report. I did this dozen of times and even by using some old report as template I still struggle with it. Comparing old reports I noticed that I did it in many different ways. Tangeling all snipplets, using noweb syntax, with and without session support, etc. Don't get me wrong, I really love org-babel and I think it is really great. I just wonder wether it has become too complex and too difficult to use to attract most of the org-mode people. Esp. considering people who use it not on a regular basis. Best regards Torsten ___ 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] http://orgmode.org/worg/org-contrib/babel/uses.php ___ 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