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.
This commit is contained in:
Aaron Ecay 2013-04-21 23:35:47 -04:00
parent 8993a2f7a9
commit 9969d3feeb
1 changed files with 5 additions and 4 deletions

View File

@ -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)))))))))