diff .elisp/settings/90.keybindings.el @ 289:5fd871a98b5f

emacs: start making an f4-dwim function I've had one at work, but only now am getting around to it here.
author Augie Fackler <raf@durin42.com>
date Wed, 17 Oct 2012 08:21:15 -0500
parents 3e1ec121efaf
children 745e7cc9c2cd
line wrap: on
line diff
--- a/.elisp/settings/90.keybindings.el
+++ b/.elisp/settings/90.keybindings.el
@@ -20,6 +20,11 @@
 (global-set-key [(control backspace)] 'kill-word)
 
 (global-set-key [f3] 'next-error)
+(defun af-dwim-f4 () (interactive)
+  (cond ((string-match "\\.t$" buffer-file-name)
+         (textmate-start-compile-in-root
+          (concat "make " (file-name-nondirectory buffer-file-name))))))
+(global-set-key [f4] 'af-dwim-f4)
 (global-set-key [f5] 'diff-apply-hunk)
 
 ;; M-j for jump to function definition