|
@@ -94,19 +94,25 @@ options and are taken from `org-babel-defualt-inline-header-args'."
|
|
|
(if (string-match "\n$" body) "" "\n"))))
|
|
|
|
|
|
(defun org-babel-exp-results (body lang params &optional inline)
|
|
|
- (let* ((params
|
|
|
- ;; lets ensure that we lookup references in the original file
|
|
|
- (mapcar (lambda (pair)
|
|
|
- (if (and (eq (car pair) :var)
|
|
|
- (string-match org-babel-ref-split-regexp (cdr pair)))
|
|
|
- `(:var . ,(concat (match-string 1 (cdr pair))
|
|
|
- "=" org-current-export-file
|
|
|
- ":" (match-string 2 (cdr pair))))
|
|
|
- pair)) params))
|
|
|
- (raw (org-babel-execute-src-block
|
|
|
- nil (list lang body params) '(("results" . "silent")))))
|
|
|
- (if (and (stringp raw) (= 0 (length raw)))
|
|
|
- "=(no results)=" (format "=%S=" raw))))
|
|
|
+ (let ((params
|
|
|
+ ;; lets ensure that we lookup references in the original file
|
|
|
+ (mapcar (lambda (pair)
|
|
|
+ (if (and (eq (car pair) :var)
|
|
|
+ (string-match org-babel-ref-split-regexp (cdr pair)))
|
|
|
+ `(:var . ,(concat (match-string 1 (cdr pair))
|
|
|
+ "=" org-current-export-file
|
|
|
+ ":" (match-string 2 (cdr pair))))
|
|
|
+ pair)) params)))
|
|
|
+ (if inline
|
|
|
+ (let ((raw (org-babel-execute-src-block
|
|
|
+ nil (list lang body params) '((:results . "silent")))))
|
|
|
+ (if (and (stringp raw) (= 0 (length raw)))
|
|
|
+ "=(no results)=" (format "=%S=" raw)))
|
|
|
+ (save-excursion
|
|
|
+ ;; org-exp-blocks places us at the end of the block
|
|
|
+ (re-search-backward org-babel-src-block-regexp nil t)
|
|
|
+ (org-babel-execute-src-block
|
|
|
+ nil nil (org-babel-merge-params params '((:results . "replace")))) ""))))
|
|
|
|
|
|
(provide 'org-babel-exp)
|
|
|
;;; org-babel-exp.el ends here
|