Browse files

Merge pull request #184 from tkf/refs/heads/eval-defun-ac-define-source

Make ac-define-source `eval-defun'-friendly
  • Loading branch information...
Tomohiro Matsuyama
Tomohiro Matsuyama committed Oct 18, 2012
2 parents 644f017 + 4a05ffc commit ab3dc59f3bd81acd4348ce49818de888dacabea6
Showing with 5 additions and 2 deletions.
  1. +5 −2 auto-complete.el
@@ -1733,8 +1733,11 @@ completion menu. This workaround stops that annoying behavior."
"Source definition macro. It defines a complete command also."
(declare (indent 1))
(defvar ,(intern (format "ac-source-%s" name))
(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)) ()
(auto-complete '(,(intern (format "ac-source-%s" name)))))))

0 comments on commit ab3dc59

Please sign in to comment.