Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
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
View
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))
`(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)))))))
Please sign in to comment.
Something went wrong with that request. Please try again.