0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 02:02:52 +00:00

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

This commit is contained in:
Carsten Dominik 2010-07-08 11:43:06 +02:00
commit e644a76dfb
2 changed files with 34 additions and 31 deletions

View file

@ -252,37 +252,39 @@ results into the buffer."
pair))
(nth 2 info))))
;; skip code blocks which we can't evaluate
(when (fboundp (intern (concat "org-babel-execute:" lang)))
(case type
('inline
(let ((raw (org-babel-execute-src-block
nil info '((:results . "silent"))))
(result-params (split-string (cdr (assoc :results params)))))
(unless silent
(cond ;; respect the value of the :results header argument
((member "file" result-params)
(org-babel-result-to-file raw))
((or (member "raw" result-params) (member "org" result-params))
(format "%s" raw))
((member "code" result-params)
(format "src_%s{%s}" lang raw))
(t
(if (stringp raw)
(if (= 0 (length raw)) "=(no results)="
(format "%s" raw))
(format "%S" raw)))))))
('block
(org-babel-execute-src-block
nil info (org-babel-merge-params
params `((:results . ,(if silent "silent" "replace")))))
"")
('lob
(save-excursion
(re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block
nil info (org-babel-merge-params
params `((:results . ,(if silent "silent" "replace")))))
""))))))
(if (fboundp (intern (concat "org-babel-execute:" lang)))
(case type
('inline
(let ((raw (org-babel-execute-src-block
nil info '((:results . "silent"))))
(result-params (split-string (cdr (assoc :results params)))))
(unless silent
(cond ;; respect the value of the :results header argument
((member "file" result-params)
(org-babel-result-to-file raw))
((or (member "raw" result-params) (member "org" result-params))
(format "%s" raw))
((member "code" result-params)
(format "src_%s{%s}" lang raw))
(t
(if (stringp raw)
(if (= 0 (length raw)) "=(no results)="
(format "%s" raw))
(format "%S" raw)))))))
('block
(org-babel-execute-src-block
nil info (org-babel-merge-params
params
`((:results . ,(if silent "silent" "replace")))))
"")
('lob
(save-excursion
(re-search-backward org-babel-lob-one-liner-regexp nil t)
(org-babel-execute-src-block
nil info (org-babel-merge-params
params `((:results . ,(if silent "silent" "replace")))))
"")))
"")))
(provide 'ob-exp)

View file

@ -123,6 +123,7 @@
;; load languages based on value of `org-babel-load-languages'
(defvar org-babel-load-languages)
;;;###autoload
(defun org-babel-do-load-languages (sym value)
"Load the languages defined in `org-babel-load-languages'."
(set-default sym value)