我试图让Emacs 24.3.1在Ubuntu 14.04上运行,并为Python开发配置 elpy 用于自动完成。目前我面临两个问题。这两个都可以在截图中看到:
.
颜色方案很难使用,并且私有方法总是出现在列表的第一位。
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的当前版本 company-mode 。理论上,这应该已经在暗背景Emacs下正常工作了。尝试设置 frame-background-mode 到 dark 首先,Emacs可能没有正确检测到您的背景(尽管应该如此)。如果失败,您可以通过以下操作更改它使用的颜色(“面”) M-x customize-group RET company RET 并寻找名称中带有“face”的选项。
company-mode
frame-background-mode
dark
M-x customize-group RET company RET
更改完成顺序有点棘手,需要在Elpy中更改一些代码。我创建了 an issue 对于此请求。