我正在使用这建议,试图让Emacs为我管理我的包。我不能让Emacs来验证这段代码,它应该安装我所有的软件包,但是目前它什么也没做。我的私奔里有什么我看不到的错误吗?
;;; Emacs is not a package manager, and here we load its package manager!
(require 'package)
(dolist (source '(("marmalade" . "http://marmalade-repo.org/packages/")
("elpa" . "http://tromey.com/elpa/")
;; TODO: Maybe, use this after emacs24 is released
;; (development versions of packages)
("melpa" . "http://melpa.milkbox.net/packages/")
))
(add-to-list 'package-archives source t))
(package-initialize)
;;; Required packages
;;; everytime emacs starts, it will automatically check if those packages are
;;; missing, it will install them automatically
(when (not package-archive-contents)
(package-refresh-contents))
(defvar tmtxt/packages
'(evil git-gutter monokai-theme magit markdown-mode evil-leader jedi evil-surround arduino-mode evil-nerd-commenter zeal-at-point))
(dolist (p tmtxt/packages)
(lambda ()
(when (not (package-installed-p p))
(package-install p))
(require p)))发布于 2014-07-03 12:36:14
您的dolist的主体仅仅是一个“lambda表达式”,即它立即计算为一个被立即丢弃的函数。由于您希望执行函数的主体,所以只需删除(lambda () ...)包装器:
(dolist (p tmtxt/packages)
(when (not (package-installed-p p))
(package-install p))
(require p))https://stackoverflow.com/questions/24553671
复制相似问题