It's easy to insert source code template in org 9.1 by

it is configured as

("s" "#+BEGIN_SRC ?\n#+END_SRC")

Of them, ? for cursor position,

unfortunately, it does not work in 9.2

Custormize org-structure-template-alist


("s" . "src ?\n")

it is dsplayed as:

#+begin_src ?\n

How could get the ? work properly as cursor position?

1 Answer 1


Template handling has changed in org 9.2:

*** Change in the structure template expansion

Org 9.2 comes with a new template expansion mechanism, combining org-insert-structure-template bound to C-c C-,.

If you customized the org-structure-template-alist option manually, you probably need to udpate it, see the docstring for accepted values.

If you prefer using previous patterns, e.g. <s, you can activate them again by requiring Org Tempo library:

: (require 'org-tempo)

or add it to org-modules.

If you need complex templates, look at the tempo-define-template function or at solutions like Yasnippet.

Unless you really need complex templates (and you most probably don't), the easiest thing to do is delete the customization to org-structure-template-alist from your init file. The default value should work the way you want. Alternatively, if you have customized this variable (rather than setting it in your init file), do C-hvorg-structure-template-alistRET, click on the customize link, click on Revert and from the drop-down menu, choose Erase customizations; then try <s again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.