[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] LaTeX-close-environment: org-close-template
From: |
Eric S Fraga |
Subject: |
Re: [O] LaTeX-close-environment: org-close-template |
Date: |
Tue, 8 Dec 2015 15:50:59 +0000 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (gnu/linux) |
On Tuesday, 8 Dec 2015 at 10:34, Uwe Brauer wrote:
> Hello
>
> Auctex has a nice function called LaTeX-close-environment, which works
> as follows: I have
>
> \begin{equation}
>
> ^(cursor)
>
> I run LaTeX-close-environment and obtain:
> \begin{equation}
>
> \end{equation}
>
> Now could I am looking for a similar functionality for say
>
> #+begin_comment
>
> ^(cursor)
>
> org--close-template and obtain:
>
> #+begin_comment
>
> #+end_comment
>
> Does anybody know about such a function?
I don't. However, I find that using the easy templates (e.g. <s to
insert a src block, <c to insert a centred block, ...), akin to
latex-insert-block, does the equivalent and better (in my opinion, of
course ;-). There isn't an entry for comment blocks but you can define
your own:
,----[ C-h v org-structure-template-alist RET ]
| org-structure-template-alist is a variable defined in `org.el'.
| Its value is shown below.
|
| Documentation:
| Structure completion elements.
| This is a list of abbreviation keys and values. The value gets inserted
| if you type `<' followed by the key and then press the completion key,
| usually `TAB'. %file will be replaced by a file name after prompting
| for the file using completion. The cursor will be placed at the position
| of the `?' in the template.
| There are two templates for each key, the first uses the original Org syntax,
| the second uses Emacs Muse-like syntax tags. These Muse-like tags become
| the default when the /org-mtags.el/ module has been loaded. See also the
| variable `org-mtags-prefer-muse-templates'.
|
| You can customize this variable.
|
| This variable was introduced, or its default value was changed, in
| version 25.1 of Emacs.
|
|
| Value: (("n" "#+BEGIN_NOTES\n?\n#+END_NOTES")
| ("a" "#+begin_ascii\n?\n#+end_ascii")
| ("A" "#+ascii: ")
| ("c" "#+begin_center\n?\n#+end_center" "<center>\n?\n</center>")
| ("e" "#+begin_example\n?\n#+end_example" "<example>\n?\n</example>")
| ("h" "#+begin_html\n?\n#+end_html" "<literal style=\"html\">\n?\n</literal>")
| ("H" "#+html: " "<literal style=\"html\">?</literal>")
| ("i" "#+index: ?" "#+index: ?")
| ("I" "#+include %file ?" "<include file=%file markup=\"?\">")
| ("l" "#+begin_latex\n?\n#+end_latex" "<literal
style=\"latex\">\n?\n</literal>")
| ("L" "#+latex: " "<literal style=\"latex\">?</literal>")
| ("q" "#+begin_quote\n?\n#+end_quote" "<quote>\n?\n</quote>")
| ("s" "#+begin_src ?\n\n#+end_src" "<src lang=\"?\">\n\n</src>")
| ("v" "#+begin_verse\n?\n#+end_verse" "<verse>\n?\n</verse>")
| ("w" "#+begin_whitebox\n?\n#+end_whitebox"))
|
| Original value was
| (("s" "#+BEGIN_SRC ?\n\n#+END_SRC")
| ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE")
| ("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE")
| ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE")
| ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM")
| ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER")
| ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX")
| ("L" "#+LaTeX: ")
| ("h" "#+BEGIN_HTML\n?\n#+END_HTML")
| ("H" "#+HTML: ")
| ("a" "#+BEGIN_ASCII\n?\n#+END_ASCII")
| ("A" "#+ASCII: ")
| ("i" "#+INDEX: ?")
| ("I" "#+INCLUDE: %file ?"))
`----
HTH,
eric
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.2-379-g38fd09