Created
February 20, 2016 13:43
-
-
Save zeph1e/c39e9dcdbb7eee39ac47 to your computer and use it in GitHub Desktop.
The original url, "http://www.cx4a.org/pub/auto-complete-emacs-lisp.el" is now broken.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'auto-complete) | |
(defvar ac-emacs-lisp-sources | |
'(ac-source-symbols)) | |
(defvar ac-emacs-lisp-features nil) | |
(defvar ac-source-emacs-lisp-features | |
'((init | |
. (lambda () | |
(unless ac-emacs-lisp-features | |
(let ((suffix (concat (regexp-opt (find-library-suffixes) t) "\\'"))) | |
(setq | |
ac-emacs-lisp-features | |
(delq nil | |
(apply 'append | |
(mapcar (lambda (dir) | |
(if (file-directory-p dir) | |
(mapcar (lambda (file) | |
(if (string-match suffix file) | |
(substring file 0 (match-beginning 0)))) | |
(directory-files dir)))) | |
load-path)))))))) | |
(candidates . (lambda () (all-completions ac-prefix ac-emacs-lisp-features))))) | |
(defun ac-emacs-lisp-setup () | |
(setq ac-sources (append ac-emacs-lisp-sources ac-sources)) | |
(setq ac-omni-completion-sources '(("require\s+'" ac-source-emacs-lisp-features)))) | |
(defun ac-emacs-lisp-init () | |
(add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-setup)) | |
(provide 'auto-complete-emacs-lisp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment