Browse Source

Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode

Carsten Dominik 15 years ago
parent
commit
ada3986f9d

+ 9 - 3
contrib/babel/lisp/langs/org-babel-gnuplot.el

@@ -87,7 +87,9 @@ called by `org-babel-execute-src-block'."
            (y-labels (plist-get params :ylabels))
            (timefmt (plist-get params :timefmt))
            (time-ind (or (plist-get params :timeind)
-                         (when timefmt 1))))
+                         (when timefmt 1)))
+           (result-type (cdr (assoc :results params)))
+           output)
       (flet ((add-to-body (text)
                           (setq body (concat text "\n" body))))
         ;; append header argument settings to body
@@ -132,12 +134,16 @@ called by `org-babel-execute-src-block'."
               (with-temp-file script-file
                 (insert (concat body "\n")))
               (message "gnuplot \"%s\"" script-file)
-              (message (shell-command-to-string (format "gnuplot \"%s\"" script-file))))
+              (setq output
+                    (shell-command-to-string (format "gnuplot \"%s\"" script-file)))
+              (message output))
           (with-temp-buffer
             (insert (concat body "\n"))
             (gnuplot-mode)
             (gnuplot-send-buffer-to-gnuplot)))
-        out-file))))
+        (if (member "output" (split-string result-type))
+            output
+          out-file)))))
 
 (defun org-babel-prep-session:gnuplot (session params)
   "Prepare SESSION according to the header arguments specified in PARAMS."

+ 3 - 3
contrib/babel/lisp/langs/org-babel-sh.el

@@ -93,10 +93,10 @@ specifying a var of the same value."
       (flet ((deep-string (el)
                           (if (listp el)
                               (mapcar #'deep-string el)
-                            (format "%S" el))))
-        (format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)"
+                           (org-babel-sh-var-to-sh el sep))))
+       (format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)"
                 (orgtbl-to-generic (deep-string var) (list :sep (or sep "\t")))))
-    (format "%S" var)))
+    (if (stringp var) (format "%s" var) (format "%S" var))))
 
 (defun org-babel-sh-table-or-results (results)
   "If the results look like a table, then convert them into an