emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: Re: LaTeX-close-environment: org-close-template
Date: Tue, 8 Dec 2015 15:50:59 +0000	[thread overview]
Message-ID: <87oae1ey70.fsf@delle7240.chemeng.ucl.ac.uk> (raw)
In-Reply-To: <87si3dkz4h.fsf@mat.ucm.es> (Uwe Brauer's message of "Tue, 8 Dec 2015 10:34:22 +0000")

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

  reply	other threads:[~2015-12-08 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 10:34 LaTeX-close-environment: org-close-template Uwe Brauer
2015-12-08 15:50 ` Eric S Fraga [this message]
2015-12-08 17:04   ` Uwe Brauer
2015-12-09  8:09     ` Eric S Fraga
2015-12-09 20:33       ` Will O'Brien

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=87oae1ey70.fsf@delle7240.chemeng.ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /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).