emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Mankoff <mankoff@gmail.com>
To: Org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Org + Elpy Python + IPython
Date: Tue, 20 May 2014 16:23:12 -0400	[thread overview]
Message-ID: <m2d2f8mc7j.fsf@gmail.com> (raw)
In-Reply-To: <m24n0kieh7.fsf@gmail.com>


And with a bit more work (and help from others) I have it working.

IPython, Org, Elpy, session or no-session. Still cannot set
(elpy-use-ipython) which makes the IPython sessions a bit less awesome
(no popup help, for example). But everything else appears to work.

(setq org-babel-python-command "ipython --pylab=osx --pdb --nosep --classic --no-banner --no-confirm-exit")

;; https://github.com/jorgenschaefer/elpy/issues/191
;; https://lists.gnu.org/archive/html/emacs-orgmode/2014-03/msg00405.html
;; make IPython work w/ Org
(defadvice org-babel-python-evaluate
  (around org-python-use-cpaste
	  (session body &optional result-type result-params preamble) activate)
  "Add a %cpaste and '--' to the body, so that ipython does the right thing."
  (setq body (concat "%cpaste -q\n" body "\n--\n"))
  ad-do-it
  (if (stringp ad-return-value)
      (setq ad-return-value (replace-regexp-in-string "\\(^Pasting code; enter '--' alone on the line to stop or use Ctrl-D\.[\r\n]:*\\)" ""
						      ad-return-value))))


 -k.

      reply	other threads:[~2014-05-20 20:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  2:52 Org + Elpy Python + IPython Ken Mankoff
2014-05-08  6:32 ` Puneeth Chaganti
2014-05-20 16:47 ` Ken Mankoff
2014-05-20 20:23   ` Ken Mankoff [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2d2f8mc7j.fsf@gmail.com \
    --to=mankoff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).