From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: make slim auto-complete work in Org-mode (delete some ac-source in Org-mode). Date: Wed, 30 Jul 2014 11:16:07 +0800 Message-ID: <87r413edu0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org To: Org-mode , Emacs help List-Id: emacs-orgmode.gnu.org 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?