【问题标题】:how to return to original buffer after py-execute-regionpy-execute-region 后如何返回原始缓冲区
【发布时间】:2014-03-06 12:17:05
【问题描述】:
我或多或少地设置了 ipython 与 emacs 一起工作。但是,仍然有一些不太方便的东西。每次我从我的脚本缓冲区中选择一个区域并执行 py-execute-region 时,执行后,光标停留在 PYTHON 缓冲区中,而不是返回到我的脚本缓冲区。
然后我必须做一个 C-x o 将光标移回我的脚本并继续写东西。
是否有一个选项/修复可以让 py-execute-buffer 在执行后返回到原始缓冲区?
谢谢!
【问题讨论】:
标签:
python
emacs
elisp
ipython
【解决方案1】:
我真的不知道那种模式,但作为一个快速修复我可以想到这样的事情:
(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)))
【解决方案2】:
检查 py-switch-buffers-on-execute-p 的自定义,它默认为 nil,但在那里似乎“t”。
默认显示输出缓冲区,但未选中。