From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Doug Davis Newsgroups: gmane.emacs.help Subject: Re: How to have yasnippet only for C/C++ files ? Date: Tue, 26 Mar 2019 11:46:58 -0400 Message-ID: References: <20190326110557.6cca1321@mistral> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128860"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 27.0.50 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 26 19:06:41 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8qT8-000XIz-Vm for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Mar 2019 19:06:39 +0100 Original-Received: from localhost ([127.0.0.1]:36042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8qT8-0003vQ-17 for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Mar 2019 14:06:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8oI6-0007Lo-Oz for help-gnu-emacs@gnu.org; Tue, 26 Mar 2019 11:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8oI5-0002JI-JT for help-gnu-emacs@gnu.org; Tue, 26 Mar 2019 11:47:06 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:49861) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8oI5-0002Hg-2C for help-gnu-emacs@gnu.org; Tue, 26 Mar 2019 11:47:05 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E1F0222257 for ; Tue, 26 Mar 2019 11:47:02 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 26 Mar 2019 11:47:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddavis.io; h= references:from:to:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm1; bh=yTORW4DthTvYxAQ7a8dLAw95fb Q+kvCriYll4rKAHaQ=; b=PcxASvlxtFLt5UR7sJe3t+sr5mJbeey+SsKM0HZt2Y E7bx55b16OLgtaUr4N+ygGEPSDbqndUhY5ugILa1sRqRaHizYzmWfzQDBvQd/cIu sRhjGxbhdyckM7ZKEpQzDug9rNJz2fQWMQVzoD6GEH2kjAV0o2LqHrvjBkSUTyLc 1krGAOhkjHDypghMc2PcsgDdKigllB7oyz4iBjo7b89ukoBsqCzjieEVs5qCKNtm IiwUFH5+KdMOmJUg0HJ8/+LZgsbI3uHwP5W2Fac7JzrT6tEO2w17m9ckaF2eyHrj U2F1gh9jpz4l4Csd8cUBF2XSIsGj5DmUQOy+8RUnwghA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=yTORW4 DthTvYxAQ7a8dLAw95fbQ+kvCriYll4rKAHaQ=; b=qMClsLpxt030pX8N+/B095 aDqiOk5RwbZvYAm57BGvhotr4Dgp5MOhOgDTraaiLOZxOJO7AnGl1Ue3lAFS/5bc h/2s67PfVXjMdaHGDSFC0+sKZI/tYUr7To7CuZwM7SERR3XwbR4Udw1IryicWxft CSuTARMM6nljlT6UpXBBic8qd68bn9qUbdkJq8SL5oWCoMUVm5FCIwflm3gh24TG 7OfgmMAESlhguTcmnyrhJyx8wqrvlSVdMGq5h8YVPQOMWrKlhtXuXKeMIrXOtmra E3TQzfaUMNlbNJRVtClGl2tfw3dc0+Wi29QFA1LvgjJh+RPiDvNHNOWKZiW/HP2Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkedtgdejkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvufgjfffkgggtsehttdertd dtredtnecuhfhrohhmpeffohhughcuffgrvhhishcuoeguuggrvhhishesuggurghvihhs rdhioheqnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepudehvddrfedrfe egrdekvdenucfrrghrrghmpehmrghilhhfrhhomhepuggurghvihhsseguuggrvhhishdr ihhonecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Original-Received: from localhost (unknown [152.3.34.82]) by mail.messagingengine.com (Postfix) with ESMTPA id 6106BE4210 for ; Tue, 26 Mar 2019 11:47:01 -0400 (EDT) In-reply-to: <20190326110557.6cca1321@mistral> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 X-Mailman-Approved-At: Tue, 26 Mar 2019 14:06:22 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:119754 Archived-At: Hi, Check here: https://github.com/joaotavora/yasnippet#use-yas-minor-mode-on-a-per-buffer-basis Looks like you can do (add-hook 'c-mode-common-hook #'yas-minor-mode) Cheers, Doug jonetsu writes: > I've installed the yasnippets package and I find it great for C/C++. > However I have searched about how to enable it only for C/C++ files > (mode) and have found nothing so far. Many references about global > mode, although I do not really want it to be global. > > So, how to enable yasnippets only for C/C++ files ? > > Thanks !