python - 如何更改Elpy自动完成框的颜色而不首先显示私有(private)变量

标签 python text emacs autocomplete ide

我正在尝试让 Emacs 24.3.1 在配置为 Python 开发的 Ubuntu 14.04 上运行,并使用 elpy用于自动完成。目前我面临两个问题。两者都可以在这个屏幕截图中看到:

screenshot

颜色方案很难使用,并且私有(private)方法总是出现在列表的第一位。

我的 emacs init 中的相关行是:

;;pop-ups                                                                                             
(require 'popup)

;;;python-mode                                                                                        
(require 'package)
(add-to-list 'package-archives
         '("elpy" . "http://jorgenschaefer.github.io/packages/"))
(elpy-enable)
;; Fixing a key binding bug in elpy                                                                   
(define-key yas-minor-mode-map (kbd "C-c k") 'yas-expand)
(define-key global-map (kbd "C-c o") 'iedit-mode)
;;Use jedi for autocomplete                                                                           
(setq elpy-rpc-backend "jedi")

(setq py-install-directory "~/.emacs.d/python-mode.el-6.1.3")
(add-to-list 'load-path py-install-directory)
(require 'python-mode)

; use IPython                                                                                         
(setq-default py-shell-name "ipython")
(setq-default py-which-bufname "IPython")
; use the wx backend, for both mayavi and matplotlib                                                  
(setq py-python-command-args
  '("--gui=wx" "--pylab=wx" "-colors" "Linux"))
(setq py-force-py-shell-name-p t)

; 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)
; try to automagically figure out indentation                                                         
(setq py-smart-indentation t)
;; Jedi backend                                                                                       
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t) ;optional                                                               
(add-hook 'python-mode-hook 'auto-complete-mode)
(add-hook 'python-mode-hook 'jedi:ac-setup)

任何有关这些问题的帮助将不胜感激。

最佳答案

颜色主题与 Elpy 使用的完成方法相同。如果您升级到当前版本 1.5.1,则将是公司模式。理论上,这应该可以在深色背景的 Emacs 中正常工作。首先尝试将 frame-background-mode 设置为 dark — 也许 Emacs 没有正确检测到您的背景(尽管应该如此)。如果失败,您可以通过执行 M-xcustomize-group RET company RET 更改它使用的颜色(“faces”),并查找名称中带有“face”的选项。

更改完成的顺序有点棘手,需要更改 Elpy 中的一些代码。我创建了an issue对于这个请求。

关于python - 如何更改Elpy自动完成框的颜色而不首先显示私有(private)变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24983542/

相关文章:

emacs - elpa + ESS + 自动完成仅部分有效

Emacs 键盘记录器

python - 使用循环中的新项目将列表与另一个列表进行标识

python - 在 python docker 镜像上安装 simstring (SWIG)

excel - 替换功能将文本格式转换为数字格式。它是excel错误吗?

csv - 如何告诉 Proof General ".csv"!= ".v"

python - 谷歌应用引擎 : Get entity key to use in a template

python - 如何在 Python 中用阿拉伯语对计数器进行排序

javascript - 在 <div> 标签中显示一定数量的行

css - 在另一个图像上显示图像