emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" <ccberry@ucsd.edu>
To: Vladimir Nikishkin <lockywolf@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Question mark not supported in structured templates?
Date: Tue, 29 Oct 2019 16:42:13 +0000	[thread overview]
Message-ID: <2AD69AC5-E6EE-4327-AE2B-07E377668822@ucsd.edu> (raw)
In-Reply-To: <CA+A2iZY=zLid3JjaoaGCVaKMzEfvS2whjzKV+Mgrdca6RC8uZQ@mail.gmail.com>

`org-tempo' is the replacement. It is mentioned in the docstring for `org-structure-template-alist'. 

Here is what I have in my `emacs-init.org' file:

(The letter `p' denotes where point should land. `n' is a newline. See the docstring for `tempo-define-template' for more details.)


#+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

HTH,

Chuck


> On Oct 29, 2019, at 1:59 AM, Vladimir Nikishkin <lockywolf@gmail.com> wrote:
> 
> In the version 8 of org-mode you could indicate where to put the point
> after the template is expanded. In the template
> (list "p" "#begin_src plantuml :file ? :export both \n#end_src"),
> after the template is expanded, the point would be located after
> :file, whereas in the template (list "SO" "#begin_src scheme :export
> both \n?\n#end_src") the point would be located on the frist line
> after the header.
> 
> At the moment, `org-insert-structure-template' just inserts the
> question mark verbatim. I would consider this a regression, but maybe
> there is some replacement mechanism?

  reply	other threads:[~2019-10-29 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  7:57 Question mark not supported in structured templates? Vladimir Nikishkin
2019-10-29  8:23 ` Fraga, Eric
2019-10-29  8:59   ` Vladimir Nikishkin
2019-10-29 16:42     ` Berry, Charles [this message]
2019-10-30  2:23       ` Vladimir Nikishkin

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=2AD69AC5-E6EE-4327-AE2B-07E377668822@ucsd.edu \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=lockywolf@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).