Lisp: Emacs Autocomplete
Today I hacked some lisp in emacs because I got two new books (Let over Lambda & Land of Lisp).
After a while when the function-definitions became more frequent I missed a language-specific autocomplete (and didn’t only want to use the built-in autocomplete that completes words you wrote earlier) and after some research I found the solution: Emacs Autocomplete. It integrates different language-dictionaries and inserts new words on the fly (with the right settings).
After installing the autocomplete into .emacs.d I inserted the following lines into my .emacs-file to enable it:
;; add .emacs.d to load path (add-to-list 'load-path "~/.emacs.d") ;; enable autocomplete (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict") (ac-config-default) (global-auto-complete-mode t) (auto-complete-mode t)
;; add lisp autocomplete-support (require 'ac-slime) (add-hook 'slime-mode-hook 'set-up-slime-ac)
and to switch on autocomplete globally you have to apply a “dirty fix”:
;; dirty fix for having AC everywhere (define-globalized-minor-mode real-global-auto-complete-mode auto-complete-mode (lambda () (if (not (minibufferp (current-buffer))) (auto-complete-mode 1)))) (real-global-auto-complete-mode t)
Now only one thing is missing: the mentioned inserting of new words on the fly:
;; create and add new words to the dictionary on the fly (when (require 'auto-complete-config nil 'noerror) (add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict") (setq ac-comphist-file "~/.emacs.d/ac-comphist.dat") (ac-config-default))