弹丸不再工作了。我该如何启用它?

时间:2012-06-22 10:25:01

标签: emacs projectile emacs-prelude

当我立即启动emacs时,不再激活prelude。这是我的personal.el文件:

(setq-default tab-width 4)
(setq tab-width 4)
(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.
 '(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))))
(setq exec-path (append exec-path '("/usr/bin/")))
(setq auto-fill-mode -1)
(setq-default fill-column 99999)
(setq fill-column 99999)
(setq global-hl-line-mode -1)
(require 'projectile)

(defun myprojectilehook ()
  (projectile-mode)
)

(add-hook 'find-file-hook 'myprojectilehook)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))

我试图在find-file-hook中添加一个钩子,它可以为当前缓冲区启用射弹,但没有太大的成功。当我打开emacs弹丸被禁用时。当我访问新文件时,弹丸仍然被禁用。我做错了什么?

2 个答案:

答案 0 :(得分:3)

还有一个projectile-global-mode可以在项目上下文的任何地方激活Projectile。默认情况下会在Prelude中激活projectile-global-mode,所以我猜真正的问题与您的Prelude设置有关。无论如何:

(projectile-global-mode +1)

应无条件地为所有项目启用射弹。请记住,对于投射不认为是项目的目录中的缓冲区,将始终禁用projectile(除非您在其中添加.projectile文件以标记项目的根文件夹)。

P.S。我是Prelude和Projectile的作者,所以可以随意发布有关Prelude& amp;弹丸在这里或在GitHub上各自的问题跟踪器。

答案 1 :(得分:0)

请注意,在Emacs 24之前,(projectile-mode)切换模式(就像使用M-x projectile-mode调用它一样)。如果它打开,那就会关闭它。

假设它使用标准模式定义宏,(projectile-mode 1)将启用,(projectile-mode -1)禁用。

C-h f projectile-mode应该表明这一点。