I try to turn on auto-full mode whenever a .go file is loaded via go-mode. It works if I automatically start automatic full mode for Go source files, but when I tried to add it to .emacs as shown below, it does not work:
(add-hook 'go-mode-hook auto-complete-mode)
I tried several options, but nobody seems to work. The following is a snippet of Go-Mode in my .emacs:
;; Load Go Mode (require 'go-mode-load) (add-hook 'go-mode-hook 'auto-complete-mode)
I tried to create my own hook function as follows:
;; Load Go Mode (require 'go-mode-load) (defun auto-complete-for-go () (auto-complete-mode 1)) (add-hook 'go-mode-hook 'auto-complete-for-go)
I also tried including hook in go-mode-load.el and go-mode.el , and also call auto-complete-mode as follows:
(auto-complete-mode t) (provide 'go-mode)
Doesn't work anyway. I also added the go-mode-hook to auto-complete-default function as follows:
(defun ac-config-default () (setq-default ac-sources '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers)) (add-hook 'go-mode-hook 'ac-common-setup) ;; Other hooks (global-auto-complete-mode t))
This does not work either. What is the best way to run a command immediately after the main mode for a buffer?
source share