From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: jonetsu Newsgroups: gmane.emacs.help Subject: Re: How to have yasnippet only for C/C++ files ? Date: Tue, 26 Mar 2019 15:08:57 -0400 Message-ID: <20190326150857.130a79e9@mistral> References: <20190326110557.6cca1321@mistral> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149894"; mail-complaints-to="usenet@blaine.gmane.org" 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 20:12:01 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 1h8rUN-000csI-3i for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Mar 2019 20:11:59 +0100 Original-Received: from localhost ([127.0.0.1]:36725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8rUM-0001C4-3X for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Mar 2019 15:11:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8rRW-0007GS-I9 for help-gnu-emacs@gnu.org; Tue, 26 Mar 2019 15:09:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8rRV-0006cB-I4 for help-gnu-emacs@gnu.org; Tue, 26 Mar 2019 15:09:02 -0400 Original-Received: from pmta11.teksavvy.com ([76.10.157.34]:45431) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1h8rRT-0006bY-LA for help-gnu-emacs@gnu.org; Tue, 26 Mar 2019 15:09:01 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EuGQBxeJpc/0Tb1BhkHAEBAR8EAQEFA?= =?us-ascii?q?QGBToEpZkUjcRIng0aJQ4xVNQGODxGLJDw0BgEChDQEAgIBAQKFIiM4EgEBAwE?= =?us-ascii?q?BAQgBAwICAmkcDIJ0BE07MAEBAQEBAQEBAQEBAQEBARoCDWQBBAE6HCgLCAMJG?= =?us-ascii?q?CUPKh4ZgyOBbQgPriWKKgUigQ0BAQEBAYtEgT9Ag3UuPoJhAgKCLIRyIgORe5M?= =?us-ascii?q?eCYNAhCOLTCUMgWaJIYhvkSOPOCKBVnAVgyeFeIpvJjCBAQEGAQEBFQgTBQUBA?= =?us-ascii?q?Y57AQE?= X-IPAS-Result: =?us-ascii?q?A2EuGQBxeJpc/0Tb1BhkHAEBAR8EAQEFAQGBToEpZkUjcRI?= =?us-ascii?q?ng0aJQ4xVNQGODxGLJDw0BgEChDQEAgIBAQKFIiM4EgEBAwEBAQgBAwICAmkcD?= =?us-ascii?q?IJ0BE07MAEBAQEBAQEBAQEBAQEBARoCDWQBBAE6HCgLCAMJGCUPKh4ZgyOBbQg?= =?us-ascii?q?PriWKKgUigQ0BAQEBAYtEgT9Ag3UuPoJhAgKCLIRyIgORe5MeCYNAhCOLTCUMg?= =?us-ascii?q?WaJIYhvkSOPOCKBVnAVgyeFeIpvJjCBAQEGAQEBFQgTBQUBAY57AQE?= X-IronPort-AV: E=Sophos;i="5.60,273,1549947600"; d="scan'208";a="90670750" Original-Received: from 24-212-219-68.cable.teksavvy.com (HELO mistral) ([24.212.219.68]) by smtp.teksavvy.com with ESMTP; 26 Mar 2019 15:08:57 -0400 In-Reply-To: X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.34 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:119755 Archived-At: On Tue, 26 Mar 2019 11:46:58 -0400 Doug Davis wrote: > 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) Thanks. Since I also do some Perl from time to time, knowing about a mode from which all programming modes are derived is useful in this case for yasnippets: (add-hook 'prog-mode-hook #'yas-minor-mode) Cheers.