Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ac-define-source `eval-defun'-friendly #184

Merged
merged 1 commit into from Oct 18, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions auto-complete.el
Expand Up @@ -1733,8 +1733,11 @@ completion menu. This workaround stops that annoying behavior."
"Source definition macro. It defines a complete command also."
(declare (indent 1))
`(progn
(defvar ,(intern (format "ac-source-%s" name))
,source)
(defvar ,(intern (format "ac-source-%s" name)))
;; Use `setq' to reset ac-source-NAME every time
;; `ac-define-source' is called. This is useful, for example
;; when evaluating `ac-define-source' using C-M-x (`eval-defun').
(setq ,(intern (format "ac-source-%s" name)) ,source)
(defun ,(intern (format "ac-complete-%s" name)) ()
(interactive)
(auto-complete '(,(intern (format "ac-source-%s" name)))))))
Expand Down