From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Samuel Banya" Newsgroups: gmane.emacs.help Subject: Question Regarding Trying To Implement Yasnippet Templates To Wrap Source Blocks Around Regions Date: Thu, 06 Jan 2022 13:58:06 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29105"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-4526-gbc24f4957e-fm-20220105.001-gbc24f495 To: "Emanuel Berg" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 06 19:59:15 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n5Xyl-0007KG-Ab for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 06 Jan 2022 19:59:15 +0100 Original-Received: from localhost ([::1]:46092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5Xyk-0005pc-D2 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 06 Jan 2022 13:59:14 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5Xy6-0005SX-8l for help-gnu-emacs@gnu.org; Thu, 06 Jan 2022 13:58:34 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:38507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5Xy0-00024X-QH for help-gnu-emacs@gnu.org; Thu, 06 Jan 2022 13:58:33 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 1201B3202D71 for ; Thu, 6 Jan 2022 13:58:26 -0500 (EST) Original-Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Thu, 06 Jan 2022 13:58:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= mime-version:message-id:date:from:to:subject:content-type; s= fm1; bh=5RHdcYiqAl3pW20t+sHi/+cJYhwQYhYjmvML/WUIR1Y=; b=TyueBAVX VKxRkYPCI8JnXDFbKMNM//gJQnZNlvBSU0F0DSSrGxVVyuq5jTvq7GpqH/R8tmAG AYmHizoXV+QGxWsts6GWlcjdj3NPi24Nq0JFmhyFNiHzb0I6gAyv2VU23JyHtAbT FxBKLS5alUEWGi6TccgAeAJbZVdLCBSUXy6XpafOV8SJ1PwSLENYVP9gjv35r4BJ d0UAOUOs+KgB9AgHth0mP/j5FUkX0b6PhXC2RlwJVSOOJk1pzNxOXsB2HNL+JpLi BmGwHljh3DtNjZl77caPRhXy5j97YpGThp19cvuT95reA/k2CwMbUH+bgC8n7XCP zhlAvv1I415IcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=5RHdcYiqAl3pW20t+sHi/+cJYhwQY hYjmvML/WUIR1Y=; b=K+JfoKWkJNUXk+wbNo85T5Dhl5L3S55pqpEjnXQqBSAzI pXLMKIa+QQmuv8N6n/iV+oVnwxINU5gLfL7R5fy0elwol31wCrkuSpTbyk3ZPoXb H8KuVzkehlWyMjv3Bm0fb1xC+Ujw9dxVv94F7je0oANwdjWlraxz2N+TgPNRhr8b uEjV6LnHm7SnkyoXIWiL5b2CuUvFd+SpH+EDyrMKGGPOWcHoBF+CPOWGXuml/jZO LNHmKZkPdILyPNSbtXFaOLfw2Wh1dGVq051au4Gy7QMiMgn2fu1+PQJVWSFLU6lP WNjnE8igL9Bt5FTdLz/gQESAmftP13Rd5RQHyD7XA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefledguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmd enucfjughrpefofgggkfffhffvufgtsegrtderreerredtnecuhfhrohhmpedfufgrmhhu vghluceurghnhigrfdcuoehssggrnhihrgesfhgrshhtmhgrihhlrdgtohhmqeenucggtf frrghtthgvrhhnpeehgfdvvdevkeehhfeiiefghffhgfevleeugedutdefieeiueekieek hfdvteevgfenucffohhmrghinhepghhithhhuhgsrdhiohdpghhithhhuhgsrdgtohhmpd hsthgrtghkvgigtghhrghnghgvrdgtohhmpdhsthgrtghkohhvvghrfhhlohifrdgtohhm necuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepshgsrg hnhigrsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 62ADAF60080; Thu, 6 Jan 2022 13:58:26 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Received-SPF: pass client-ip=64.147.123.19; envelope-from=sbanya@fastmail.com; helo=wout3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135120 Archived-At: Hey there, I'm trying to figure out how to utilize a Yasnippet template to wrap a source block around a section of code that I've highlighted. Here's the template I used in '/home/sam/hub/dotfiles/emacs/.emacs.d/snippets/org-mode': # -*- mode: snippet -*- # name: wrapsrc # key: C-; # expand-env: ((yas-wrap-around-region t)) # -- #+begin_src $1 $0 #+end_src Here are the links I tried referring to as references: https://joaotavora.github.io/yasnippet/snippet-reference.html#yas-wrap-around-region https://gist.github.com/kazu634/290872 https://emacs.stackexchange.com/questions/35557/how-can-i-define-a-yasnippet-for-if-and-if https://stackoverflow.com/questions/9082999/how-to-insert-a-latex-environment-around-a-block-of-text-in-emacs Any ideas on how to do this? Thanks, Sam