Created
April 27, 2019 20:37
-
-
Save paxperscientiam/dc78152fbb59746c08e1e2a6039efda6 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
;; all credit to someone else. use are your own peril! | |
;; search the closest Makefile and run make | |
;; not finished | |
;; 从当前目录向上查找最近的Makefile,并执行make命令 | |
(defun get-parent-directory (path) | |
"get the parent directory" | |
(file-name-directory (directory-file-name path))) | |
(defun compile-make-ex (target) | |
"run make to compile. provide more arguments." | |
(interactive "starget: ") | |
(let ((default-directory (locate-dominating-file default-directory "Makefile"))) | |
(if default-directory | |
(compilation-start (format "make %s" target)) | |
(message "cannot find Makefile")))) | |
(defun compile-make () | |
"run make to compile" | |
(interactive) | |
(compile-make-ex "")) | |
(global-set-key [f12] 'compile) | |
(provide 'compile-make) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment