【问题标题】:tab-completion not work in emacs shell running ipdb (but in normal bash shell it works)tab-completion 在运行 ipdb 的 emacs shell 中不起作用(但在普通 bash shell 中它起作用)
【发布时间】:2015-04-27 10:31:00
【问题描述】:

我一直在尝试各种 stackoverflow 讨论中的很多提示和技巧等等,但我无法解决这个问题,请帮助:

什么在我的 bash shell 中起作用:

我有这个 python 脚本:

a = [44, 22]
import ipdb
ipdb.set_trace()

当我运行它时,我得到了预期的 ipdb 提示,当我输入“a.TAB”时,一些自动完成功能会建议所有这样的功能:

ipdb> a.
a.append   a.count    a.extend   a.index    a.insert   a.pop         a.remove   a.reverse  a.sort  

什么在我的 EMACS shell 中不起作用:

当我在 emacs shell 中做同样的事情时,tab 补全不起作用。我指的是 TAB 和 M-TAB。在这种情况下,Emacs 告诉我“不匹配”。 顺便说一句:当我编辑 python 文件时,M-TAB 确实 完成。 这整件事对我来说有点令人讨厌(这是一个轻描淡写的说法)。

我已经安装了许多建议的软件包:

auto-complete      1.5.0        installed  Auto Completion for GNU Emacs
company            0.8.11       installed  Modular text completion     framework
concurrent         0.3.2        installed  Concurrent utility functions for emacs lisp
ctable             0.1.2        installed  Table component for Emacs Lisp
deferred           0.3.2        installed  Simple asynchronous functions for emacs lisp
elpy               1.7.0        installed  Emacs Python Development Environment
epc                0.1.1        installed  A RPC stack for the Emacs Lisp
find-file-in-pr... 3.3          installed  Find files in a project quickly.
highlight-inden... 0.5.0        installed  Function for highlighting indentation
jedi               0.1.2        installed  Python auto-completion for Emacs
popup              0.5.2        installed  Visual Popup User Interface
python-environment 0.0.1        installed  virtualenv API for Emacs Lisp
pyvenv             1.6          installed  Python virtual environment interface
yasnippet          0.9.0.1      installed  Yet another snippet extension for Emacs.

顺便说一句:M-x RET jedi:install-server 选项在此设置中不可用。

我的环境:

ubuntu 14.04 LTS
emacs 24.3.1

我也尝试过:

我也尝试(也没有工作)使用安装软件包的不稳定 melpa 源(http://melpa.milkbox.net/packages):

auto-complete      20150218.819 installed  Auto Completion for GNU Emacs
company            20150224.... installed  Modular text completion framework
concurrent         20150205.616 installed  Concurrent utility functions for emacs lisp
ctable             20140304.... installed  Table component for Emacs Lisp
deferred           20150205.616 installed  Simple asynchronous functions for emacs lisp
elpy               20150206.... installed  Emacs Python Development Environment
epc                20140609.... installed  A RPC stack for the Emacs Lisp
find-file-in-pr... 20141214.... installed  Find files in a project quickly.
highlight-inden... 20150122.44  installed  Minor modes for highlighting indentation
jedi               20150217.... installed  Python auto-completion for Emacs
popup              20150116.... installed  Visual Popup User Interface
python-environment 20140321.... installed  virtualenv API for Emacs Lisp
pyvenv             20150218.... installed  Python virtual environment interface
yasnippet          20150212.240 installed  Yet another snippet extension for Emacs.

顺便说一句:选项 M-x RET jedi:install-server IS 在此设置中可用。

有什么想法...?

【问题讨论】:

  • 我怀疑这些软件包是否与此相关。当你说“一个 emacs shell”时,你是什么意思? shell? eshell? term? ansi-term?
  • 我在上面的例子中使用了“M-x shell”。使用“M-x eshell”甚至没有尝试完成任何事情,光标只是向前移动了一些空格。使用“Mx term”给了我一个 Emacs 缓冲区内的 shell,其中 tab-completion 实际上有效(就像在 Emacs 缓冲区外的我的 bash shell 中一样),但是:在术语缓冲区中,我不能像在“正常” Emacs 缓冲区,所以我不能在不使用鼠标的情况下复制粘贴内容,所以这不是我想要的...... :( Emacs shell 阻止了 tab-completion 工作,为什么?

标签: python shell emacs autocomplete ipdb


【解决方案1】:

Sean Farley 最近对ipdb into realgud 提出了拉取请求。当我得到时间时,它会进入。在他的 fork 中,或者当它被拉动时,你可以给我们M-x realgud-track-mode 并给“ipdb”作为调试器来跟踪。据说有标签扩展。但是我不是 ipdb 用户,所以我没有验证这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多