Skip to content

Commit

Permalink
Stop flymake from breaking when major modes are invoked by mmm-mode, …
Browse files Browse the repository at this point in the history
…at which point buffer-file-name is nil
  • Loading branch information
purcell committed Apr 14, 2009
1 parent 5b1d611 commit 4a56fc7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions init-ruby-mode.el
Expand Up @@ -18,6 +18,15 @@
(require 'flymake-ruby)
(add-hook 'ruby-mode-hook 'flymake-ruby-load)

;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
;; at which point buffer-file-name is nil
(eval-after-load "flymake"
'(defun flymake-can-syntax-check-file (file-name)
"Determine whether we can syntax check FILE-NAME.
Return nil if we cannot, non-nil if we can."
(if (and file-name (flymake-get-init-function file-name)) t nil)))



;;----------------------------------------------------------------------------
;; Ruby - Electric mode
Expand Down

0 comments on commit 4a56fc7

Please sign in to comment.