Skip to content

Instantly share code, notes, and snippets.

@selman
Created July 4, 2010 18:54
Show Gist options
  • Save selman/463664 to your computer and use it in GitHub Desktop.
Save selman/463664 to your computer and use it in GitHub Desktop.
ruby flymake
(require 'ido)
(ido-mode t)
(add-to-list 'load-path "~/.emacs.d/plugins/textmate")
(require 'textmate)
(textmate-mode)
;; Rinari
(add-to-list 'load-path "~/.emacs.d/plugins/rinari")
(require 'rinari)
(setq rinari-tags-file-name "TAGS")
;; flymake
(require 'flymake)
;; Not provided by flymake itself, curiously
(defun flymake-create-temp-in-system-tempdir (filename prefix)
(make-temp-file (or prefix "flymake-temp")))
;; got from http://github.com/purcell/emacs.d/blob/master/site-lisp/flymake-ruby/flymake-ruby.el
(defvar flymake-ruby-err-line-patterns '(("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3)))
(defvar flymake-ruby-allowed-file-name-masks '((".+\\.\\(rb\\|rake\\)$" flymake-ruby-init)
("Rakefile$" flymake-ruby-init)))
;; Invoke ruby with '-c' to get syntax checking
(defun flymake-ruby-init ()
(list "ruby" (list "-c" (flymake-init-create-temp-buffer-copy
'flymake-create-temp-in-system-tempdir))))
(defun flymake-ruby-load ()
(interactive)
(set (make-local-variable 'flymake-allowed-file-name-masks) flymake-ruby-allowed-file-name-masks)
(set (make-local-variable 'flymake-err-line-patterns) flymake-ruby-err-line-patterns)
(flymake-mode t))
(add-hook 'ruby-mode-hook 'flymake-ruby-load)
diff --git a/textmate.el b/textmate.el
index fbd31d3..09147c6 100644
--- a/textmate.el
+++ b/textmate.el
@@ -284,7 +284,7 @@ Symbols matching the text at point are put first in the completion list."
")")))
(find-file
(concat
- (expand-file-name root) "/"
+; (expand-file-name root) "/"
(textmate-completing-read
"Find file: "
(textmate-cached-project-files root))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment