Re: [O] Exponential numbers in latex table export

2018-03-28 Thread Nicolas Goaziou
Hello,

Günter Lichtenberg  writes:

> I have a document with many automatically generated tables that contain 
> numbers in exponential Format, e.g. 2e09. When I export the tables to LaTeX 
> and pdf I get something like 2 (-09) in the pdf, if there is no character 
> after the number in the table
>
> Minimal Example:
> |--|
> | 1.2e09 (abs) |
> |  2.3e-09 |
> |   3.4e09 |
> |--|
>
> exports to a latex table as
>
> \begin{center}
> \begin{tabular}{r}
> \hline
> 1.2e09 (abs)\\
> 2.3\,(-09)\\
> 3.4\,(09)\\
> \hline
> \end{tabular}
>
> Note that in the first line the number is an exponential, the following 2 are 
> not. I could not find anything in the documentation. What am I missing?
>
> orgmode version is 9.1.4, but the same happens with emacs 25.3 built-in 
> version 8.3.

See `org-latex-table-scientific-notation'. I also find the default value
a bit surprising. I believe it is what Carsten uses.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH 1/1] ob-clojure.el: Add :ns to specify evaluation namespace

2018-03-28 Thread stardiviner

This implementation has some problem that some side case are not handled.

Please reference this previous patch email:

https://lists.gnu.org/archive/html/emacs-orgmode/2018-03/msg00507.html





[O] insert evaluation results in place

2018-03-28 Thread Zhihao Ding
Hi there,

I was wondering if anyone could share an example for referencing the
results of a source code block in place.

For example, a source code block could be defined as below

  #+HEADER: n_value
  #+HEADER: :results value
  #+HEADER: :noweb yes
  #+BEGIN_SRC R
n_value=10
n_value
  #+END_SRC

and I want to insert the result value after evaluation into a paragraph of
text.

I currently evaluate the source code block first, then copy the stuff under
"#+RESULTS:" to the target location. I want to make it in one go,
especially when the output is just a single number.

Thank you,

Zhihao


[O] FILETAGS tags hidden by TAGS option

2018-03-28 Thread Mark Edgington
When using org-tags-view, the list of tags used for tab-completion
fails to include tags specified via the #+FILETAGS option when there
exists a #+TAGS option in the file which doesn't contain the
#+FILETAGS tags.

For example, with the following options, the foo tag will not show up
when trying to do tab-completion, but only bar and baz will:

#+TAGS:  bar baz
#+FILETAGS:  foo

Is this the expected behavior?  A "workaround" is to simply add foo to
#+TAGS, but should this be necessary?



Re: [O] maybe typo in orgmode manual

2018-03-28 Thread Nicolas Goaziou
Hello,

Буковская Агнесса  writes:

> Maybe there is typo in orgmode manual: 
> https://orgmode.org/org.html#capture-protocol
>
>> To use this feature, add a bookmark with an arbitrary name, e.g. ‘Org: 
>> capture’ and enter this as ‘Location’:
>>
>> javascript:location.href='org-protocol://template=x'+
>>  '&url='+encodeURIComponent(window.location.href)+
>>  '&title='+encodeURIComponent(document.title)+
>>  '&body='+encodeURIComponent(window.getSelection());
>
> This does not work. No "capture" before template letter. Correct bookmark, I 
> think, begins with
>
>> javascript:location.href='org-protocol://capture?template=x'+
>
> And this variant works for me.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] insert evaluation results in place

2018-03-28 Thread Berry, Charles


> On Mar 28, 2018, at 7:42 AM, Zhihao Ding  wrote:
> 
> I was wondering if anyone could share an example for referencing the results 
> of a source code block in place. 
> 


See 

(info "(org) Evaluating code blocks")

Example


#+Name: put_in_para
#+BEGIN_SRC R :exports none
n_value=10
n_value
#+END_SRC


This is the result: call_put_in_para() of the above.

HTH,

Chuck



Re: [O] insert evaluation results in place

2018-03-28 Thread Zhihao Ding
Thank you!

Zhihao


On Wed, Mar 28, 2018 at 4:28 PM Berry, Charles  wrote:

>
>
> > On Mar 28, 2018, at 7:42 AM, Zhihao Ding  wrote:
> >
> > I was wondering if anyone could share an example for referencing the
> results of a source code block in place.
> >
>
>
> See
>
> (info "(org) Evaluating code blocks")
>
> Example
>
>
> #+Name: put_in_para
> #+BEGIN_SRC R :exports none
> n_value=10
> n_value
> #+END_SRC
>
>
> This is the result: call_put_in_para() of the above.
>
> HTH,
>
> Chuck
>


Re: [O] [PATCH] support insert link without write result to :file link

2018-03-28 Thread stardiviner
Hi, Nicolas, I have problem in my code. Even after many times and 5 
hourse Edebug on ob-core.el code. Still can't find out where is wrong. 
After Edebug, just know somewhere is wrong. here is my info:


- [ ] probelm is on ~org-babel-merge-params~, ~info~ is generated from 
it, but it removed ~link~ in ~:results~.

- [ ] org-babel-execute-src-block
  - [ ] (org-babel-get-src-block-info)
    - [ ] (let* ((info .. (apply #'org-babel-merge-params ...  -> 
info -> :results file replace (been removed here)
  - because ~:results link file replace~ are merged into ~:results 
file replace~?

    - where does the ~file~ comes from?
  - from ~:file~ header argument?
    - which function get this?
  - [ ] org-babel-process-params info


I added my latest patches in attachment (include test, and added your 
suggested modification). Can you help me on my code?



On 03/27/2018 02:26 PM, Nicolas Goaziou wrote:

Hello,

stardiviner  writes:


I added this patch to handle posted question case.

This will improve Org-mode links with org-babel resulta lot. Make
Org-mode can insert link as user want at many places.

Hope can be merged.

Thank you.

However, before thinking about merging it, it requires documentation and
tests. You also need to update `org-babel-common-header-args-w-values'.

Also, there are still failing tests from the last change to :results
behaviour in master, if you ever have time to look into it.

Regards,



>From a4da247355dd0f347843b06d9e64d26d210a4b0a Mon Sep 17 00:00:00 2001
From: stardiviner 
Date: Tue, 27 Mar 2018 10:50:03 +0800
Subject: [PATCH 1/2] * ob-core.el (org-babel-execute-src-block) support
 :results link.

- doc/org.texi (:results): support :results link type.

Don't write non-empty result to :file when result type is link.
Use it like this:

wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz";

[[file:data/tmp/crackzor_1.0.c.gz]]

- testing/lisp/test-ob.el (test-ob/result-file-link-type-header-argument) add test.
---
 doc/org.texi|  3 +++
 etc/ORG-NEWS|  9 +
 lisp/ob-core.el | 13 -
 testing/lisp/test-ob.el | 17 +
 4 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index aaa180401..903f52143 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -16204,6 +16204,9 @@ example: @code{:results value verbatim}.
 @item @code{file}
 Interpret as path to a file.  Inserts a link to the file.  Usage example:
 @code{:results value file}.
+@item @code{link}
+Interpret as path to a file.  Inserts a link to the file.  Usage example:
+@code{:results value link}.
 @end itemize
 
 @subsubheading Format
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index d479b982c..e2a02d0a2 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -113,6 +113,15 @@ now sort according to the locale’s collation rules instead of by
 code-point.
 
 ** New features
+*** add ~:results link~ support for org-babel
+This will support only insert file link without writing result to file.
+Like this case:
+#+begin_src shell :dir "data/tmp" :results link :file "crackzor_1.0.c.gz"
+wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz";
+#+end_src
+
+#+RESULTS:
+[[file:data/tmp/crackzor_1.0.c.gz]]
 *** Add ~:session~ support of ob-js for js-comint
 #+begin_src js :session "*Javascript REPL*"
 console.log("stardiviner")
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e33168278..d2c1b70f3 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -413,7 +413,7 @@ then run `org-babel-switch-to-session'."
 (padline	. ((yes no)))
 (post   . :any)
 (prologue   . :any)
-(results	. ((file list vector table scalar verbatim)
+(results	. ((file link list vector table scalar verbatim)
 		   (raw html latex org code pp drawer)
 		   (replace silent none append prepend)
 		   (output value)))
@@ -707,10 +707,13 @@ block."
 		;; If non-empty result and :file then write to :file.
 		(when file
 		  (let ((graphics?
-			 (member "graphics" (cdr (assq :result-params params)
-		;; Handle :results graphics :file case.  Don't
-		;; write result to file if result is graphics.
-		(when (and result (not graphics?))
+			 (member "graphics" (cdr (assq :result-params params
+			(file-link?
+			 (member "link" (cdr (assq :result-params params)
+		;; If :results are special types like `link', `graphics' etc.
+		;; don't write result to :file. literately only
+		;; insert link to :file.
+		(when (and result (not graphics?) (not file-link?))
 		  (with-temp-file file
 			(insert (org-babel-format-result
  result (cdr (assq :sep params)))
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index a4a590d6a..93eb7736a 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -996,6 +996,23 @@ trying to find the :END: marker."
 (should (search-forward "[[file:foo][bar]]" nil t))
 (should (search-forward "[[file:foo][foo]]" nil t

Re: [O] [PATCH] support insert link without write result to :file link

2018-03-28 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> Hi, Nicolas, I have problem in my code. Even after many times and
> 5 hourse Edebug on ob-core.el code. Still can't find out where is
> wrong. After Edebug, just know somewhere is wrong. here is my info:
>
> - [ ] probelm is on ~org-babel-merge-params~, ~info~ is generated from
> it, but it removed ~link~ in ~:results~.
> - [ ] org-babel-execute-src-block
>   - [ ] (org-babel-get-src-block-info)
>     - [ ] (let* ((info .. (apply #'org-babel-merge-params ...  -> 
> info -> :results file replace (been removed here)
>   - because ~:results link file replace~ are merged into ~:results
> file replace~?
>     - where does the ~file~ comes from?
>   - from ~:file~ header argument?
>     - which function get this?
>   - [ ] org-babel-process-params info
>
>
> I added my latest patches in attachment (include test, and added your
> suggested modification). Can you help me on my code?

What are the differences between ":results file" and ":results link"?

Regards,

-- 
Nicolas Goaziou



Re: [O] Exponential numbers in latex table export

2018-03-28 Thread Günter Lichtenberg
On Wednesday, 28 March 2018 13:55:01 CEST Nicolas Goaziou wrote:

 > > 
> > \begin{center}
> > \begin{tabular}{r}
> > \hline
> > 1.2e09 (abs)\\
> > 2.3\,(-09)\\
> > 3.4\,(09)\\
> > \hline
> > \end{tabular}
> > 

> See `org-latex-table-scientific-notation'. I also find the default value
> a bit surprising. I believe it is what Carsten uses.

Hi

thanks, setting that variable to nil solves my problem. 

It was a bit puzzling to me, because of the fact that once a string is 
somewhere in the column the exponential number came out as is (I guess because 
then the table entry is no longer interpreted as a number but as a string).  
It was also confusing because HTML export is different and just puts out what 
is in the orgmode table.

Maybe one should change the default of the variable to nil? 
Just a suggestion, as I said,  my problem is solved.

Thanks again
gl 






[O] Org export, ignore headline and linebreaks

2018-03-28 Thread Guilherme Passos
Dear all,


I am writing an org file to be exported to latex, with some headings for my own 
use that I would like to be ignored in export. For this I am use the :ignore: 
tag from extra.el (org-plus-contrib).


However, unfortunately it disregards any kind of line or paragraph break just 
before or after the ignored headline. For instance, the following example org 
file, without the subheading:


* a-text

  a-text.

# ** b
:ignore:

   b-text.

is exported as I would expect, defining a new paragraph by the blank line 
between them:


\section{a-text}

\label{sec:org850d8cd}

a-text.


b-text.

\end{document}


while this other org file, with the ignored headline


* a-text

  a-text.

** b:ignore:

   b-text.


is exported as


\section{a-text}

\label{sec:org05e88be}

a-text.

b-text.

\end{document}


this puts "a-text" and "b-text" in the same line, requiring the usage of an 
explicit \par command in order to break the paragraph. Any extra blank line in 
the org file is ignored, so the result is the same.


Is there anything I am missing which would solve this problem?

Besides, is there any bug report channel for org mode (or org-plus-contrib) for 
reporting this?


Thank you very much.


Best,

Guilherme Passos

--
github | 
academia.edu


Re: [O] FILETAGS tags hidden by TAGS option

2018-03-28 Thread Nicolas Goaziou
Hello,

Mark Edgington  writes:

> When using org-tags-view, the list of tags used for tab-completion
> fails to include tags specified via the #+FILETAGS option when there
> exists a #+TAGS option in the file which doesn't contain the
> #+FILETAGS tags.
>
> For example, with the following options, the foo tag will not show up
> when trying to do tab-completion, but only bar and baz will:
>
> #+TAGS:  bar baz
> #+FILETAGS:  foo

FWIW, I cannot reproduce it (from master, I didn't check maint). You may
want to update Org and try again.

Regards,

-- 
Nicolas Goaziou



[O] Feature request: results type json

2018-03-28 Thread Ag Ibragimov

Sorry, I don't know the best medium to convey ideas and I'm afraid not
qualified (familiar with org-mode codebase) to submit a PR for this.
I wonder how difficult would be to
add the possibility to have babel src block results to be rendered as
json?
Basically a new result type https://orgmode.org/manual/results.html#results

Thank you.



Re: [O] Feature request: results type json

2018-03-28 Thread John Kitchin
Does this do what you want:

#+BEGIN_SRC emacs-lisp :wrap json
(json-encode '((type . "text")))
#+END_SRC

#+RESULTS:
#+BEGIN_json
{"type":"text"}
#+END_json

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Wed, Mar 28, 2018 at 1:42 PM, Ag Ibragimov 
wrote:

>
> Sorry, I don't know the best medium to convey ideas and I'm afraid not
> qualified (familiar with org-mode codebase) to submit a PR for this.
> I wonder how difficult would be to
> add the possibility to have babel src block results to be rendered as
> json?
> Basically a new result type https://orgmode.org/manual/
> results.html#results
>
> Thank you.
>
>


Re: [O] Feature request: results type json

2018-03-28 Thread agzam . ibragimov
Hmm, it works for emacs-lisp, however I specifically wanted to use it with
ob-sql, and can't find a way.

On Wed, Mar 28, 2018 at 2:05 PM John Kitchin 
wrote:

> Does this do what you want:
>
> #+BEGIN_SRC emacs-lisp :wrap json
> (json-encode '((type . "text")))
> #+END_SRC
>
> #+RESULTS:
> #+BEGIN_json
> {"type":"text"}
> #+END_json
>
> John
>
> ---
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803 <(412)%20268-7803>
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
>
> On Wed, Mar 28, 2018 at 1:42 PM, Ag Ibragimov 
> wrote:
>
>>
>> Sorry, I don't know the best medium to convey ideas and I'm afraid not
>> qualified (familiar with org-mode codebase) to submit a PR for this.
>> I wonder how difficult would be to
>> add the possibility to have babel src block results to be rendered as
>> json?
>> Basically a new result type
>> https://orgmode.org/manual/results.html#results
>>
>> Thank you.
>>
>>
>


Re: [O] bug#27736: OSX 10.6.8: Building from master branch fails.

2018-03-28 Thread Paul Eggert

On 03/28/2018 12:33 PM, Paul Eggert wrote:
Unfortunately the new org code contains the expression (encode-time 0 
0 0 0 0 -5), which won't work on Emacs platforms where time_t is 
32 bits or is unsigned, since such platforms cannot represent a time_t 
value corresponding to the year -5. 


I installed the attached patch into Emacs master to try to fix this. 
I'll CC: this to emacs-orgmode in the hopes that this won't get lost in 
the next merge to Emacs master.


>From 43994e484fadac28682542e75548e80cbb80987d Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Wed, 28 Mar 2018 15:03:40 -0700
Subject: [PATCH] Port recent org-clock fix to POSIX time_t

* lisp/org/org-clock.el (org-clock-special-range):
Don't assume support for time_t values less than 0, or less than
-2**31 for that matter (Bug#27736).
---
 lisp/org/org-clock.el | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index ff32e28d1e..9be0d5bc1f 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -2239,8 +2239,18 @@ org-clock-special-range
 (let* ((start (pcase key
 		(`interactive (org-read-date nil t nil "Range start? "))
 ;; In theory, all clocks started after the dawn of
-;; humanity.
-		(`untilnow (encode-time 0 0 0 0 0 -5))
+;; humanity.  However, the platform's clock
+;; support might not go back that far.  Choose the
+;; POSIX timestamp -2**41 (approximately 68,000
+;; BCE) if that works, otherwise -2**31 (1901) if
+;; that works, otherwise 0 (1970).  Going back
+;; billions of years would loop forever on Mac OS
+;; X 10.6 with Emacs 26 and earlier (Bug#27736).
+		(`untilnow
+ (let ((old 0))
+   (dolist (older '((-32768 0) (-33554432 0)) old)
+ (when (ignore-errors (decode-time older))
+			   (setq old older)
 		(_ (encode-time 0 m h d month y
 	   (end (pcase key
 		  (`interactive (org-read-date nil t nil "Range end? "))
-- 
2.14.3



Re: [O] Feature request: results type json

2018-03-28 Thread John Kitchin
If you can get ob-sql to output data in tabular form (if it is not nested)
you can do something like this:

#+name: tabular
#+BEGIN_SRC python :results value
d = [['type', 'test'], ['format', 'json']]
return d
#+END_SRC

#+RESULTS: tabular
| type   | test |
| format | json |

#+BEGIN_SRC emacs-lisp :var data=tabular :wrap json
(json-encode data)
#+END_SRC

#+RESULTS:
#+BEGIN_json
{"type":["test"],"format":["json"]}
#+END_json

If the data is nested, then you can see if there is a way to output a lisp
readable string:

#+name: my-data
#+BEGIN_SRC python :results output
print('((type . test) (format . json))')
#+END_SRC

#+RESULTS: my-data
: ((type . test) (format . json))



#+BEGIN_SRC emacs-lisp :var data=my-data :wrap json
(json-encode (read data))
#+END_SRC

#+RESULTS:
#+BEGIN_json
{"type":"test","format":"json"}
#+END_json



John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Wed, Mar 28, 2018 at 2:19 PM,  wrote:

> Hmm, it works for emacs-lisp, however I specifically wanted to use it with
> ob-sql, and can't find a way.
>
> On Wed, Mar 28, 2018 at 2:05 PM John Kitchin 
> wrote:
>
>> Does this do what you want:
>>
>> #+BEGIN_SRC emacs-lisp :wrap json
>> (json-encode '((type . "text")))
>> #+END_SRC
>>
>> #+RESULTS:
>> #+BEGIN_json
>> {"type":"text"}
>> #+END_json
>>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803 <(412)%20268-7803>
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>> On Wed, Mar 28, 2018 at 1:42 PM, Ag Ibragimov 
>> wrote:
>>
>>>
>>> Sorry, I don't know the best medium to convey ideas and I'm afraid not
>>> qualified (familiar with org-mode codebase) to submit a PR for this.
>>> I wonder how difficult would be to
>>> add the possibility to have babel src block results to be rendered as
>>> json?
>>> Basically a new result type https://orgmode.org/manual/
>>> results.html#results
>>>
>>> Thank you.
>>>
>>>
>>


Re: [O] [PATCH] support insert link without write result to :file link

2018-03-28 Thread stardiviner
`:results file` will write non-empty result to `:file`. But `:results 
link` don't, it just insert a link of `:file` at result. And that is 
what I want to solve in the first post of this thread.



On 03/29/2018 12:23 AM, Nicolas Goaziou wrote:

Hello,

stardiviner  writes:


Hi, Nicolas, I have problem in my code. Even after many times and
5 hourse Edebug on ob-core.el code. Still can't find out where is
wrong. After Edebug, just know somewhere is wrong. here is my info:

- [ ] probelm is on ~org-babel-merge-params~, ~info~ is generated from
it, but it removed ~link~ in ~:results~.
- [ ] org-babel-execute-src-block
   - [ ] (org-babel-get-src-block-info)
     - [ ] (let* ((info .. (apply #'org-babel-merge-params ...  ->
info -> :results file replace (been removed here)
   - because ~:results link file replace~ are merged into ~:results
file replace~?
     - where does the ~file~ comes from?
   - from ~:file~ header argument?
     - which function get this?
   - [ ] org-babel-process-params info


I added my latest patches in attachment (include test, and added your
suggested modification). Can you help me on my code?

What are the differences between ":results file" and ":results link"?

Regards,





Re: [O] Feature request: results type json

2018-03-28 Thread stardiviner

You can wrap result value into another language src block like this:

#+begin_src ruby :results code :wrap src shell
puts "echo 'hello'"
#+end_src

#+RESULTS:
#+begin_src shell
echo 'hello'
#+end_src

Same for JSON by changed `:wrap src shell` into `wrap json`. But you 
need the value is JSON.


Isaw you mentioned want ob-sql support JSON return type. I guess it need 
to be implemented in ob-sql.Or you can use `:post` to convert result to 
JSON. Or use `advice-add` to add a function to convert result to JSON.



On 03/29/2018 06:30 AM, John Kitchin wrote:
If you can get ob-sql to output data in tabular form (if it is not 
nested) you can do something like this:


#+name: tabular
#+BEGIN_SRC python :results value
d = [['type', 'test'], ['format', 'json']]
return d
#+END_SRC

#+RESULTS: tabular
| type   | test |
| format | json |

#+BEGIN_SRC emacs-lisp :var data=tabular :wrap json
(json-encode data)
#+END_SRC

#+RESULTS:
#+BEGIN_json
{"type":["test"],"format":["json"]}
#+END_json

If the data is nested, then you can see if there is a way to output a 
lisp readable string:


#+name: my-data
#+BEGIN_SRC python :results output
print('((type . test) (format . json))')
#+END_SRC

#+RESULTS: my-data
: ((type . test) (format . json))



#+BEGIN_SRC emacs-lisp :var data=my-data :wrap json
(json-encode (read data))
#+END_SRC

#+RESULTS:
#+BEGIN_json
{"type":"test","format":"json"}
#+END_json



John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Wed, Mar 28, 2018 at 2:19 PM, > wrote:


Hmm, it works for emacs-lisp, however I specifically wanted to use
it with ob-sql, and can't find a way.

On Wed, Mar 28, 2018 at 2:05 PM John Kitchin
mailto:jkitc...@andrew.cmu.edu>> wrote:

Does this do what you want:

#+BEGIN_SRC emacs-lisp :wrap json
(json-encode '((type . "text")))
#+END_SRC

#+RESULTS:
#+BEGIN_json
{"type":"text"}
#+END_json

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803 
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Wed, Mar 28, 2018 at 1:42 PM, Ag Ibragimov
mailto:agzam.ibragi...@gmail.com>>
wrote:


Sorry, I don't know the best medium to convey ideas and
I'm afraid not
qualified (familiar with org-mode codebase) to submit a PR
for this.
I wonder how difficult would be to
add the possibility to have babel src block results to be
rendered as
json?
Basically a new result type
https://orgmode.org/manual/results.html#results


Thank you.