Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 1.02 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. From 3f22785e852900c70add85b00bddcd6b934fe7f5 Mon Sep 17 00:00:00 2001
  2. From: Florian Ragwitz <rafl@debian.org>
  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