Created
July 8, 2014 01:59
-
-
Save kosaki/4c46f300bb41b0387f19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; flymake | |
(require 'flymake) | |
(require 'flymake-cursor) | |
;; for C | |
(add-hook 'c-mode-hook | |
'(lambda () | |
(flymake-mode t))) | |
;; Use <topdir>/build/Makefile if exist (for ruby) | |
;; from http://www.emacswiki.org/emacs/FlyMake | |
(defun ac-find-configure (source-dir) | |
(locate-dominating-file source-dir "configure")) | |
(defun ac-build-dir (source-dir) | |
"find the build directory for the given source directory" | |
(progn (let* (topdir (ac-find-configure source-dir)) | |
(if (file-exists-p (concat topdir "build/Makefile")) | |
(concat topdir "build/") | |
source-dir)))) | |
(defadvice flymake-find-buildfile | |
(around advice-find-makefile-separate-obj-dir | |
activate compile) | |
"Look for buildfile in a separate build directory" | |
(let* ((source-dir (ad-get-arg 1)) | |
(bld-dir (ac-build-dir source-dir))) | |
(ad-set-arg 1 bld-dir) | |
ad-do-it)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment