Emacs 添加果酱作为包源

Emacs 添加果酱作为包源,emacs,emacs23,elpa,Emacs,Emacs23,Elpa,我试图将Marmalade添加为包源,但当我这样做时,我得到一个错误:Symbol的变量值为void:package archives。有人知道如何解决这个问题吗?下面是我的.emacs文件 ;;; This was installed by package-install.el. ;;; This provides support for the package system and ;;; interfacing with ELPA, the package archive. ;;; Mov

我试图将Marmalade添加为包源,但当我这样做时,我得到一个错误:
Symbol的变量值为void:package archives。
有人知道如何解决这个问题吗?下面是我的
.emacs
文件

;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
    (load
     (expand-file-name "~/.emacs.d/elpa/package.el"))
  (package-initialize))

(add-to-list 'load-path (expand-file-name "~/.emacs.d"))
(add-to-list 'load-path  "~/.emacs.d/plugins")
(add-to-list 'load-path "~/.emacs.d/plugins/color-theme")
(add-to-list 'load-path "~/.emacs.d/plugins/groovy")

(require 'package)
(add-to-list 'package-archives
         '("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
安装package.el的步骤

我运行了以下代码:

(let ((buffer (url-retrieve-synchronously
           "http://tromey.com/elpa/package-install.el")))
  (save-excursion
    (set-buffer buffer)
    (goto-char (point-min))
    (re-search-forward "^$" nil 'move)
    (eval-region (point) (point-max))
    (kill-buffer (current-buffer))))

使用emacs24附带的package.el,因为ELPA版本不包括
包存档
和对多个存储库的支持

可以在此处找到(emacs24!):

最新emacs23兼容版本:


把它放到你的加载路径中,选择一种加载类型(即在注释后删除行)。

package.el的版本是什么?你是怎么得到的?如果是elpa软件包。el:它不包括
软件包档案
,也不可能添加存储库。@Michael Markert:我认为是最新的一个;我是通过运行我作品底部的代码得到的。是的,它是elpa package.el。还有哪些package.el?我使用的是emacs 23.3.1,您链接到的package.el似乎不起作用。此外,您是否希望我删除评论后面的所有行?或者只是*(什么时候…?)哦,我忘了,向后兼容性在几个月前被破坏了,我在我的帖子中添加了最后一个兼容emacs23的版本。至于删除:如果要保留路径,只需在时插入
,并将
require
替换为
load