Skip to content

Instantly share code, notes, and snippets.

@avdi
Created October 22, 2009 04:56
Show Gist options
  • Save avdi/215742 to your computer and use it in GitHub Desktop.
Save avdi/215742 to your computer and use it in GitHub Desktop.
Horrible elisp hack to keep flymake from confusing Merb, Rails, etc.
;; Hack up emacs-rails/flymake integration to make autotest happy
;; adapted from flymake.el
(defun abg-flymake-create-temp-inplace-without-ext (file-name prefix)
(unless (stringp file-name)
(error "Invalid file-name"))
(or prefix
(setq prefix "flymake"))
(let* ((temp-name (concat (file-name-sans-extension file-name) "." prefix)))
(flymake-log 3 "create-temp-inplace: file=%s temp=%s" file-name temp-name)
temp-name))
;; redefine to use my custom temp buffer naming method
(defun flymake-ruby-init ()
(condition-case er
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'abg-flymake-create-temp-inplace-without-ext))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list rails-ruby-command (list "-c" local-file)))
('error ()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment