Skip to content

Instantly share code, notes, and snippets.

@yenliangl
Created January 5, 2012 07:59
Show Gist options
  • Save yenliangl/1564186 to your computer and use it in GitHub Desktop.
Save yenliangl/1564186 to your computer and use it in GitHub Desktop.
Customize compile command in Emacs
(define-key c++-mode-map [(f8)] 'my-make-compile-command)
(define-key c++-mode-map [(f9)] 'my-make-g-compile-command)
(defun my-make-compile-command ()
(interactive)
(set (make-local-variable 'compile-command)
(concat "make -C " default-directory))
;; (setq current-prefix-arg '(4)) ;C-u
(call-interactively 'compile))
(defun my-make-g-compile-command ()
(interactive)
(set (make-local-variable 'compile-command)
(concat "make BUILD_TYPE=pure exec-g -C " default-directory))
(call-interactively 'compile))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment