[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Easy templates broken with 9.2

From: Berry, Charles
Subject: Re: [O] Easy templates broken with 9.2
Date: Sun, 27 Jan 2019 17:47:30 +0000

> On Jan 27, 2019, at 9:17 AM, Thomas S. Dye <address@hidden> wrote:
> Aloha LB,
> I'm working my way through this change, too, hunting down all the places I've 
> modified org-structure-template-alist.  You'll need to get rid of the 
> templates you've added to this list.  The new function won't run if it finds 
> an old-style template on the list. 
> Once the list is clean, the new function offers the possibility of selecting 
> some text, then hitting C-c C-, and choosing a structure that encloses the 
> selected text.  This is quite handy.
> I had a number of one-line templates that I haven't figured out how to 
> replace yet.  Any suggestions are welcome.

I like the ability to wrap a region using `C-c C-,' but my fingers still want 
`<R' to initiate an R src block.  And likewise for a few other similar 

So I have this in my init:

#+begin_src emacs-lisp 

  (require 'org-tempo)

  (tempo-define-template "org-src_R"
                         '("#+begin_src R" p  n
                           n "#+end_src" )
                         "<R" "Insert R block" 'org-tempo-tags)

  (tempo-define-template "org-src-named-R"
                         '("#+name: " p  n
                           "#+begin_src R"   n
                          n "#+end_src" )
                         "<r" "Insert Named R block" 'org-tempo-tags)

  (tempo-define-template "org-eqnarray"
                         '("\\begin{eqnarray} " '> n p
                          n "\\end{eqnarray}" >)
                         "<Y" "Insert LaTeX eqnarray" 'org-tempo-tags)

  (tempo-define-template "org-equation"
                         '("\\begin{equation} " '> n p
                          n "\\end{equation}" >)
                         "<Q" "Insert LaTeX equation" 'org-tempo-tags)

  (tempo-define-template "org-displaymath"
                         '("# begin math" n
                           "\\["  p n
                           "\\]" n
                           "# end math" n)
                         "<m" "Insert \\[ \\]" 'org-tempo-tags)


See the docstring for `tempo-define-template' for more details.

I use the default `org-structure-template-alist'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]