2012-08-12 55 views
3

安裝後:的Emacs與Python代碼完成>代碼完成建議不彈出

[rope] 
[ropemode] 
[pymacs] 
[ropemacs] 
[autocomplete 1.3.1] 

和配置.emacs

(add-to-list 'load-path "~/.emacs.d/autocomplete1.3.1") 
(add-to-list 'load-path "~/share/emacs/lisp/") 

(setq py-install-directory "~/share/emacs/lisp/") 
(require 'python-mode) 

(autoload 'pymacs-apply "pymacs") 
(autoload 'pymacs-call "pymacs") 
(autoload 'pymacs-eval "pymacs" nil t) 
(autoload 'pymacs-exec "pymacs" nil t) 
(autoload 'pymacs-load "pymacs" nil t) 
(autoload 'pymacs-autoload "pymacs") 

(require 'pymacs) 
(pymacs-load "ropemacs" "rope-") 
(setq ropemacs-enable-autoimport t) 

(require 'auto-complete-config) 
(add-to-list 'ac-dictionary-directories "~/.emacs.d/autocomplete1.3.1/ac-dict") 
(ac-config-default) 

(require 'auto-complete) 
(global-auto-complete-mode t) 

我輸入一段sys.後,並希望類似的代碼完成科莫多編輯。

不幸的是,我所能達到的最好效果是按M-/調出分屏代碼完成緩衝區。

如何在GNU Emacs中實現類似於Komodo-Edit的代碼完成?

這裏有一個pymacs bug錯誤,引起了我出去:

+0

什麼版本的emacs /平臺? – geoffspear 2012-08-12 23:54:14

+0

** GNU Emacs 24.1.1 ** | ** Ubuntu 12.04 ** 上下文菜單無法顯示的任何原因? – 2012-08-13 10:15:38

回答

1

這裏是ac-config-default的定義,因爲它是你做配置AC的唯一的事情:

(defun ac-config-default() 
    (setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)) 
    (add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-mode-setup) 
    (add-hook 'c-mode-common-hook 'ac-cc-mode-setup) 
    (add-hook 'ruby-mode-hook 'ac-ruby-mode-setup) 
    (add-hook 'css-mode-hook 'ac-css-mode-setup) 
    (add-hook 'auto-complete-mode-hook 'ac-common-setup) 
    (global-auto-complete-mode t)) 

沒有Python的配置,所以你不能指望AC爲Python工作。

要對其進行設置:

(add-hook 'python-mode-hook 'ac-ropemacs-setup) 

無恥插頭:這裏有備用ropemacs來源AC - 爲包含的源不顯示文件:再次https://github.com/cofi/dotfiles/blob/master/emacs.d/config/cofi-python.el#L75

以下配置:

(add-hook 'python-mode-hook (lambda() 
           (setq ac-source (append ac-source '(ac-source-nropemacs 
                    ac-source-nropemacs-dot)))))