summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ecay <aaronecay@gmail.com>2013-04-21 23:35:47 -0400
committerAaron Ecay <aaronecay@gmail.com>2013-04-21 23:45:27 -0400
commit9969d3feeb1b29bf6f9acfaf83abafcf9997c230 (patch)
treecdcc42baa5906947e0ea987dd8096f2771ff4b77
parent8993a2f7a96fa6aaf0129cec622d48deed5ac7f1 (diff)
downloadorg-mode-9969d3feeb1b29bf6f9acfaf83abafcf9997c230.tar.gz
ob-core.el (org-babel-execute-src-block): fixes for :results none
* lisp/ob-core.el (org-babel-execute-src-block): Return nil in case of `:results none'. Also run `org-babel-after-execute-hook' in this circumstance. Previously, the code returned the string "results silenced" in the case of =:results none=, as this is the return value of the call to `message'; additionally, the after-execute hook was not being run.
-rw-r--r--lisp/ob-core.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index f11836d..09b6bb4 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -610,7 +610,8 @@ block."
(if (member "none" result-params)
(progn
(funcall cmd body params)
- (message "result silenced"))
+ (message "result silenced")
+ (setq result nil))
(setq result
((lambda (result)
(if (and (eq (cdr (assoc :result-type params))
@@ -643,9 +644,9 @@ block."
(setq result-params
(remove "file" result-params)))))
(org-babel-insert-result
- result result-params info new-hash indent lang)
- (run-hooks 'org-babel-after-execute-hook)
- result))
+ result result-params info new-hash indent lang))
+ (run-hooks 'org-babel-after-execute-hook)
+ result)
(setq call-process-region
'org-babel-call-process-region-original)))))))))