让Python解释器在同一窗口中打开
也许我有点不理智,但我真的很讨厌命令在 emacs 中打开一个新窗口。我在 Ubuntu 上使用 emacs,它带有 python 模式,当我使用 Cc 启动解释器时!它会在一个新窗口中弹出。
我想要的是 emacs 在同一窗口中切换到新的缓冲区。到目前为止,我已经尝试将 Jython 添加到 same-window-buffer-names 中(我将解释器设置为 jython),甚至进入 python-mode.el 并更改 switch-to-buffer-other-窗口调用切换到缓冲区(我后来又改回来了)。到目前为止我还没有得到任何改变。
我有 emacs 23.1.1 和 python-mode 5.1.0
编辑:jython 缓冲区的实际名称用星号括起来,我不知道如何让 stackoverflow 知道它们不是样式信息。
Maybe I'm being irrational but I really really hate it when a command opens a new window in emacs. I'm using emacs on Ubuntu which came with python-mode and when I start an interpreter with C-c ! it pops up in a new window.
What I want is for emacs to switch to a new buffer in the same window. So far I've tried adding Jython(I set the interpreter to jython) to same-window-buffer-names and even going into python-mode.el and changing switch-to-buffer-other-window calls to switch-to-buffer(which I since changed back). So far I've gotten no change.
I have emacs 23.1.1 and python-mode 5.1.0
Edit: The actual name of the jython buffer is bracketed by asterisks and I don't know how to let stackoverflow know that they aren't styling information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
中的当前 python-mode.el
http://launchpad.net/python-mode
带有可自定义变量
py-shell-switch-buffers-on-execute-p
“当非零切换到新的Python shell时。”
相关:py-split-windows-on-execute-p
“当非零分割窗口时。”
除了以 switch/noswitch 结尾的命令之外
允许忽略自定义或默认设置
请参阅菜单 PyExec
current python-mode.el from
http://launchpad.net/python-mode
comes with a customizable variable
py-shell-switch-buffers-on-execute-p
"When non-nil switch to the new Python shell. "
related: py-split-windows-on-execute-p
"When non-nil split windows."
Beside commands ending with switch/noswitch
allow to ignore the customized or default setting
See menu PyExec
我使用 python 模式 5.2.0。
我进入 python-mode.el 并将 switch-to-buffer-other-window 更改为 switch-to-buffer。
我评估了它,现在解释器在同一个窗口中打开(无论我有多少其他窗口)。
当您更改上述行时,您是否评估了该功能?
顺便说一句,在另一个窗口中打开解释器是一个功能,而不是一个错误,恕我直言。当我们使用 Cc | 评估代码区域时,我们希望能够看到解释器或使用抄送抄送的缓冲区。
I use python-mode 5.2.0.
I went into python-mode.el and changed the switch-to-buffer-other-window to switch-to-buffer.
I evaluated it and now the interpreter opens up in the same window (regardless of the number of other windows I have).
Did you evaluate the function when you changed the above line?
Btw, opening the interpreter in another window is a feature, not a bug, IMHO. We want to be able to see the interpreter when we evaluate a region of code using C-c | or the buffer using C-c C-c.