Permalink
Browse files

Checking for buffer-file-name before trying match in rspec-compilatio…

…n mode (was breaking mumamo)
  • Loading branch information...
Luke Amdor authored and purcell committed Mar 5, 2010
1 parent ae3630c commit 0d5b0ad97eed23a56847057bfb0c5810392ab4a7
Showing with 3 additions and 3 deletions.
  1. +3 −3 util/ruby-compilation-rspec.el
@@ -9,7 +9,7 @@
(require 'ruby-compilation)
(add-hook 'ruby-mode-hook (lambda ()
- (when (string-match "_spec.rb$" buffer-file-name)
+ (when (and (not (null buffer-file-name)) (string-match "_spec.rb$" buffer-file-name))
(set (make-local-variable 'ruby-compilation-executable)
"spec")
(set (make-local-variable 'ruby-compilation-test-name-flag)
@@ -22,9 +22,9 @@
(if (equal ruby-compilation-executable "spec")
(ruby-compilation-this-spec-name)
(ruby-compilation-this-test-name-old)))
-
+
(defun ruby-compilation-this-spec-name ()
"Return the line number at point"
(number-to-string (line-number-at-pos)))
-
+
(provide 'ruby-compilation-rspec)

0 comments on commit 0d5b0ad

Please sign in to comment.