avdi (owner)

Revisions

gist: 215742 Download_button fork
public
Description:
Horrible elisp hack to keep flymake from confusing Merb, Rails, etc.
Public Clone URL: git://gist.github.com/215742.git
Embed All Files: show embed
rails.el #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;; 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 ()))