Browse files

added midje-mode-maybe-enable; defined clojure indent

  • Loading branch information...
1 parent 27828d4 commit bc786624a754b6bc1f70f9fb1ca4de9841855bd3 @dnaumov committed Jun 21, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 midje-mode.el
View
18 midje-mode.el
@@ -288,5 +288,23 @@ nearby Clojure form and recheck the last fact checked
;; 'midje-post-compilation-action)
(hs-minor-mode 1))
+;;;###autoload
+(progn
+ (defun midje-mode-maybe-enable ()
+ "Enable midje-mode if the current buffer contains a \"midje.\" string."
+ (let ((regexp "midje\\."))
+ (save-excursion
+ (when (or (re-search-backward regexp nil t)
+ (re-search-forward regexp nil t))
+ (midje-mode t)))))
+ (add-hook 'clojure-mode-hook 'midje-mode-maybe-enable))
+
+(eval-after-load 'clojure-mode
+ '(define-clojure-indent
+ (fact 'defun)
+ (facts 'defun)
+ (against-background 'defun)
+ (provided 0)))
+
(provide 'midje-mode)
;;; midje-mode.el ends here

0 comments on commit bc78662

Please sign in to comment.