简体   繁体   English

如何更改Elpy自动完成框的颜色,而不是先显示私有变量

[英]How to change the color for Elpy autocomplete box and not display the private variables first

I'm trying to get Emacs 24.3.1 running on Ubuntu 14.04 configured for Python development and am using elpy for autocompletion. 我试图在配置为Python开发的Ubuntu 14.04上运行Emacs 24.3.1并使用elpy进行自动完成。 There are currently two problems I'm facing. 目前我面临着两个问题。 Both can be seen in this screenshot: 两者都可以在这个截图中看到:

截图 .

The color scheme is very difficult to work with and the private methods always appear first in the list. 配色方案很难使用,私有方法总是首先出现在列表中。

The relevant lines in my emacs init are: 我的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)

Any help with either of these issues would be appreciated. 任何这些问题的任何帮助将不胜感激。

The color theme is the same as used by the completion method Elpy uses. 颜色主题与Elpy使用的完成方法使用的颜色主题相同。 If you upgraded to the current release of 1.5.1, that would be company-mode . 如果您升级到1.5.1的当前版本,那将是company-mode In theory, this should already work correctly with a dark-background Emacs. 从理论上讲,这应该已经适用于深色背景的Emacs。 Try setting frame-background-mode to dark first — maybe Emacs did not detect your background correctly (though it should). 尝试首先将frame-background-mode设置为dark - 也许Emacs没有正确检测到你的背景(虽然它应该)。 If that fails, you can change the colors ("faces") it uses by doing Mx customize-group RET company RET and look for options with "face" in their name. 如果失败,您可以通过执行Mx customize-group RET company RET来更改它使用的颜色(“faces”),并在其名称中查找带有“face”的选项。

Changing the order of the completions is a bit more tricky and would require changing some code within Elpy. 更改完成的顺序有点棘手,需要更改Elpy中的一些代码。 I created an issue for this request. 我为此请求创建了一个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM