Guest User

Untitled

a guest
May 2nd, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. From 3f22785e852900c70add85b00bddcd6b934fe7f5 Mon Sep 17 00:00:00 2001
  2. From: Florian Ragwitz <[email protected]>
  3. Date: Thu, 17 Jun 2010 00:48:37 +0200
  4. Subject: [PATCH] Try re-enabling after changing major modes
  5.  
  6. Only do that if the buffer has an associated file and we're not
  7. already enabled.
  8.  
  9. This probably makes at least the find-file hook unnecessary.
  10. ---
  11. eproject.el | 6 ++++++
  12. 1 files changed, 6 insertions(+), 0 deletions(-)
  13.  
  14. diff --git a/eproject.el b/eproject.el
  15. index 152c8f7..5fe4f86 100644
  16. --- a/eproject.el
  17. +++ b/eproject.el
  18. @@ -596,6 +596,12 @@ else through unchanged."
  19. ;; Finish up
  20. (add-hook 'find-file-hook #'eproject-maybe-turn-on)
  21. (add-hook 'dired-mode-hook #'eproject-maybe-turn-on)
  22. +(add-hook 'after-change-major-mode-hook
  23. + (lambda ()
  24. + (when (and (buffer-file-name)
  25. + (not eproject-root))
  26. + (eproject-maybe-turn-on))))
  27. +
  28. (add-to-list 'auto-mode-alist '("\\.eproject$" . dot-eproject-mode))
  29.  
  30. (provide 'eproject)
  31. --
  32. 1.7.1
Advertisement
Add Comment
Please, Sign In to add comment