emacsprojectileemacs-prelude

Projectile not working anymore. How can I reenable it?


When I start emacs now, prelude is no longer activated. This is my personal.el file:

(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/"))

I tried to add a hook to find-file-hook, that would enable projectile for the current buffer, but without much success. When I open emacs projectile is disabled. When I visit a new file, projectile remains disabled. What am I doing wrong?


Solution

  • There is a projectile-global-mode as well that activates Projectile everywhere there is a project context. projectile-global-mode is activated by default in Prelude, so I guess the real issue has to do with your Prelude setup. At any rate:

    (projectile-global-mode +1)

    should unconditionally enable projectile for all of your projects. Keep in mind that that projectile will always be disabled for buffers in directories that projectile doesn't consider to be projects (unless you add a .projectile file in them to mark the root folder of a project).

    P.S. I am the author of both Prelude and Projectile, so fell free to post additional details about your problems with Prelude & Projectile here or at their respective issue trackers at GitHub.