emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" <ccberry@ucsd.edu>
To: "Thomas S. Dye" <tsdye.com@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>,
	Lawrence Bottorff <borgauf@gmail.com>
Subject: Re: Easy templates broken with 9.2
Date: Sun, 27 Jan 2019 17:47:30 +0000	[thread overview]
Message-ID: <5A34FA2B-202E-456B-A8C7-4B6DEAE57338@ucsd.edu> (raw)
In-Reply-To: <1548609440.18283.0@smtp.gmail.com>



> On Jan 27, 2019, at 9:17 AM, Thomas S. Dye <tsdye.com@gmail.com> 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 keypresses.  

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)

#+end_src


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

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

HTH,

Chuck

  reply	other threads:[~2019-01-27 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-27 17:17 Easy templates broken with 9.2 Thomas S. Dye
2019-01-27 17:47 ` Berry, Charles [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-28  3:31 Thomas S. Dye
2019-01-27  5:17 Lawrence Bottorff

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=5A34FA2B-202E-456B-A8C7-4B6DEAE57338@ucsd.edu \
    --to=ccberry@ucsd.edu \
    --cc=borgauf@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsdye.com@gmail.com \
    /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).