2

我正在使用 ubuntu 14.04、emacs 24.3.1、python 2.7.6、ipython 1.2.1、python-mode 6.1.3。Ipython 在 emacs 中运行良好至少一年了,但是,自两周前以来,我遇到了以下问题。

  1. 使用抄送!要启动默认解释器,ipython 会按我希望的方式显示,但不是拆分框架并显示在另一个窗口中,而是显示在原始代码窗口中。(这是一个小问题)
  2. 使用抄送| 执行一个区域,python解释器启动,代码发送到python解释器而不是ipython解释器

我在 SO 上进行了搜索,但这个问题似乎太新了,无法找到答案。我用谷歌搜索,找到了这个页面https://answers.launchpad.net/python-mode/+question/250905,尝试了其中的方法,仍然没有用......有人可以帮我解决问题吗?非常感谢!

我的 .emacs python 部分看起来像

    (require 'python-mode)
    (setq-default py-shell-name "ipython")
    (setq-default py-which-bufname "IPython")
    ; switch to the interpreter after executing code
    (setq py-shell-switch-buffers-on-execute-p t)
    (setq py-switch-buffers-on-execute-p t)
    ; don't split windows
    (setq py-split-windows-on-execute-p nil)
4

1 回答 1

1

为了分割窗口

(setq py-split-windows-on-execute-p t)

需要,分别。重置为默认值 - 示例中的最后一行。也许通过 Mx customize 检查设置...也可能与setqinit 冲突。

选择 shell 执行时:缓冲区中的 shebang 可能会覆盖 default py-shell-name。当 shebang 应该被忽略时,使用

(setq py-force-py-shell-name-p t)

见菜单

Python/自定义/开关/解释器

在当前会话期间更改此值的简单方法。

于 2014-10-01T10:24:32.770 回答