From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: stardiviner Newsgroups: gmane.emacs.help,gmane.emacs.orgmode 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1406690327 19580 80.91.229.3 (30 Jul 2014 03:18:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2014 03:18:47 +0000 (UTC) To: Org-mode , Emacs help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 30 05:18:40 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XCKPY-0004hD-A5 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Jul 2014 05:18:40 +0200 Original-Received: from localhost ([::1]:48784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCKPX-0000Bl-Nm for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Jul 2014 23:18:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCKPI-0000Ad-3G for help-gnu-emacs@gnu.org; Tue, 29 Jul 2014 23:18:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCKPB-000073-Vz for help-gnu-emacs@gnu.org; Tue, 29 Jul 2014 23:18:24 -0400 Original-Received: from [117.149.127.125] (port=1788 helo=dark) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCKPB-00006g-9K; Tue, 29 Jul 2014 23:18:17 -0400 Original-Received: from dark (localhost [127.0.0.1]) by dark (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id s6U3I8W2025719; Wed, 30 Jul 2014 11:18:09 +0800 Original-Received: (from stardiviner@localhost) by dark (8.14.4/8.14.4/Submit) id s6U3H7OY025612; Wed, 30 Jul 2014 11:17:07 +0800 X-Authentication-Warning: dark: stardiviner set sender to numbchild@gmail.com using -f User-agent: mu4e 0.9.9.6pre3; emacs 24.3.50.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 117.149.127.125 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98994 gmane.emacs.orgmode:89230 Archived-At: 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?