From: Jeff Horn <jrhorn424@gmail.com>
To: Org-mode ml <emacs-orgmode@gnu.org>
Subject: Making yasnippet work in indirect Org Src latex buffers
Date: Tue, 1 Mar 2011 18:49:18 -0500 [thread overview]
Message-ID: <AANLkTinOo4t4k6zseaOuQvuY=MbX1fooVMvTcp=8rcbi@mail.gmail.com> (raw)
yasnippet wasn't working for me in indirect buffers, nor was it
working in regular LaTeX mode buffers. I figured it might be because
of cdlatex, so I googled around. I like both minor modes, what can I
say? :-)
I thought I'd share the solution I found for archival purposes!
http://notes.seanwhitton.com/2010/12/making-yasnippet-and-cdlatex-mode-play-nice-together.html
The relevant portion of the code is below. Just drop this in your
starter file. It works for me, and I'm using Eric Schulte's
starter-kit, so you might need to have a look at the whole solution
linked above.
#+begin_src emacs-lisp
(defun yas/advise-indent-function (function-symbol)
(eval `(defadvice ,function-symbol (around yas/try-expand-first activate)
,(format
"Try to expand a snippet before point, then call `%s' as usual"
function-symbol)
(let ((yas/fallback-behavior nil))
(unless (and (interactive-p)
(yas/expand))
ad-do-it)))))
(yas/advise-indent-function 'cdlatex-tab)
#+end_src
--
Jeffrey Horn
http://www.failuretorefrain.com/jeff/
reply other threads:[~2011-03-01 23:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTinOo4t4k6zseaOuQvuY=MbX1fooVMvTcp=8rcbi@mail.gmail.com' \
--to=jrhorn424@gmail.com \
--cc=emacs-orgmode@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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).