unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* make slim auto-complete work in Org-mode (delete some ac-source in Org-mode).
@ 2014-07-30  3:16 stardiviner
  2014-07-30  3:22 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: stardiviner @ 2014-07-30  3:16 UTC (permalink / raw)
  To: Org-mode, Emacs help

I setup default =ac-sources= for auto-complete like this:

#+BEGIN_SRC emacs-lisp
(setq-default ac-sources
              '(ac-source-yasnippet
                ac-source-abbrev
                ac-source-filename
                ac-source-files-in-current-dir
                ac-source-dictionary
                ac-source-words-in-same-mode-buffers
                ))
#+END_SRC

And I found =ac-source-dictionary= and =ac-source-words-in-same-mode-buffers= is
heavy for Org-mode, So I try to remove them only in Org-mode.

This is my try:

#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook
          (lambda ()
            ;; use `delq' in a loop.
            (mapc (lambda (x) (setq-local ac-sources (delq x ac-sources)))
                  '(ac-source-dictionary ac-source-words-in-same-mode-buffers))))
#+END_SRC

But this code will use =delq= to delete *global default* =ac-sources= too. But I only
want to delete in Org-mode.
So is there some other ways to do it?



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-30  3:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  3:16 make slim auto-complete work in Org-mode (delete some ac-source in Org-mode) stardiviner
2014-07-30  3:22 ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).