Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #171 and #172 #173

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR 187
  • Loading branch information
finalpatch committed Mar 23, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 6e56af40fb81e52283846b9614e78a69cc63dd8d
16 changes: 11 additions & 5 deletions ob-ipython.el
Original file line number Diff line number Diff line change
@@ -64,6 +64,10 @@
"Directory where resources (e.g images) are stored so that they
can be displayed.")

(defcustom ob-ipython-suppress-execution-count nil
"If non-nil do not show the execution count in output."
:group 'ob-ipython)

;; utils

(defun ob-ipython--write-string-to-file (file string)
@@ -628,11 +632,13 @@ 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)))
(s-join "\n" (->> (-map (-partial 'ob-ipython--render file)
(list (cdr (assoc :value result))
(cdr (assoc :display result))))
(remove-if-not nil)))))))
(if ob-ipython-suppress-execution-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))))
(remove-if-not nil))))))))

(defun ob-ipython--render (file-or-nil values)
(let ((org (lambda (value) value))