Skip to content


Subversion checkout URL

You can clone with
Download ZIP
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...
commit ab3dc59f3bd81acd4348ce49818de888dacabea6 2 parents 644f017 + 4a05ffc
Tomohiro Matsuyama authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 auto-complete.el
7 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))
- ,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)) ()
(auto-complete '(,(intern (format "ac-source-%s" name)))))))
Please sign in to comment.
Something went wrong with that request. Please try again.