Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Oops; ruby-flymake needs to be done in eval-after-load.

  • Loading branch information...
commit ed60d3d6b93bc9db3d8f10d8a673783ffaa63f95 1 parent 443db1a
@technomancy technomancy authored
Showing with 28 additions and 26 deletions.
  1. +28 −26 starter-kit-ruby.el
View
54 starter-kit-ruby.el
@@ -52,32 +52,34 @@ exec-to-string command, but it works and seems fast"
;;; Flymake
-(require 'flymake)
-
-;; Invoke ruby with '-c' to get syntax checking
-(defun flymake-ruby-init ()
- (let* ((temp-file (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-inplace))
- (local-file (file-relative-name
- temp-file
- (file-name-directory buffer-file-name))))
- (list "ruby" (list "-c" local-file))))
-
-(push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks)
-(push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks)
-
-(push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3)
- flymake-err-line-patterns)
-
-(add-hook 'ruby-mode-hook
- (lambda ()
- (when (and buffer-file-name
- (file-writable-p
- (file-name-directory buffer-file-name))
- (file-writable-p buffer-file-name))
- (local-set-key (kbd "C-c d")
- 'flymake-display-err-menu-for-current-line)
- (flymake-mode t))))
+(eval-after-load 'ruby-mode
+ '(progn
+ (require 'flymake)
+
+ ;; Invoke ruby with '-c' to get syntax checking
+ (defun flymake-ruby-init ()
+ (let* ((temp-file (flymake-init-create-temp-buffer-copy
+ 'flymake-create-temp-inplace))
+ (local-file (file-relative-name
+ temp-file
+ (file-name-directory buffer-file-name))))
+ (list "ruby" (list "-c" local-file))))
+
+ (push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks)
+ (push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks)
+
+ (push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3)
+ flymake-err-line-patterns)
+
+ (add-hook 'ruby-mode-hook
+ (lambda ()
+ (when (and buffer-file-name
+ (file-writable-p
+ (file-name-directory buffer-file-name))
+ (file-writable-p buffer-file-name))
+ (local-set-key (kbd "C-c d")
+ 'flymake-display-err-menu-for-current-line)
+ (flymake-mode t))))))
;; TODO: set up ri
;; TODO: electric
Please sign in to comment.
Something went wrong with that request. Please try again.