Skip to content

Commit

Permalink
Move general flymake configuration to an outboard init file
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Apr 14, 2009
1 parent 4a56fc7 commit 317febe
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
23 changes: 23 additions & 0 deletions init-flymake.el
@@ -0,0 +1,23 @@
(setq flymake-gui-warnings-enabled nil)

;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
;; at which point buffer-file-name is nil
(eval-after-load "flymake"
'(progn
(defun flymake-show-next-error-in-minibuffer ()
"Move point to the next flymake error and display the error in the minibuffer"
(interactive)
(flymake-goto-next-error)
(let ((err (get-char-property (point) 'help-echo)))
(when err
(message err))))

(global-set-key (kbd "C-`") 'flymake-show-next-error-in-minibuffer)

(defun flymake-can-syntax-check-file (file-name)
"Determine whether we can syntax check FILE-NAME.
Return nil if we cannot, non-nil if we can."
(if (and file-name (flymake-get-init-function file-name)) t nil))))


(provide 'init-flymake)
9 changes: 0 additions & 9 deletions init-ruby-mode.el
Expand Up @@ -18,15 +18,6 @@
(require 'flymake-ruby)
(add-hook 'ruby-mode-hook 'flymake-ruby-load)

;; Stop flymake from breaking when ruby-mode is invoked by mmm-mode,
;; at which point buffer-file-name is nil
(eval-after-load "flymake"
'(defun flymake-can-syntax-check-file (file-name)
"Determine whether we can syntax check FILE-NAME.
Return nil if we cannot, non-nil if we can."
(if (and file-name (flymake-get-init-function file-name)) t nil)))



;;----------------------------------------------------------------------------
;; Ruby - Electric mode
Expand Down
6 changes: 6 additions & 0 deletions init.el
Expand Up @@ -308,6 +308,12 @@ in `exec-path', or nil if no such command exists"
(remove 'try-expand-line hippie-expand-try-functions-list)))


;;----------------------------------------------------------------------------
;; Basic flymake configuration
;;----------------------------------------------------------------------------
(require 'init-flymake)


;;----------------------------------------------------------------------------
;; Erlang
;;----------------------------------------------------------------------------
Expand Down

0 comments on commit 317febe

Please sign in to comment.