From 9ef7b151c59d764f3f518fd7930b1952eb6b4bc7 Mon Sep 17 00:00:00 2001 From: Jamie Forth Date: Thu, 18 Jan 2018 15:04:57 +0000 Subject: [PATCH 1/2] Make decorating results with execution count metadata optional. Add new customizable variable: ob-ipython-output-exec-count. --- ob-ipython.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ob-ipython.el b/ob-ipython.el index d043434..e167bee 100644 --- a/ob-ipython.el +++ b/ob-ipython.el @@ -64,6 +64,9 @@ "Directory where resources (e.g images) are stored so that they can be displayed.") +(defcustom ob-ipython-output-exec-count t + "When non-nil decorate results with execution count metadata.") + ;; utils (defun ob-ipython--write-string-to-file (file string) @@ -611,7 +614,8 @@ This function is called by `org-babel-execute-src-block'." output (ob-ipython--output output nil) (s-concat - (format "# Out[%d]:\n" (cdr (assoc :exec-count ret))) + (if ob-ipython-output-exec-count + (format "# Out[%d]:\n" (cdr (assoc :exec-count ret)))) (s-join "\n" (->> (-map (-partial 'ob-ipython--render file) (list (cdr (assoc :value result)) (cdr (assoc :display result)))) From 64b812ddf5cacff9c9c93a48232947f9252683bf Mon Sep 17 00:00:00 2001 From: Jamie Forth Date: Tue, 21 Aug 2018 10:58:09 +0100 Subject: [PATCH 2/2] Specify containing group for `ob-ipython-output-exec-count` and `ob-ipython-resources-dir`. --- ob-ipython.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ob-ipython.el b/ob-ipython.el index e167bee..8cd86bd 100644 --- a/ob-ipython.el +++ b/ob-ipython.el @@ -62,10 +62,12 @@ (defcustom ob-ipython-resources-dir "./obipy-resources/" "Directory where resources (e.g images) are stored so that they -can be displayed.") +can be displayed." + :group 'ob-ipython) (defcustom ob-ipython-output-exec-count t - "When non-nil decorate results with execution count metadata.") + "When non-nil decorate results with execution count metadata." + :group 'ob-ipython) ;; utils