# HG changeset patch # User Augie Fackler # Date 1284986129 18000 # Node ID 7ca719e40c58fd8a7ce2fb2be715fb5db8004286 # Parent 739d960039935bf53cc4d4b7b635f1dcdf68c6dd modes: enable Go mode if it can be found diff --git a/.elisp/settings/40.modes.el b/.elisp/settings/40.modes.el --- a/.elisp/settings/40.modes.el +++ b/.elisp/settings/40.modes.el @@ -26,6 +26,21 @@ point." (add-hook 'rst-mode-hook 'af-no-clean-whitespace) (add-hook 'makefile-mode-hook 'af-no-clean-whitespace) + +(defun af-go-hook () + ;; enable tabs + (setq tab-width 2) + (setq-default indent-tabs-mode t)) + + +(let ((go-emacs (concat (getenv "GOROOT") "/misc/emacs"))) + (message (concat go-emacs "/go-mode.el")) + (if (file-exists-p (concat go-emacs "/go-mode.el")) + (progn (add-to-list 'load-path go-emacs) + (require 'go-mode-load) + (add-hook 'go-mode-hook 'af-go-hook)) + (message "Go appears to not be installed, skipping go-mode."))) + (autoload 'js2-mode "js2" nil t) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) (add-hook 'js2-mode-hook 'af-tab-fix)