From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Activating a mode in a hook Date: Mon, 21 Jul 2014 13:10:04 +0200 Message-ID: <20140721111004.GA7424@chitra.no-ip.org> References: <87mwc6er6u.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1405941030 6927 80.91.229.3 (21 Jul 2014 11:10:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jul 2014 11:10:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 21 13:10:22 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 1X9BU6-0005le-DU for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2014 13:10:22 +0200 Original-Received: from localhost ([::1]:33462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9BU5-0002Lp-R7 for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Jul 2014 07:10:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9BTu-0002Lf-1P for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 07:10:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9BTs-0003DB-U7 for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 07:10:09 -0400 Original-Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:50052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9BTs-0003BV-OS for help-gnu-emacs@gnu.org; Mon, 21 Jul 2014 07:10:08 -0400 Original-Received: by mail-wg0-f52.google.com with SMTP id a1so6254111wgh.35 for ; Mon, 21 Jul 2014 04:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=hMk4IL7yCP6Qg7kv3WVsKFSunhkJuTvc72UbsDu+DPs=; b=ud93Rx+xv/FUpgxEi7F5x4SlXKYk/5CPziRAgasFGShfGr3mm4YF/wRbKpkDSXoTzF Dxvr6MF/PMbY8UAEn2nGTv4JFjkwE+qfxlQB28rLjT4e9i3AzPIRyD6k8vnF2wT+5/gi inxlhMAopBBWA+t5T32i4p367LUIvsUhBgNrototAZqqIndc2dMD/PyVoxgHYJ9VtFk+ n+tdvAio4dvPoGUpIwBX72yvfLNlggzCaDVqKmhomVevo3lO4enu4uVZldMFIQf9ebFZ FloBduKqK3S/xFGY9BJZzN/rvPBk6zhb60T8Z3yIt2PePU2vmc1hkptNDtZDnU/WdC4B A9HQ== X-Received: by 10.194.82.106 with SMTP id h10mr22278165wjy.115.1405941006981; Mon, 21 Jul 2014 04:10:06 -0700 (PDT) Original-Received: from chitra.no-ip.org ([2001:610:120:3001:2ad2:44ff:fe4a:b029]) by mx.google.com with ESMTPSA id da9sm40847133wib.5.2014.07.21.04.10.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jul 2014 04:10:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87mwc6er6u.fsf@gnu.org> User-Agent: Mutt/1.5.22.1 (2013-10-16) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::234 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:98856 Archived-At: On Fri, Jul 18, 2014 at 03:23:37PM +0200, Tassilo Horn wrote: > Florian Lindner writes: > > Hi Florian, > > I have no clue about the first question, but... > > > Second question: semantic-mode will be activated when entering c++ > > mode but then it's globablly activated, how can I activate it only for > > specific modes? > > I think, you cannot. At least it's defined as a global minor mode in > semantic.el: > > --8<---------------cut here---------------start------------->8--- > (define-minor-mode semantic-mode > "..." > :global t > ^^^^^^^^^ > --8<---------------cut here---------------end--------------->8--- I use something like this to limit semantic: ;; disable semantic in all non C/C++ buffers (add-to-list 'semantic-inhibit-functions (lambda () (not (member major-mode '(c-mode c++-mode))))) Hope this helps, -- Suvayu Open source is the future. It sets us free.