With below setup, my ielm mode has autocompletion function:
(require 'ac-slime) (add-hook 'slime-mode-hook 'set-up-slime-ac) (add-hook 'slime-repl-mode-hook 'set-up-slime-ac) (eval-after-load "auto-complete" '(add-to-list 'ac-modes 'slime-repl-mode 'emacs-lisp-mode)) (defun ielm-auto-complete () "Enables `auto-complete' support in \\[ielm]." (setq ac-sources '(ac-source-functions ac-source-variables ac-source-features ac-source-symbols ac-source-words-in-same-mode-buffers)) (add-to-list 'ac-modes 'inferior-emacs-lisp-mode) (auto-complete-mode 1)) (add-hook 'ielm-mode-hook 'ielm-auto-complete) (add-hook 'ielm-mode-hook #'enable-paredit-mode) (add-hook 'ielm-mode-hook (lambda () (set (make-local-variable 'company-backends) '(company-elisp)))) (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode) (add-hook 'emacs-lisp-mode-hook (lambda () (set (make-local-variable 'company-backends) '(company-elisp))))
But it doesn't work when edit a .el file. I guess I can not share the same function call ielm-auto-complete but don't know how to change it.