emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Question mark not supported in structured templates?
@ 2019-10-29  7:57 Vladimir Nikishkin
  2019-10-29  8:23 ` Fraga, Eric
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Nikishkin @ 2019-10-29  7:57 UTC (permalink / raw)
  To: emacs-orgmode

Hello, everyone.

I recently updated to org 9.2 from org-melpa, and I have the following issue:

I use org with org-babel to write a book with many examples and illustrations.

I use ob-plantuml and ob-scheme in particular.
The problem is that for ob-plantuml I need the value of point be right
after the :file header parameter, because plantuml always requires a
file name.

For scheme, however, there is no need to write a file name, there are no files.

Is there no way to specify where to put the point in the new version of org?

-- 
Yours sincerely, Vladimir Nikishkin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question mark not supported in structured templates?
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Fraga, Eric @ 2019-10-29  8:23 UTC (permalink / raw)
  To: Vladimir Nikishkin; +Cc: emacs-orgmode@gnu.org

On Tuesday, 29 Oct 2019 at 15:57, Vladimir Nikishkin wrote:
> The problem is that for ob-plantuml I need the value of point be right
> after the :file header parameter, because plantuml always requires a
> file name.

I don't see this in my configuration.  But it could be that I do not
understand what you are saying.  Maybe explain a bit further and/or give
a small example?

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question mark not supported in structured templates?
  2019-10-29  8:23 ` Fraga, Eric
@ 2019-10-29  8:59   ` Vladimir Nikishkin
  2019-10-29 16:42     ` Berry, Charles
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Nikishkin @ 2019-10-29  8:59 UTC (permalink / raw)
  Cc: emacs-orgmode@gnu.org

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?

вт, 29 окт. 2019 г. в 16:23, Fraga, Eric <e.fraga@ucl.ac.uk>:
>
> On Tuesday, 29 Oct 2019 at 15:57, Vladimir Nikishkin wrote:
> > The problem is that for ob-plantuml I need the value of point be right
> > after the :file header parameter, because plantuml always requires a
> > file name.
>
> I don't see this in my configuration.  But it could be that I do not
> understand what you are saying.  Maybe explain a bit further and/or give
> a small example?
>
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78



-- 
Yours sincerely, Vladimir Nikishkin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question mark not supported in structured templates?
  2019-10-29  8:59   ` Vladimir Nikishkin
@ 2019-10-29 16:42     ` Berry, Charles
  2019-10-30  2:23       ` Vladimir Nikishkin
  0 siblings, 1 reply; 5+ messages in thread
From: Berry, Charles @ 2019-10-29 16:42 UTC (permalink / raw)
  To: Vladimir Nikishkin; +Cc: emacs-orgmode@gnu.org

`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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question mark not supported in structured templates?
  2019-10-29 16:42     ` Berry, Charles
@ 2019-10-30  2:23       ` Vladimir Nikishkin
  0 siblings, 0 replies; 5+ messages in thread
From: Vladimir Nikishkin @ 2019-10-30  2:23 UTC (permalink / raw)
  To: Berry, Charles; +Cc: emacs-orgmode@gnu.org

What is the canonical difference between org-insert-structure-template
and org-tempo then?

I think, emacs skeleton libraries (M-x info-display-manual RET
autotype RET) support placing the point (with a "_" marker)

ср, 30 окт. 2019 г. в 00:43, Berry, Charles <ccberry@ucsd.edu>:
>
> `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?
>
>


-- 
Yours sincerely, Vladimir Nikishkin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-30  2:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-10-30  2:23       ` Vladimir Nikishkin

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).