如何在py-execute-region之后返回原始缓冲区

时间:2014-03-06 12:17:05

标签: python emacs elisp ipython

我或多或少地设置了使用emacs的ipython。但是,仍有一些不太方便的东西。每次我从脚本缓冲区中选择一个区域并执行py-execute-region,执行后,光标在 PYTHON 缓冲区中保持STAYS,而不是返回到我的脚本缓冲区。 然后我必须做一个C-x o将光标移回我的脚本并继续写东西。

是否有一个选项/修复程序让py-execute-buffer在执行后返回原始缓冲区?

谢谢!

2 个答案:

答案 0 :(得分:0)

我真的不知道这种模式,但作为快速修复,我可以想到这样的事情:

(defun my-py-execute-region()
  (interactive)
  (py-execute-region (region-beginning) (region-end))
  (other-window 1))

(global-set-key (kbd "C-c m") (lambda () (interactive) (my-py-execute-region)))

答案 1 :(得分:0)

检查py-switch-buffers-on-execute-p的自定义,默认为nil,但似乎没有。

默认显示输出缓冲区,但未选中。