Skip to content

Commit

Permalink
Maybe default compile-command' to raco make`
Browse files Browse the repository at this point in the history
See issue #144.
  • Loading branch information
Greg Hendershott committed Jul 8, 2015
1 parent 075ba04 commit a33627f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions racket-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ http://www.gnu.org/licenses/ for details.")
(set (make-local-variable 'imenu-syntax-alist)
'(("+-*/.<>=?!$%_&~^:" . "w"))))

(defun racket--maybe-set-compile-command ()
"Unless a makefile exists, `compile' should \"raco make `buffer-file-name'\"."
(unless (or (file-exists-p "makefile")
(file-exists-p "Makefile"))
(set (make-local-variable 'compile-command)
(concat racket-raco-program
" make "
buffer-file-name))))

;;;###autoload
(define-derived-mode racket-mode prog-mode
"Racket"
Expand All @@ -160,6 +169,7 @@ http://www.gnu.org/licenses/ for details.")
(racket--variables-for-both-modes)
(racket--variables-imenu)
(racket--company-setup)
(racket--maybe-set-compile-command)
(hs-minor-mode t))

;;;###autoload
Expand Down

0 comments on commit a33627f

Please sign in to comment.