```    * lisp/ob-octave.el: add graphical output to png file

* testing/examples/ob-octave-test.org: add a test for graphical
output, and a test for session``` Litvinov Sergey 8 years ago
parent
commit
0b7ae6ffb9
2 changed files with 33 additions and 7 deletions
1. 23 7
lisp/ob-octave.el
2. 10 0
testing/examples/ob-octave-test.org

#### + 23 - 7 lisp/ob-octave.el View File

 ``@@ -86,13 +86,24 @@ end")`` `` (org-babel-expand-body:generic`` `` body params (org-babel-variable-assignments:octave params)))`` `` (result (org-babel-octave-evaluate`` ``- session full-body result-type matlabp)))`` ``- (org-babel-reassemble-table`` ``- result`` ``- (org-babel-pick-name`` ``- (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))`` ``- (org-babel-pick-name`` ``- (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params))))))`` ``+ session`` ``+ (if (org-babel-octave-graphical-output-file params)`` ``+ (mapconcat 'identity`` ``+ (list`` ``+ "set (0, \"defaultfigurevisible\", \"off\");"`` ``+ full-body`` ``+ (format "print -dpng %s" (org-babel-octave-graphical-output-file params)))`` ``+ "\n")`` ``+ full-body)`` ``+ result-type matlabp)))`` ``+ (if (org-babel-octave-graphical-output-file params)`` ``+ nil`` ``+ (org-babel-reassemble-table`` ``+ result`` ``+ (org-babel-pick-name`` ``+ (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))`` ``+ (org-babel-pick-name`` ``+ (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))`` `` `` `` (defun org-babel-prep-session:matlab (session params)`` `` "Prepare SESSION according to PARAMS."`` ``@@ -259,6 +270,11 @@ This removes initial blank and comment lines and then calls`` `` (match-string 1 string)`` `` string))`` `` `` ``+(defun org-babel-octave-graphical-output-file (params)`` ``+ "Name of file to which maxima should send graphical output."`` ``+ (and (member "graphics" (cdr (assq :result-params params)))`` ``+ (cdr (assq :file params))))`` ``+`` `` (provide 'ob-octave)`` `` `` `` ``

#### + 10 - 0 testing/examples/ob-octave-test.org View File

 ``@@ -43,3 +43,13 @@ Input elisp nil`` `` #+begin_src octave :exports results :results silent :var s='nil`` `` ans = s`` `` #+end_src`` ``+`` ``+`` ``+* Graphical tests`` ``+#+begin_src octave :results graphics :file chart.png`` ``+sombrero;`` ``+#+end_src`` ``+`` ``+#+begin_src octave :session`` ``+sombrero;`` ``+#+end_src``
{"ft_lang_label":"__label__en","ft_lang_prob":0.51090074,"math_prob":0.5853371,"size":1691,"snap":"2020-10-2020-16","text_gpt3_token_len":552,"char_repetition_ratio":0.28512153,"word_repetition_ratio":0.25862068,"special_character_ratio":0.4133649,"punctuation_ratio":0.0990991,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.992263,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-04T19:05:00Z\",\"WARC-Record-ID\":\"<urn:uuid:e4599d03-453b-47d0-96b2-faabe9f7863b>\",\"Content-Length\":\"36069\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6f10e259-904a-4569-88d3-8cd318603883>\",\"WARC-Concurrent-To\":\"<urn:uuid:43fd3f6a-7c6f-4325-b794-baa3a0844104>\",\"WARC-IP-Address\":\"45.77.159.66\",\"WARC-Target-URI\":\"https://code.orgmode.org/bzg/org-mode/commit/0b7ae6ffb940c452e6553d0ed1a5b06730d5a3bc\",\"WARC-Payload-Digest\":\"sha1:Q723EEE3QGHRF2HBJ4C4CXH6S7IMJ27I\",\"WARC-Block-Digest\":\"sha1:BKLMLGV4FT2T7OYMDYTX3WGN2R3UTTQB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585370524604.46_warc_CC-MAIN-20200404165658-20200404195658-00542.warc.gz\"}"}