3

我已按照这些说明el-get尝试安装 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

我很高兴进行更多调试或提供更多消息或输出——但是在谷歌搜索这些错误消息很长时间之后,我一直无法找到任何看起来很有成效的尝试。

4

1 回答 1

3

您缺少https://github.com/dimitri/el-get#basic-setup(el-get 'sync)中提到的内容

此外,您不需要(package-initialize)等进行 package.el 设置。一切都由 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
于 2014-03-17T18:36:37.850 回答