Browse Source

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.
Aaron Ecay 12 năm trước cách đây
mục cha
commit
9969d3feeb
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      lisp/ob-core.el

+ 5 - 4
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)))))))))