使用el-get安装emacs-jedi时出现包加载问题

时间:2014-03-17 18:20:50

标签: python emacs elisp el-get emacs-jedi

我已经关注these instructions with el-get to try to install emacs-jedi(以及其他所需的套餐),但没有运气。

在我的.emacs文件中,我添加了以下几行:

;; .emacs

;; Load package repositories
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/package/") t)

(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)

;; Install / load / require el-get and
;; packages managed by it.
(add-to-list 'load-path "~/.emacs.d/el-get/")
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")

(unless (require 'el-get nil t)
  (url-retrieve
   "https://raw.github.com/dimitri/el-get/master/el-get-install.el"
   (lambda (s)
     (end-of-buffer)
     (eval-print-last-sexp))))

;; Initialize any loaded packages 
(package-initialize)

;; stuff to set font, theme, etc.
;; ...

;; Include jedi for Python mode.
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)

;; rest of file ...

起初,我看到了问题"无法打开加载文件jedi / jedi。"当我添加"〜/ .emacs.d / el-get /"这似乎消失了。到加载路径(el-get似乎只在安装时在加载路径上放置"〜/ .emacs.d / el-get / el-get"。

但在此之后,打开Python文件并尝试M-x python-mode会产生错误:

Symbol's function definition is void: jedi:setup

我很乐意做更多的调试或提供更多的消息或输出 - 但是在谷歌搜索这些错误消息很长一段时间之后,我一直无法找到任何可以尝试的东西看起来很有效率。

1 个答案:

答案 0 :(得分:3)

您遗失了https://github.com/dimitri/el-get#basic-setup

中提及的(el-get 'sync)

此外,对于package.el设置,您不需要(package-initialize)等。一切都由el-get处理。不要混合两个包管理器是个好主意。

以下是通过el-get使用Jedi的最小Emacs设置:

(add-to-list 'load-path "~/.emacs.d/el-get/el-get")

;; Uncomment this, if you are in hurry
;; (setq el-get-install-skip-emacswiki-recipes nil)

(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

(el-get 'sync)

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)

;; Type:
;; - M-x el-get-install RET jedi RET
;; - M-x jedi:install-server RET
;; Then open any Python file.

<强>更新

我在手册

中添加了它
  1. http://tkf.github.io/emacs-jedi/latest/#install
  2. http://tkf.github.io/emacs-jedi/latest/#quick-try