Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

@tkf
Owner

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).

@tkf tkf 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').
4a05ffc
@m2ym m2ym merged commit ab3dc59 into from
@m2ym
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 17, 2012
  1. @tkf

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

    tkf authored
    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').
This page is out of date. Refresh to see the latest.
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)))))))
Something went wrong with that request. Please try again.