【发布时间】:2014-08-27 22:57:07
【问题描述】:
我对 emacs 还很陌生。事实上,我正在学习编辑器并尝试设置一些可以复制 Code::Blocks 或 notepad++ 的某些插件中已知的“转到项目内的文件”功能的东西。
'projectile' 满足了这个需求,我通过 MELPA 安装了它。软件包安装正确,因为我可以使用M-x projectile-global-mode 启动它,并且可以识别C-c p 命令。
但是,如果我把它放到我的.emacs 文件中,Emacs 会出现错误:
Symbol's function definition is void: projectile-global-mode
我的.emacs文件内容如下:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(global-whitespace-mode 1)
(global-linum-mode 1)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(projectile-global-mode 1)
当我首先尝试(require 'projectile) 时,我只会遇到另一个错误:
'File error: Cannot open load file, projectile'
我使用的是 Emacs 24.3.1。
如何正确设置自动启动?
【问题讨论】:
-
很遗憾,您提供的问题只能部分解决此问题。即使我设法做到了(projectile-global-mode 1),projectile 仍然拒绝工作。
-
它确实解决了问题正如你所说的,相信我。如果您现在有不同的问题,您可能应该更新问题以提供更多详细信息。否则我们将无法为您提供帮助。