# HG changeset patch # User Augie Fackler # Date 1350480075 18000 # Node ID 5fd871a98b5fb22b4e6a82dfb0d6ffa7baad5f24 # Parent e00b1960347231c3b3603f1895bce47c1d8b9a58 emacs: start making an f4-dwim function I've had one at work, but only now am getting around to it here. diff --git a/.elisp/settings/90.keybindings.el b/.elisp/settings/90.keybindings.el --- 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