all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Samuel Banya" <sbanya@fastmail.com>
To: "Emanuel Berg" <help-gnu-emacs@gnu.org>
Subject: Question Regarding Trying To Implement Yasnippet Templates To Wrap Source Blocks Around Regions
Date: Thu, 06 Jan 2022 13:58:06 -0500	[thread overview]
Message-ID: <aab11f9e-5433-40d2-95f2-28a432ed6be5@www.fastmail.com> (raw)

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


             reply	other threads:[~2022-01-06 18:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 18:58 Samuel Banya [this message]
2022-01-06 19:21 ` Question Regarding Trying To Implement Yasnippet Templates To Wrap Source Blocks Around Regions Yuri Khan
2022-01-06 21:42   ` Samuel Banya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aab11f9e-5433-40d2-95f2-28a432ed6be5@www.fastmail.com \
    --to=sbanya@fastmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.