Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

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').
  • Loading branch information...
commit 4a05ffc3169ccb42c24c439f22eb478e7a565ae9 1 parent 644f017
@tkf tkf 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.