Automatic documentation update.

From 0.13.0
This commit is contained in:
Noam Postavsky 2018-05-13 13:12:57 -04:00
parent e793d06fb7
commit fcf89f2ece
8 changed files with 2422 additions and 1731 deletions

193
faq.html
View File

@ -3,21 +3,28 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Frequently Asked Questions</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Frequently Asked Questions</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
@ -44,27 +51,111 @@
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
@ -84,6 +175,7 @@
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="stylesheets/manual.css" />
@ -92,7 +184,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -141,14 +233,14 @@ for the JavaScript code in this tag.
<li> <a href="index.html">Overview</a>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a>
<li class="center">Snippet
<ul>
<li class="center border">Snippet
<ul class="nopad">
<li> <a href="snippet-organization.html">Organization</a>
<li> <a href="snippet-expansion.html">Expansion</a>
<li> <a href="snippet-development.html">Development</a>
<li> <a href="snippet-menu.html">Menu</a>
</ul>
<li> <a href="faq.html">FAQ</a>
<li> <span class='current'>FAQ</span>
<li> <a href="snippet-reference.html">Reference</a>
</ul>
</nav>
@ -159,18 +251,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Why is there an extra newline?</a></li>
<li><a href="#sec-2">Why doesn't TAB navigation work with flyspell</a></li>
<li><a href="#sec-3">How to I use alternative keys, i.e. not TAB?</a></li>
<li><a href="#sec-4">How do I turn off the minor mode where in some buffers?</a></li>
<li><a href="#sec-5">How do I define an abbrev key containing characters not supported by the filesystem?</a></li>
<li><a href="#org64f1b8c">Why is there an extra newline?</a></li>
<li><a href="#org3e0ab30">Why doesn't TAB navigation work with flyspell</a></li>
<li><a href="#org5f4a84d">How do I use alternative keys, i.e. not TAB?</a></li>
<li><a href="#orgf731e45">How do I turn off the minor mode where in some buffers?</a></li>
<li><a href="#org096bf1a">How do I define an abbrev key containing characters not supported by the filesystem?</a></li>
</ul>
</div>
</div>
<ul class="org-ul">
<li><b>Note</b>: In addition to the questions and answers presented here,
you might also with to visit the list of <a href="https://github.com/joaotavora/yasnippet/issues?q=label:support">solved support issues</a> in
the Github issue tracker. It might be more up-to-date than this
list.</li>
</ul>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">Why is there an extra newline?</h2>
<div class="outline-text-2" id="text-1">
<div id="outline-container-org64f1b8c" class="outline-2">
<h2 id="org64f1b8c">Why is there an extra newline?</h2>
<div class="outline-text-2" id="text-org64f1b8c">
<p>
If there is a newline at the end of a snippet definition file,
YASnippet will add a newline when expanding that snippet. When editing
@ -186,16 +284,15 @@ final newline automatically.
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">Why doesn't TAB navigation work with flyspell</h2>
<div class="outline-text-2" id="text-2">
<div id="outline-container-org3e0ab30" class="outline-2">
<h2 id="org3e0ab30">Why doesn't TAB navigation work with flyspell</h2>
<div class="outline-text-2" id="text-org3e0ab30">
<p>
A workaround is to inhibit flyspell overlays while the snippet is
active:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(add-hook 'flyspell-incorrect-hook
#'(lambda (dummy1 dummy2 dymmy3)
(<span class="org-keyword">and</span> yas-active-field-overlay
@ -214,16 +311,15 @@ solve this problem, drop a line in the
</div>
</div>
<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3">How to I use alternative keys, i.e. not TAB?</h2>
<div class="outline-text-2" id="text-3">
<div id="outline-container-org5f4a84d" class="outline-2">
<h2 id="org5f4a84d">How do I use alternative keys, i.e. not TAB?</h2>
<div class="outline-text-2" id="text-org5f4a84d">
<p>
Edit the keymaps <a href="snippet-reference.html#yas-minor-mode-map"><code>yas-minor-mode-map</code></a> and
<a href="snippet-reference.html#yas-keymap"><code>yas-keymap</code></a> as you would any other keymap:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(define-key yas-minor-mode-map (kbd <span class="org-string">"&lt;tab&gt;"</span>) nil)
(define-key yas-minor-mode-map (kbd <span class="org-string">"TAB"</span>) nil)
(define-key yas-minor-mode-map (kbd <span class="org-string">"&lt;the new key&gt;"</span>) yas-maybe-expand)
@ -240,16 +336,15 @@ Edit the keymaps <a href="snippet-reference.html#yas-minor-mode-map"><code>yas-m
</div>
</div>
<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4">How do I turn off the minor mode where in some buffers?</h2>
<div class="outline-text-2" id="text-4">
<div id="outline-container-orgf731e45" class="outline-2">
<h2 id="orgf731e45">How do I turn off the minor mode where in some buffers?</h2>
<div class="outline-text-2" id="text-orgf731e45">
<p>
The best way, since version 0.6.1c, is to set the default value of the
variable <a href="snippet-reference.html#yas-dont-activate"><code>yas-dont-activate</code></a> to a lambda function like so:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(set-default 'yas-dont-activate
#'(lambda ()
(<span class="org-keyword">and</span> yas-root-directory
@ -265,15 +360,14 @@ but only once you have setup your yas-root-directory.
</div>
</div>
<div id="outline-container-sec-5" class="outline-2">
<h2 id="sec-5">How do I define an abbrev key containing characters not supported by the filesystem?</h2>
<div class="outline-text-2" id="text-5">
<div id="outline-container-org096bf1a" class="outline-2">
<h2 id="org096bf1a">How do I define an abbrev key containing characters not supported by the filesystem?</h2>
<div class="outline-text-2" id="text-org096bf1a">
<ul class="org-ul">
<li><b>Note</b>: This question applies if you're still defining snippets
whose key <i>is</i> the filename. This is behavior still provided by
version 0.6 for backward compatibilty, but is somewhat
deprecated&#x2026;
</li>
deprecated&#x2026;</li>
</ul>
<p>
@ -290,7 +384,6 @@ directive:
</p>
<div class="org-src-container">
<pre class="src src-snippet"><span class="org-comment"># key: &lt;</span>
<span class="org-comment"># name: &lt;...&gt;&lt;/...&gt;</span>
<span class="org-comment"># --</span>
@ -301,7 +394,7 @@ directive:
</div>
</div>
<div id="postamble" class="status">
<hr><p class='creator'>Generated by <a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.2.50.5 (<a href="http://orgmode.org">Org</a> mode 8.2.10) from 0.12.2 (2017-08-29 02:08:58)</p>
<hr><p class='creator'>Generated by <a href="https://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="https://orgmode.org">Org</a> mode 9.1.9) from 0.13.0 (2018-05-13 16:12:51)</p>
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,21 +3,28 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Yet another snippet extension</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Yet another snippet extension</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
@ -44,27 +51,111 @@
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
@ -84,6 +175,7 @@
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="stylesheets/manual.css" />
@ -92,7 +184,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -138,11 +230,11 @@ for the JavaScript code in this tag.
<div id="preamble" class="status">
<nav>
<ul class="center">
<li> <a href="index.html">Overview</a>
<li> <span class='current'>Overview</span>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a>
<li class="center">Snippet
<ul>
<li class="center border">Snippet
<ul class="nopad">
<li> <a href="snippet-organization.html">Organization</a>
<li> <a href="snippet-expansion.html">Expansion</a>
<li> <a href="snippet-development.html">Development</a>
@ -160,22 +252,26 @@ The YASnippet documentation has been split into separate parts:
</p>
<ol class="org-ol">
<li><a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">README</a>
<li><p>
<a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">README</a>
</p>
<p>
Contains an introduction, installation instructions and other important
notes.
</p>
</li>
</p></li>
<li><a href="snippet-organization.html">Organizing Snippets</a>
<li><p>
<a href="snippet-organization.html">Organizing Snippets</a>
</p>
<p>
Describes ways to organize your snippets in the hard disk.
</p>
</li>
</p></li>
<li><a href="snippet-expansion.html">Expanding Snippets</a>
<li><p>
<a href="snippet-expansion.html">Expanding Snippets</a>
</p>
<p>
Describes how YASnippet chooses snippets for expansion at point.
@ -184,44 +280,47 @@ Describes how YASnippet chooses snippets for expansion at point.
<p>
Maybe, you'll want some snippets to be expanded in a particular mode,
or only under certain conditions, or be prompted using <code>ido</code>, etc&#x2026;
</p>
</li>
</p></li>
<li><a href="snippet-development.html">Writing Snippets</a>
<li><p>
<a href="snippet-development.html">Writing Snippets</a>
</p>
<p>
Describes the YASnippet definition syntax, which is very close (but
not equivalent) to Textmate's. Includes a section about converting
TextMate snippets.
</p>
</li>
</p></li>
<li><a href="snippet-menu.html">The YASnippet menu</a>
<li><p>
<a href="snippet-menu.html">The YASnippet menu</a>
</p>
<p>
Explains how to use the YASnippet menu to explore, learn and modify
snippets.
</p>
</li>
</p></li>
<li><a href="faq.html">Frequently asked questions</a>
<li><p>
<a href="faq.html">Frequently asked questions</a>
</p>
<p>
Answers to frequently asked questions.
</p>
</li>
</p></li>
<li><a href="snippet-reference.html">YASnippet Symbol Reference</a>
<li><p>
<a href="snippet-reference.html">YASnippet Symbol Reference</a>
</p>
<p>
An automatically generated listing of all YASnippet commands,
(customization) variables, and functions.
</p>
</li>
</p></li>
</ol>
</div>
<div id="postamble" class="status">
<hr><p class='creator'>Generated by <a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.2.50.5 (<a href="http://orgmode.org">Org</a> mode 8.2.10) from 0.12.2 (2017-08-29 02:08:58)</p>
<hr><p class='creator'>Generated by <a href="https://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="https://orgmode.org">Org</a> mode 9.1.9) from 0.13.0 (2018-05-13 16:12:51)</p>
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,21 +3,28 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Writing snippets</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Writing snippets</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
@ -44,27 +51,111 @@
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
@ -84,6 +175,7 @@
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="stylesheets/manual.css" />
@ -92,7 +184,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -141,11 +233,11 @@ for the JavaScript code in this tag.
<li> <a href="index.html">Overview</a>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a>
<li class="center">Snippet
<ul>
<li class="center border">Snippet
<ul class="nopad">
<li> <a href="snippet-organization.html">Organization</a>
<li> <a href="snippet-expansion.html">Expansion</a>
<li> <a href="snippet-development.html">Development</a>
<li> <span class='current'>Development</span>
<li> <a href="snippet-menu.html">Menu</a>
</ul>
<li> <a href="faq.html">FAQ</a>
@ -159,87 +251,90 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Snippet development</a>
<li><a href="#org6796ab7">Snippet development</a>
<ul>
<li><a href="#sec-1-1">Quickly finding snippets</a></li>
<li><a href="#sec-1-2">Using the <code>snippet-mode</code> major mode </a></li>
<li><a href="#orgd2c5216">Quickly finding snippets</a></li>
<li><a href="#org4406e2d">Using the <code>snippet-mode</code> major mode </a></li>
</ul>
</li>
<li><a href="#sec-2">File content</a>
<li><a href="#org5e87ae3">File content</a>
<ul>
<li><a href="#sec-2-1"><code># key:</code> snippet abbrev</a></li>
<li><a href="#sec-2-2"><code># name:</code> snippet name</a></li>
<li><a href="#sec-2-3"><code># condition:</code> snippet condition</a></li>
<li><a href="#sec-2-4"><code># group:</code> snippet menu grouping</a></li>
<li><a href="#sec-2-5"><code># expand-env:</code> expand environment</a></li>
<li><a href="#sec-2-6"><code># binding:</code> direct keybinding</a></li>
<li><a href="#sec-2-7"><code># type:</code> <code>snippet</code> or <code>command</code></a></li>
<li><a href="#sec-2-8"><code># uuid:</code> unique identifier</a></li>
<li><a href="#sec-2-9"><code># contributor:</code> snippet author</a></li>
<li><a href="#org9b062b6"><code># key:</code> snippet abbrev</a></li>
<li><a href="#org592456a"><code># name:</code> snippet name</a></li>
<li><a href="#org185b594"><code># condition:</code> snippet condition</a></li>
<li><a href="#orgd710184"><code># group:</code> snippet menu grouping</a></li>
<li><a href="#orga37203f"><code># expand-env:</code> expand environment</a></li>
<li><a href="#org67f4e69"><code># binding:</code> direct keybinding</a></li>
<li><a href="#org24f6fba"><code># type:</code> <code>snippet</code> or <code>command</code></a></li>
<li><a href="#orgd0516f9"><code># uuid:</code> unique identifier</a></li>
<li><a href="#orge2b38b9"><code># contributor:</code> snippet author</a></li>
</ul>
</li>
<li><a href="#sec-3">Template Syntax</a>
<li><a href="#org9801aa7">Template Syntax</a>
<ul>
<li><a href="#sec-3-1">Plain Text</a></li>
<li><a href="#sec-3-2">Embedded Emacs-lisp code</a>
<li><a href="#org0e7ccf8">Plain Text</a></li>
<li><a href="#orgcde188c">Embedded Emacs-lisp code</a>
<ul>
<li><a href="#sec-3-2-1">Note: backquote expressions should not modify the buffer</a></li>
<li><a href="#org9804f4c">Note: backquote expressions should not modify the buffer</a></li>
</ul>
</li>
<li><a href="#sec-3-3">Tab stop fields</a></li>
<li><a href="#sec-3-4">Placeholder fields</a></li>
<li><a href="#sec-3-5">Mirrors </a></li>
<li><a href="#sec-3-6">Mirrors with transformations </a></li>
<li><a href="#sec-3-7">Fields with transformations</a></li>
<li><a href="#sec-3-8">Choosing fields value from a list and other tricks</a></li>
<li><a href="#sec-3-9">Nested placeholder fields</a></li>
<li><a href="#sec-3-10">Indentation markers</a></li>
<li><a href="#org41a4ac7">Tab stop fields</a></li>
<li><a href="#org844d0b2">Placeholder fields</a></li>
<li><a href="#org087775c">Mirrors </a></li>
<li><a href="#orge2c1f71">Mirrors with transformations </a></li>
<li><a href="#org4efa067">Fields with transformations</a></li>
<li><a href="#org73e1209">Choosing fields value from a list and other tricks</a></li>
<li><a href="#orgca40be6">Nested placeholder fields</a></li>
<li><a href="#org92b7360">Indentation markers</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">Snippet development</h2>
<div class="outline-text-2" id="text-1">
</div><div id="outline-container-sec-1-1" class="outline-3">
<h3 id="sec-1-1">Quickly finding snippets</h3>
<div class="outline-text-3" id="text-1-1">
<div id="outline-container-org6796ab7" class="outline-2">
<h2 id="org6796ab7">Snippet development</h2>
<div class="outline-text-2" id="text-org6796ab7">
</div>
<div id="outline-container-orgd2c5216" class="outline-3">
<h3 id="orgd2c5216">Quickly finding snippets</h3>
<div class="outline-text-3" id="text-orgd2c5216">
<p>
There are some ways you can quickly find a snippet file or create a new one:
</p>
<ul class="org-ul">
<li><code>M-x yas-new-snippet</code>, key bindind: <code>C-c &amp; C-n</code>
<li><p>
<code>M-x yas-new-snippet</code>, key bindind: <code>C-c &amp; C-n</code>
</p>
<p>
Creates a new buffer with a template for making a new snippet. The
buffer is in <code>snippet-mode</code> (see <a href="#snippet-mode">below</a>). When you are done editing
the new snippet, use <a href="#yas-load-snippet-buffer-and-close"><code>C-c C-c</code></a> to save it.
</p>
</li>
buffer is in <code>snippet-mode</code> (see <a href="#orgb9ac10d">below</a>). When you are done editing
the new snippet, use <a href="#org7f07002"><code>C-c C-c</code></a> to save it.
</p></li>
<li><code>M-x yas-visit-snippet-file</code>, key binding: <code>C-c &amp; C-v</code>
<li><p>
<code>M-x yas-visit-snippet-file</code>, key binding: <code>C-c &amp; C-v</code>
</p>
<p>
Prompts you for possible snippet expansions like
<a href="snippet-reference.html#yas-insert-snippet"><code>yas-insert-snippet</code></a>, but instead of expanding it, takes you directly
to the snippet definition's file, if it exists.
</p>
</li>
</p></li>
</ul>
<p>
Once you find this file it will be set to <code>snippet-mode</code> (see <a href="#snippet-mode">ahead</a>)
Once you find this file it will be set to <code>snippet-mode</code> (see <a href="#orgb9ac10d">ahead</a>)
and you can start editing your snippet.
</p>
</div>
</div>
<div id="outline-container-sec-1-2" class="outline-3">
<h3 id="sec-1-2">Using the <code>snippet-mode</code> major mode <a id="snippet-mode" name="snippet-mode"></a></h3>
<div class="outline-text-3" id="text-1-2">
<div id="outline-container-org4406e2d" class="outline-3">
<h3 id="org4406e2d">Using the <code>snippet-mode</code> major mode <a id="orgb9ac10d"></a></h3>
<div class="outline-text-3" id="text-org4406e2d">
<p>
There is a major mode <code>snippet-mode</code> to edit snippets. You can set the
buffer to this mode with <code>M-x snippet-mode</code>. It provides reasonably
@ -251,16 +346,19 @@ Three commands are defined in this mode:
</p>
<ul class="org-ul">
<li><code>M-x yas-load-snippet-buffer</code>, key binding: <code>C-c C-l</code>
<li><p>
<code>M-x yas-load-snippet-buffer</code>, key binding: <code>C-c C-l</code>
</p>
<p>
Prompts for a snippet table (with a default based on snippet's
major mode) and loads the snippet currently being edited.
</p>
</li>
</p></li>
<li><code>M-x yas-load-snippet-buffer-and-close</code>, key binding: <code>C-c C-c</code>
<a id="yas-load-snippet-buffer-and-close" name="yas-load-snippet-buffer-and-close"></a>
<li><p>
<code>M-x yas-load-snippet-buffer-and-close</code>, key binding: <code>C-c C-c</code>
<a id="org7f07002"></a>
</p>
<p>
Like <code>yas-load-snippet-buffer</code>, but also saves the snippet and
@ -268,17 +366,17 @@ calls <code>quit-window</code>. The destination is decided based on the
chosen snippet table and snippet collection directly (defaulting to
the first directory in <code>yas-snippet-dirs</code> (see <a href="snippet-organization.html">Organizing Snippets</a>
for more detail on how snippets are organized).
</p>
</li>
</p></li>
<li><code>M-x yas-tryout-snippet</code>, key binding: <code>C-c C-t</code>
<li><p>
<code>M-x yas-tryout-snippet</code>, key binding: <code>C-c C-t</code>
</p>
<p>
When editing a snippet, this opens a new empty buffer, sets it to
the appropriate major mode and inserts the snippet there, so you
can see what it looks like.
</p>
</li>
</p></li>
</ul>
<p>
@ -289,9 +387,9 @@ There are also <i>snippets for writing snippets</i>: <code>vars</code>, <code>$f
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">File content</h2>
<div class="outline-text-2" id="text-2">
<div id="outline-container-org5e87ae3" class="outline-2">
<h2 id="org5e87ae3">File content</h2>
<div class="outline-text-2" id="text-org5e87ae3">
<p>
A file defining a snippet generally contains the template to be
expanded.
@ -310,7 +408,6 @@ Here's a typical example:
</p>
<div class="org-src-container">
<pre class="src src-snippet"><span class="org-comment"># contributor: pluskid <a href="mailto:pluskid%40gmail.com">&lt;pluskid@gmail.com&gt;</a></span>
<span class="org-comment"># name: __...__</span>
<span class="org-comment"># --</span>
@ -323,21 +420,21 @@ Here's a list of currently supported directives:
</p>
</div>
<div id="outline-container-sec-2-1" class="outline-3">
<h3 id="sec-2-1"><code># key:</code> snippet abbrev</h3>
<div class="outline-text-3" id="text-2-1">
<div id="outline-container-org9b062b6" class="outline-3">
<h3 id="org9b062b6"><code># key:</code> snippet abbrev</h3>
<div class="outline-text-3" id="text-org9b062b6">
<p>
This is the probably the most important directive, it's the
abbreviation you type to expand a snippet just before hitting the key
that runs <a href="snippet-reference.html#yas-expand"><code>yas-expand</code></a>. If you don't specify this
that runs <a href="snippet-reference.html#yas-expand"><code>yas-expand</code></a>. If you don't specify this,
the snippet will not be expandable through the trigger mechanism.
</p>
</div>
</div>
<div id="outline-container-sec-2-2" class="outline-3">
<h3 id="sec-2-2"><code># name:</code> snippet name</h3>
<div class="outline-text-3" id="text-2-2">
<div id="outline-container-org592456a" class="outline-3">
<h3 id="org592456a"><code># name:</code> snippet name</h3>
<div class="outline-text-3" id="text-org592456a">
<p>
This is a one-line description of the snippet. It will be displayed in
the menu. It's a good idea to select a descriptive name for a snippet &#x2013;
@ -345,15 +442,15 @@ especially distinguishable among similar snippets.
</p>
<p>
If you omit this name it will default to the file name the snippet was
loaded from.
If you omit this name, it will default to the file name the snippet
was loaded from.
</p>
</div>
</div>
<div id="outline-container-sec-2-3" class="outline-3">
<h3 id="sec-2-3"><code># condition:</code> snippet condition</h3>
<div class="outline-text-3" id="text-2-3">
<div id="outline-container-org185b594" class="outline-3">
<h3 id="org185b594"><code># condition:</code> snippet condition</h3>
<div class="outline-text-3" id="text-org185b594">
<p>
This is a piece of Emacs-lisp code. If a snippet has a condition, then
it will only be expanded when the condition code evaluate to some
@ -367,9 +464,9 @@ See also <a href="snippet-reference.html#yas-buffer-local-condition"><code>yas-b
</div>
</div>
<div id="outline-container-sec-2-4" class="outline-3">
<h3 id="sec-2-4"><code># group:</code> snippet menu grouping</h3>
<div class="outline-text-3" id="text-2-4">
<div id="outline-container-orgd710184" class="outline-3">
<h3 id="orgd710184"><code># group:</code> snippet menu grouping</h3>
<div class="outline-text-3" id="text-orgd710184">
<p>
When expanding/visiting snippets from the menu-bar menu, snippets for a
given mode can be grouped into sub-menus . This is useful if one has too
@ -393,9 +490,9 @@ group which is under the <code>control structure</code> group.
</div>
</div>
<div id="outline-container-sec-2-5" class="outline-3">
<h3 id="sec-2-5"><code># expand-env:</code> expand environment</h3>
<div class="outline-text-3" id="text-2-5">
<div id="outline-container-orga37203f" class="outline-3">
<h3 id="orga37203f"><code># expand-env:</code> expand environment</h3>
<div class="outline-text-3" id="text-orga37203f">
<p>
This is another piece of Emacs-lisp code in the form of a <code>let</code> <i>varlist
form</i>, i.e. a list of lists assigning values to variables. It can be
@ -415,7 +512,6 @@ You can then use:
</p>
<div class="org-src-container">
<pre class="src src-snippet"><span class="org-comment"># name: ASCII home</span>
<span class="org-comment"># expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))</span>
<span class="org-comment"># --</span>
@ -434,9 +530,9 @@ You can then use:
</div>
</div>
<div id="outline-container-sec-2-6" class="outline-3">
<h3 id="sec-2-6"><code># binding:</code> direct keybinding</h3>
<div class="outline-text-3" id="text-2-6">
<div id="outline-container-org67f4e69" class="outline-3">
<h3 id="org67f4e69"><code># binding:</code> direct keybinding</h3>
<div class="outline-text-3" id="text-org67f4e69">
<p>
You can use this directive to expand a snippet directly from a normal
Emacs keybinding. The keybinding will be registered in the Emacs keymap
@ -450,11 +546,10 @@ same snippet, for example in this "html-mode" snippet.
</p>
<div class="org-src-container">
<pre class="src src-snippet"><span class="org-comment"># name: &lt;p&gt;...&lt;/p&gt;</span>
<span class="org-comment"># binding: C-c C-c C-m</span>
<span class="org-comment"># --</span>
&lt;p&gt;`(<span class="org-keyword">when</span> yas-prefix "\n")`<span class="org-keyword">$</span><span class="org-string">0</span>`(<span class="org-keyword">when</span> yas-prefix "\n")`&lt;/p&gt;
&lt;p&gt;`(<span class="org-keyword">when</span> yas-prefix <span class="org-string">"\n"</span>)`<span class="org-keyword">$</span><span class="org-string">0</span>`(<span class="org-keyword">when</span> yas-prefix <span class="org-string">"\n"</span>)`&lt;/p&gt;
</pre>
</div>
@ -466,9 +561,9 @@ will expand the paragraph tag without newlines.
</div>
</div>
<div id="outline-container-sec-2-7" class="outline-3">
<h3 id="sec-2-7"><code># type:</code> <code>snippet</code> or <code>command</code></h3>
<div class="outline-text-3" id="text-2-7">
<div id="outline-container-org24f6fba" class="outline-3">
<h3 id="org24f6fba"><code># type:</code> <code>snippet</code> or <code>command</code></h3>
<div class="outline-text-3" id="text-org24f6fba">
<p>
If the <code>type</code> directive is set to <code>command</code>, the body of the snippet
is interpreted as lisp code to be evaluated when the snippet is
@ -477,15 +572,15 @@ triggered.
<p>
If it's <code>snippet</code> (the default when there is no <code>type</code> directive), the
snippet body will be parsed according to the <a href="#sec-3">Template Syntax</a>,
snippet body will be parsed according to the <a href="#org9801aa7">Template Syntax</a>,
described below.
</p>
</div>
</div>
<div id="outline-container-sec-2-8" class="outline-3">
<h3 id="sec-2-8"><code># uuid:</code> unique identifier</h3>
<div class="outline-text-3" id="text-2-8">
<div id="outline-container-orgd0516f9" class="outline-3">
<h3 id="orgd0516f9"><code># uuid:</code> unique identifier</h3>
<div class="outline-text-3" id="text-orgd0516f9">
<p>
This provides to a way to identify a snippet, independent of its name.
Loading a second snippet file with the same uuid would replace the
@ -494,9 +589,9 @@ previous snippet.
</div>
</div>
<div id="outline-container-sec-2-9" class="outline-3">
<h3 id="sec-2-9"><code># contributor:</code> snippet author</h3>
<div class="outline-text-3" id="text-2-9">
<div id="outline-container-orge2b38b9" class="outline-3">
<h3 id="orge2b38b9"><code># contributor:</code> snippet author</h3>
<div class="outline-text-3" id="text-orge2b38b9">
<p>
This is optional and has no effect whatsoever on snippet functionality,
but it looks nice.
@ -505,18 +600,18 @@ but it looks nice.
</div>
</div>
<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3">Template Syntax</h2>
<div class="outline-text-2" id="text-3">
<div id="outline-container-org9801aa7" class="outline-2">
<h2 id="org9801aa7">Template Syntax</h2>
<div class="outline-text-2" id="text-org9801aa7">
<p>
The syntax of the snippet template is simple but powerful, very similar
to TextMate's.
</p>
</div>
<div id="outline-container-sec-3-1" class="outline-3">
<h3 id="sec-3-1">Plain Text</h3>
<div class="outline-text-3" id="text-3-1">
<div id="outline-container-org0e7ccf8" class="outline-3">
<h3 id="org0e7ccf8">Plain Text</h3>
<div class="outline-text-3" id="text-org0e7ccf8">
<p>
Arbitrary text can be included as the content of a template. They are
usually interpreted as plain text, except <code>$</code> and <code>`</code>. You need to
@ -526,9 +621,9 @@ escaped as <code>\\</code> sometimes.
</div>
</div>
<div id="outline-container-sec-3-2" class="outline-3">
<h3 id="sec-3-2">Embedded Emacs-lisp code</h3>
<div class="outline-text-3" id="text-3-2">
<div id="outline-container-orgcde188c" class="outline-3">
<h3 id="orgcde188c">Embedded Emacs-lisp code</h3>
<div class="outline-text-3" id="text-orgcde188c">
<p>
Emacs-Lisp code can be embedded inside the template, written inside
back-quotes (<code>`</code>). The lisp forms are evaluated when the snippet is
@ -542,7 +637,6 @@ dynamically:
</p>
<div class="org-src-container">
<pre class="src src-snippet"><span class="org-comment">#ifndef ${</span><span class="org-warning">1</span><span class="org-comment">:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_}</span>
<span class="org-comment">#define $</span><span class="org-string">1</span>
@ -559,7 +653,6 @@ therefore define a snippet like:
</p>
<div class="org-src-container">
<pre class="src src-snippet">for (<span class="org-keyword">$</span><span class="org-string">1</span>;<span class="org-keyword">$</span><span class="org-string">2</span>;<span class="org-keyword">$</span><span class="org-string">3</span>) {
`yas-selected-text`<span class="org-keyword">$</span><span class="org-string">0</span>
<span class="org-keyword">}</span>
@ -573,9 +666,9 @@ Alternatively, you can also customize the variable
</p>
</div>
<div id="outline-container-sec-3-2-1" class="outline-4">
<h4 id="sec-3-2-1">Note: backquote expressions should not modify the buffer</h4>
<div class="outline-text-4" id="text-3-2-1">
<div id="outline-container-org9804f4c" class="outline-4">
<h4 id="org9804f4c">Note: backquote expressions should not modify the buffer</h4>
<div class="outline-text-4" id="text-org9804f4c">
<p>
Please note that the lisp forms in backquotes should <b>not</b> modify the
buffer, doing so will trigger a warning. For example, instead of
@ -583,7 +676,6 @@ doing
</p>
<div class="org-src-container">
<pre class="src src-snippet">Timestamp: `(insert (current-time-string))`
</pre>
</div>
@ -592,7 +684,6 @@ doing
do this:
</p>
<div class="org-src-container">
<pre class="src src-snippet">Timestamp: `(current-time-string)`
</pre>
</div>
@ -601,7 +692,6 @@ do this:
The warning may be suppressed with the following code in your init file:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(add-to-list 'warning-suppress-types '(yasnippet backquote-change))
</pre>
</div>
@ -610,9 +700,9 @@ The warning may be suppressed with the following code in your init file:
</div>
<div id="outline-container-sec-3-3" class="outline-3">
<h3 id="sec-3-3">Tab stop fields</h3>
<div class="outline-text-3" id="text-3-3">
<div id="outline-container-org41a4ac7" class="outline-3">
<h3 id="org41a4ac7">Tab stop fields</h3>
<div class="outline-text-3" id="text-org41a4ac7">
<p>
Tab stops are fields that you can navigate back and forth by <code>TAB</code> and
<code>S-TAB</code>. They are written by <code>$</code> followed with a number. <code>$0</code> has the
@ -621,7 +711,6 @@ to go when you've traveled all the fields. Here's a typical example:
</p>
<div class="org-src-container">
<pre class="src src-snippet">&lt;div<span class="org-keyword">$</span><span class="org-string">1</span>&gt;
<span class="org-keyword">$</span><span class="org-string">0</span>
&lt;/div&gt;
@ -629,40 +718,38 @@ to go when you've traveled all the fields. Here's a typical example:
</div>
</div>
</div>
<div id="outline-container-sec-3-4" class="outline-3">
<h3 id="sec-3-4">Placeholder fields</h3>
<div class="outline-text-3" id="text-3-4">
<div id="outline-container-org844d0b2" class="outline-3">
<h3 id="org844d0b2">Placeholder fields</h3>
<div class="outline-text-3" id="text-org844d0b2">
<p>
Tab stops can have default values &#x2013; a.k.a placeholders. The syntax is
like this:
</p>
<div class="org-src-container">
<pre class="src src-snippet">${N:default value<span class="org-keyword">}</span>
</pre>
</div>
<p>
They acts as the default value for a tab stop. But when you firstly
They act as the default value for a tab stop. But when you first
type at a tab stop, the default value will be replaced by your typing.
The number can be omitted if you don't want to create <a href="#mirrors-fields">mirrors</a> or
<a href="#mirror-transformations">transformations</a> for this field.
The number can be omitted if you don't want to create <a href="#orge0a8493">mirrors</a> or
<a href="#org6c77fba">transformations</a> for this field.
</p>
</div>
</div>
<div id="outline-container-sec-3-5" class="outline-3">
<h3 id="sec-3-5">Mirrors <a id="mirrors-fields" name="mirrors-fields"></a></h3>
<div class="outline-text-3" id="text-3-5">
<div id="outline-container-org087775c" class="outline-3">
<h3 id="org087775c">Mirrors <a id="orge0a8493"></a></h3>
<div class="outline-text-3" id="text-org087775c">
<p>
We refer the tab stops with placeholders as a <i>field</i>. A field can have
mirrors. Its mirrors will get updated when you change the text of a
field. Here's an example:
We refer the tab stops with placeholders as a <i>field</i>. A field can
have mirrors. <b>All</b> mirrors get updated whenever you update any field
text. Here's an example:
</p>
<div class="org-src-container">
<pre class="src src-snippet">\begin{<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span>enumerate<span class="org-keyword">}}</span>
<span class="org-keyword">$</span><span class="org-string">0</span>
\end{<span class="org-keyword">$</span><span class="org-string">1</span><span class="org-keyword">}</span>
@ -683,9 +770,9 @@ the field and others mirrors.
</div>
</div>
<div id="outline-container-sec-3-6" class="outline-3">
<h3 id="sec-3-6">Mirrors with transformations <a id="mirror-transformations" name="mirror-transformations"></a></h3>
<div class="outline-text-3" id="text-3-6">
<div id="outline-container-orge2c1f71" class="outline-3">
<h3 id="orge2c1f71">Mirrors with transformations <a id="org6c77fba"></a></h3>
<div class="outline-text-3" id="text-orge2c1f71">
<p>
If the value of an <code>${n:</code>-construct starts with and contains <code>$(</code>,
then it is interpreted as a mirror for field <code>n</code> with a
@ -697,7 +784,6 @@ Objective-C:
</p>
<div class="org-src-container">
<pre class="src src-snippet">- (<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span>id<span class="org-keyword">}</span>)<span class="org-keyword">${</span><span class="org-warning">2</span><span class="org-keyword">:</span>foo<span class="org-keyword">}</span>
{
return <span class="org-keyword">$</span><span class="org-string">2</span>;
@ -729,7 +815,6 @@ should be at least as long as the text. So
</p>
<div class="org-src-container">
<pre class="src src-rst"><span class="org-rst-adornment">=====</span>
<span class="org-rst-level-1">Title</span>
<span class="org-rst-adornment">=====</span>
@ -741,7 +826,6 @@ is a valid title but
</p>
<div class="org-src-container">
<pre class="src src-rst"><span class="org-rst-adornment">===</span>
<span class="org-rst-level-1">Title</span>
<span class="org-rst-adornment">===</span>
@ -753,7 +837,6 @@ is not. Here's an snippet for rst title:
</p>
<div class="org-src-container">
<pre class="src src-snippet"><span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span><span class="org-preprocessor">$(</span>make-string (string-width yas-text) ?\=)<span class="org-keyword">}</span>
<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span>Title<span class="org-keyword">}</span>
<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span><span class="org-preprocessor">$(</span>make-string (string-width yas-text) ?\=)<span class="org-keyword">}</span>
@ -761,17 +844,36 @@ is not. Here's an snippet for rst title:
<span class="org-keyword">$</span><span class="org-string">0</span>
</pre>
</div>
<p>
Note that a mirror with a transform is not restricted to the text of
the field it is mirroring. By making use of <a href="snippet-reference.html#yas-field-value"><code>yas-field-value</code></a>, a
mirror can look at any of the snippet's field (as mentioned above, all
mirrors are updated when any field is updated). Here is an example
which shows a "live" result of calling format:
</p>
<div class="org-src-container">
<pre class="src src-snippet">(format <span class="org-string">"${</span><span class="org-warning">1</span><span class="org-string">:formatted %s}"</span> <span class="org-string">"${</span><span class="org-warning">2</span><span class="org-string">:value}"</span>)
=&gt; <span class="org-string">"${</span><span class="org-warning">1</span><span class="org-string">:$(ignore-errors (format (yas-field-value 1) (yas-field-value 2)))}"</span>
</pre>
</div>
<p>
To keep the example simple, it uses <code>ignore-errors</code> to suppress errors
due to incomplete format codes.
</p>
</div>
</div>
<div id="outline-container-sec-3-7" class="outline-3">
<h3 id="sec-3-7">Fields with transformations</h3>
<div class="outline-text-3" id="text-3-7">
<div id="outline-container-org4efa067" class="outline-3">
<h3 id="org4efa067">Fields with transformations</h3>
<div class="outline-text-3" id="text-org4efa067">
<p>
From version 0.6 on, you can also have lisp transformation inside
fields. These work mostly mirror transformations but are evaluated when
you first enter the field, after each change you make to the field and
also just before you exit the field.
fields. These work mostly like mirror transformations. However, they
are evaluated when you first enter the field, after each change you
make to the field and also just before you exit the field.
</p>
<p>
@ -781,6 +883,7 @@ distinguish between fields and mirrors. In the following example
<pre class="example">
#define "${1:mydefine$(upcase yas-text)}"
</pre>
<p>
@ -798,6 +901,7 @@ transformation's <code>$</code>. If you don't want this extra-text, you can use
<pre class="example">
#define "${1:$$(upcase yas-text)}"
</pre>
<p>
@ -809,9 +913,9 @@ does not take place. This is by design.
</div>
</div>
<div id="outline-container-sec-3-8" class="outline-3">
<h3 id="sec-3-8">Choosing fields value from a list and other tricks</h3>
<div class="outline-text-3" id="text-3-8">
<div id="outline-container-org73e1209" class="outline-3">
<h3 id="org73e1209">Choosing fields value from a list and other tricks</h3>
<div class="outline-text-3" id="text-org73e1209">
<p>
As mentioned, the field transformation is invoked just after you enter
the field, and with some useful variables bound, notably
@ -825,8 +929,7 @@ The <a href="snippet-reference.html#yas-choose-value"><code>yas-choose-value</co
</p>
<div class="org-src-container">
<pre class="src src-snippet">&lt;div align="<span class="org-keyword">${</span><span class="org-warning">2</span><span class="org-keyword">:</span>$<span class="org-preprocessor">$(</span>yas-choose-value '("right" "center" "left"))<span class="org-keyword">}</span>"&gt;
<pre class="src src-snippet">&lt;div align=<span class="org-string">"${</span><span class="org-warning">2</span><span class="org-string">:$$(yas-choose-value '("</span>right<span class="org-string">" "</span>center<span class="org-string">" "</span>left<span class="org-string">"))}"</span>&gt;
<span class="org-keyword">$</span><span class="org-string">0</span>
&lt;/div&gt;
</pre>
@ -843,10 +946,9 @@ enter snippet field 2. This one makes use of <a href="snippet-reference.html#yas
</p>
<div class="org-src-container">
<pre class="src src-snippet">\section{<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span>"Titel der Tour"<span class="org-keyword">}}</span>%
<pre class="src src-snippet">\section{<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span><span class="org-string">"Titel der Tour"</span><span class="org-keyword">}}</span>%
\index{<span class="org-keyword">$</span><span class="org-string">1</span><span class="org-keyword">}</span>%
\label{{2:"waiting for reftex-label call..."<span class="org-preprocessor">$(</span><span class="org-keyword">unless</span> yas-modified-p (reftex-label nil 'dont-
\label{{2:<span class="org-string">"waiting for reftex-label call..."</span><span class="org-preprocessor">$(</span><span class="org-keyword">unless</span> yas-modified-p (reftex-label nil 'dont-
insert))<span class="org-keyword">}}</span>%
</pre>
</div>
@ -858,22 +960,21 @@ of <a href="snippet-reference.html#yas-moving-away-p"><code>yas-moving-away-p</c
</div>
</div>
<div id="outline-container-sec-3-9" class="outline-3">
<h3 id="sec-3-9">Nested placeholder fields</h3>
<div class="outline-text-3" id="text-3-9">
<div id="outline-container-orgca40be6" class="outline-3">
<h3 id="orgca40be6">Nested placeholder fields</h3>
<div class="outline-text-3" id="text-orgca40be6">
<p>
From version 0.6 on, you can also have nested placeholders of the type:
</p>
<div class="org-src-container">
<pre class="src src-snippet">&lt;div<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span> id="<span class="org-keyword">${</span><span class="org-warning">2</span><span class="org-keyword">:</span>some_id<span class="org-keyword">}</span>"<span class="org-keyword">}</span>&gt;<span class="org-keyword">$</span><span class="org-string">0</span>&lt;/div&gt;
<pre class="src src-snippet">&lt;div<span class="org-keyword">${</span><span class="org-warning">1</span><span class="org-keyword">:</span> id=<span class="org-string">"${</span><span class="org-warning">2</span><span class="org-string">:some_id}"</span><span class="org-keyword">}</span>&gt;<span class="org-keyword">$</span><span class="org-string">0</span>&lt;/div&gt;
</pre>
</div>
<p>
This allows you to choose if you want to give this <code>div</code> an <code>id</code>
attribute. If you tab forward after expanding it will let you change
attribute. If you tab forward after expanding, it will let you change
"some\<sub>id</sub>" to whatever you like. Alternatively, you can just press <code>C-d</code>
(which executes <a href="snippet-reference.html#yas-skip-and-clear-or-delete-char"><code>yas-skip-and-clear-or-delete-char</code></a>) and go straight to
the exit marker.
@ -887,9 +988,9 @@ performs the normal Emacs <code>delete-char</code> command.
</div>
</div>
<div id="outline-container-sec-3-10" class="outline-3">
<h3 id="sec-3-10">Indentation markers</h3>
<div class="outline-text-3" id="text-3-10">
<div id="outline-container-org92b7360" class="outline-3">
<h3 id="org92b7360">Indentation markers</h3>
<div class="outline-text-3" id="text-org92b7360">
<p>
If <a href="snippet-reference.html#yas-indent-line"><code>yas-indent-line</code></a> is <b>not</b> set to '<code>auto</code>, it's still possible to
indent specific lines by adding an indentation marker, <code>$&gt;</code>, somewhere
@ -900,7 +1001,7 @@ on the line.
</div>
</div>
<div id="postamble" class="status">
<hr><p class='creator'>Generated by <a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.2.50.5 (<a href="http://orgmode.org">Org</a> mode 8.2.10) from 0.12.2 (2017-08-29 02:08:58)</p>
<hr><p class='creator'>Generated by <a href="https://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="https://orgmode.org">Org</a> mode 9.1.9) from 0.13.0 (2018-05-13 16:12:51)</p>
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,21 +3,28 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Expanding snippets</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Expanding snippets</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
@ -44,27 +51,111 @@
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
@ -84,6 +175,7 @@
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="stylesheets/manual.css" />
@ -92,7 +184,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -141,10 +233,10 @@ for the JavaScript code in this tag.
<li> <a href="index.html">Overview</a>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a>
<li class="center">Snippet
<ul>
<li class="center border">Snippet
<ul class="nopad">
<li> <a href="snippet-organization.html">Organization</a>
<li> <a href="snippet-expansion.html">Expansion</a>
<li> <span class='current'>Expansion</span>
<li> <a href="snippet-development.html">Development</a>
<li> <a href="snippet-menu.html">Menu</a>
</ul>
@ -159,34 +251,34 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Triggering expansion</a>
<li><a href="#org12170ff">Triggering expansion</a>
<ul>
<li><a href="#sec-1-1">Trigger key</a>
<li><a href="#org87a6f68">Trigger key</a>
<ul>
<li><a href="#sec-1-1-1">Fallback behaviour</a></li>
<li><a href="#org161aff0">Fallback behaviour</a></li>
</ul>
</li>
<li><a href="#sec-1-2">Insert at point</a>
<li><a href="#org454e5fd">Insert at point</a>
<ul>
<li><a href="#sec-1-2-1">Inserting region or register contents into snippet</a></li>
<li><a href="#org05cd89a">Inserting region or register contents into snippet</a></li>
</ul>
</li>
<li><a href="#sec-1-3">Snippet keybinding</a></li>
<li><a href="#sec-1-4">Expanding from the menu</a></li>
<li><a href="#sec-1-5">Expanding with <code>hippie-expand</code></a></li>
<li><a href="#sec-1-6">Expanding from emacs-lisp code</a></li>
<li><a href="#orgc3c8799">Snippet keybinding</a></li>
<li><a href="#orgf5cd066">Expanding from the menu</a></li>
<li><a href="#orgaf084f4">Expanding with <code>hippie-expand</code></a></li>
<li><a href="#orgb8b9e8f">Expanding from emacs-lisp code</a></li>
</ul>
</li>
<li><a href="#sec-2">Controlling expansion</a>
<li><a href="#org61654fd">Controlling expansion</a>
<ul>
<li><a href="#sec-2-1">Eligible snippets</a></li>
<li><a href="#sec-2-2">The condition system </a></li>
<li><a href="#sec-2-3">Multiples snippet with the same key</a>
<li><a href="#orga555023">Eligible snippets</a></li>
<li><a href="#org075c5ff">The condition system </a></li>
<li><a href="#org2f6a9be">Multiples snippet with the same key</a>
<ul>
<li><a href="#sec-2-3-1">Use the X window system</a></li>
<li><a href="#sec-2-3-2">Minibuffer prompting</a></li>
<li><a href="#sec-2-3-3">Use <code>dropdown-menu.el</code></a></li>
<li><a href="#sec-2-3-4">Roll your own</a></li>
<li><a href="#org020d7e4">Use the X window system</a></li>
<li><a href="#org8c16a13">Minibuffer prompting</a></li>
<li><a href="#orgb151bf6">Use <code>dropdown-menu.el</code></a></li>
<li><a href="#orgda9ea36">Roll your own</a></li>
</ul>
</li>
</ul>
@ -203,9 +295,9 @@ Maybe, you'll want some snippets to be expanded in a particular
mode, or only under certain conditions, or be prompted using
</p>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">Triggering expansion</h2>
<div class="outline-text-2" id="text-1">
<div id="outline-container-org12170ff" class="outline-2">
<h2 id="org12170ff">Triggering expansion</h2>
<div class="outline-text-2" id="text-org12170ff">
<p>
You can use YASnippet to expand snippets in different ways:
</p>
@ -214,36 +306,28 @@ You can use YASnippet to expand snippets in different ways:
<li>When <a href="snippet-reference.html#yas-minor-mode"><code>yas-minor-mode</code></a> is active:
<ul class="org-ul">
<li>Type the snippet's <b>trigger key</b> then calling <a href="snippet-reference.html#yas-expand"><code>yas-expand</code></a>
(bound to <code>TAB</code> by default).
</li>
(bound to <code>TAB</code> by default).</li>
<li>Use the snippet's <b>keybinding</b>.
</li>
<li>Use the snippet's <b>keybinding</b>.</li>
<li>By expanding directly from the "YASnippet" menu in the menu-bar
</li>
<li>By expanding directly from the "YASnippet" menu in the menu-bar</li>
<li>Using hippie-expand
</li>
</ul>
</li>
<li>Using hippie-expand</li>
</ul></li>
<li>Call <a href="snippet-reference.html#yas-insert-snippet"><code>yas-insert-snippet</code></a> (use <code>M-x yas-insert-snippet=</code> or its
keybinding <code>C-c &amp; C-s</code>).
</li>
<li>Call <a href="snippet-reference.html#yas-insert-snippet"><code>yas-insert-snippet</code></a> (use <code>M-x yas-insert-snippet</code> or its
keybinding <code>C-c &amp; C-s</code>).</li>
<li>Use m2m's excellent auto-complete
TODO: example for this
</li>
TODO: example for this</li>
<li>Expanding from emacs-lisp code
</li>
<li>Expanding from emacs-lisp code</li>
</ul>
</div>
<div id="outline-container-sec-1-1" class="outline-3">
<h3 id="sec-1-1">Trigger key</h3>
<div class="outline-text-3" id="text-1-1">
<div id="outline-container-org87a6f68" class="outline-3">
<h3 id="org87a6f68">Trigger key</h3>
<div class="outline-text-3" id="text-org87a6f68">
<p>
<a href="snippet-reference.html#yas-expand"><code>yas-expand</code></a> tries to expand a <i>snippet abbrev</i> (also known as
<i>snippet key</i>) before point. YASnippet also provides a <i>conditional
@ -261,7 +345,6 @@ and <code>&lt;tab&gt;</code> by default, however, you can freely remove those bi
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(define-key yas-minor-mode-map (kbd <span class="org-string">"&lt;tab&gt;"</span>) nil)
(define-key yas-minor-mode-map (kbd <span class="org-string">"TAB"</span>) nil)
</pre>
@ -272,7 +355,6 @@ And set your own:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Bind `</span><span class="org-comment"><span class="org-constant">SPC</span></span><span class="org-comment">' to `</span><span class="org-comment"><span class="org-constant">yas-expand</span></span><span class="org-comment">' when snippet expansion available (it</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">will still call `</span><span class="org-comment"><span class="org-constant">self-insert-command</span></span><span class="org-comment">' otherwise).</span>
(define-key yas-minor-mode-map (kbd <span class="org-string">"SPC"</span>) yas-maybe-expand)
@ -301,9 +383,9 @@ argument in the buffer's mode hook.
</p>
</div>
<div id="outline-container-sec-1-1-1" class="outline-4">
<h4 id="sec-1-1-1">Fallback behaviour</h4>
<div class="outline-text-4" id="text-1-1-1">
<div id="outline-container-org161aff0" class="outline-4">
<h4 id="org161aff0">Fallback behaviour</h4>
<div class="outline-text-4" id="text-org161aff0">
<p>
YASnippet used to support a more complicated way of sharing
keybindings before <a href="snippet-reference.html#yas-expand"><code>yas-maybe-expand</code></a> was added. This is now
@ -313,11 +395,11 @@ obsolete.
</div>
</div>
<div id="outline-container-sec-1-2" class="outline-3">
<h3 id="sec-1-2">Insert at point</h3>
<div class="outline-text-3" id="text-1-2">
<div id="outline-container-org454e5fd" class="outline-3">
<h3 id="org454e5fd">Insert at point</h3>
<div class="outline-text-3" id="text-org454e5fd">
<p>
The command <i><code>yas-insert-snippet</code></i> lets you insert snippets at point
The command <a href="snippet-reference.html#yas-insert-snippet"><code>yas-insert-snippet</code></a> lets you insert snippets at point
<i>for your current major mode</i>. It prompts you for the snippet key
first, and then for a snippet template if more than one template
exists for the same key.
@ -335,14 +417,14 @@ The prompting methods used are again controlled by
</p>
</div>
<div id="outline-container-sec-1-2-1" class="outline-4">
<h4 id="sec-1-2-1">Inserting region or register contents into snippet</h4>
<div class="outline-text-4" id="text-1-2-1">
<div id="outline-container-org05cd89a" class="outline-4">
<h4 id="org05cd89a">Inserting region or register contents into snippet</h4>
<div class="outline-text-4" id="text-org05cd89a">
<p>
It's often useful to inject already written text in the middle of a
snippet. The variable <a href="snippet-reference.html#yas-wrap-around-region"><code>yas-wrap-around-region</code></a> when to t substitute
the region contents into the <code>$0</code> placeholder of a snippet expanded by
<i><code>yas-insert-snippet</code></i>. Setting it to a character value (e.g. <code>?0</code>)
<a href="snippet-reference.html#yas-insert-snippet"><code>yas-insert-snippet</code></a>. Setting it to a character value (e.g. <code>?0</code>)
will insert the contents of corresponding register.
</p>
@ -356,9 +438,9 @@ compatibility, but is now entirely equivalent to <code>?0</code>.
</div>
</div>
<div id="outline-container-sec-1-3" class="outline-3">
<h3 id="sec-1-3">Snippet keybinding</h3>
<div class="outline-text-3" id="text-1-3">
<div id="outline-container-orgc3c8799" class="outline-3">
<h3 id="orgc3c8799">Snippet keybinding</h3>
<div class="outline-text-3" id="text-orgc3c8799">
<p>
See the section of the <code># binding:</code> directive in
<a href="./snippet-development.html">Writing Snippets</a>.
@ -366,18 +448,18 @@ See the section of the <code># binding:</code> directive in
</div>
</div>
<div id="outline-container-sec-1-4" class="outline-3">
<h3 id="sec-1-4">Expanding from the menu</h3>
<div class="outline-text-3" id="text-1-4">
<div id="outline-container-orgf5cd066" class="outline-3">
<h3 id="orgf5cd066">Expanding from the menu</h3>
<div class="outline-text-3" id="text-orgf5cd066">
<p>
See <a href="./snippet-menu.html">the YASnippet Menu</a>.
</p>
</div>
</div>
<div id="outline-container-sec-1-5" class="outline-3">
<h3 id="sec-1-5">Expanding with <code>hippie-expand</code></h3>
<div class="outline-text-3" id="text-1-5">
<div id="outline-container-orgaf084f4" class="outline-3">
<h3 id="orgaf084f4">Expanding with <code>hippie-expand</code></h3>
<div class="outline-text-3" id="text-orgaf084f4">
<p>
To integrate with <code>hippie-expand</code>, just put
<a href="snippet-reference.html#yas-hippie-try-expand"><code>yas-hippie-try-expand</code></a> in
@ -388,9 +470,9 @@ prefer.
</div>
</div>
<div id="outline-container-sec-1-6" class="outline-3">
<h3 id="sec-1-6">Expanding from emacs-lisp code</h3>
<div class="outline-text-3" id="text-1-6">
<div id="outline-container-orgb8b9e8f" class="outline-3">
<h3 id="orgb8b9e8f">Expanding from emacs-lisp code</h3>
<div class="outline-text-3" id="text-orgb8b9e8f">
<p>
Sometimes you might want to expand a snippet directly from your own
elisp code. You should call <a href="snippet-reference.html#yas-expand-snippet"><code>yas-expand-snippet</code></a> instead of
@ -407,7 +489,6 @@ menu has the same effect of evaluating the follow code:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(yas-expand-snippet template)
</pre>
</div>
@ -420,12 +501,13 @@ See the internal documentation on <a href="snippet-reference.html#yas-expand-sni
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">Controlling expansion</h2>
<div class="outline-text-2" id="text-2">
</div><div id="outline-container-sec-2-1" class="outline-3">
<h3 id="sec-2-1">Eligible snippets</h3>
<div class="outline-text-3" id="text-2-1">
<div id="outline-container-org61654fd" class="outline-2">
<h2 id="org61654fd">Controlling expansion</h2>
<div class="outline-text-2" id="text-org61654fd">
</div>
<div id="outline-container-orga555023" class="outline-3">
<h3 id="orga555023">Eligible snippets</h3>
<div class="outline-text-3" id="text-orga555023">
<p>
YASnippet does quite a bit of filtering to find out which snippets are
eligible for expanding at the current cursor position.
@ -436,46 +518,49 @@ In particular, the following things matter:
</p>
<ul class="org-ul">
<li>Currently loaded snippets tables
<li><p>
Currently loaded snippets tables
</p>
<p>
These are loaded from a directory hierarchy in your file system. See
<a href="./snippet-organization.html">Organizing Snippets</a>. They are named
after major modes like <code>html-mode</code>, <code>ruby-mode</code>, etc&#x2026;
</p>
</li>
</p></li>
<li>Major mode of the current buffer
<li><p>
Major mode of the current buffer
</p>
<p>
If the currrent major mode matches one of the loaded snippet tables,
then all that table's snippets are considered for expansion. Use
<code>M-x describe-variable RET major-mode RET</code> to find out which major
mode you are in currently.
</p>
</li>
</p></li>
<li>Parent tables
<li><p>
Parent tables
</p>
<p>
Snippet tables defined as the parent of some other eligible table are
also considered. This works recursively, i.e. parents of parents of
eligible tables are also considered.
</p>
</li>
</p></li>
<li>Buffer-local list of extra modes
<li><p>
Buffer-local list of extra modes
</p>
<p>
Use <i><code>yas-activate-extra-mode</code></i> to
Use <a href="snippet-reference.html#yas-activate-extra-mode"><code>yas-activate-extra-mode</code></a> to
consider snippet tables whose name does not correspond to a major
mode. Typically, you call this from a minor mode hook, for example:
</p>
</li>
</p></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">When entering rinari-minor-mode, consider also the snippets in the</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">snippet table "rails-mode"</span>
(add-hook 'rinari-minor-mode-hook
@ -485,23 +570,24 @@ mode. Typically, you call this from a minor mode hook, for example:
</div>
<ul class="org-ul">
<li>Buffer-local <a href="snippet-reference.html#yas-buffer-local-condition"><code>yas-buffer-local-condition</code></a> variable
<li><p>
Buffer-local <a href="snippet-reference.html#yas-buffer-local-condition"><code>yas-buffer-local-condition</code></a> variable
</p>
<p>
This variable provides finer grained control over what snippets can
be expanded in the current buffer. For example, the constant
<a href="snippet-reference.html#yas-not-string-or-comment-condition"><code>yas-not-string-or-comment-condition</code></a> has a value that disables
snippet expansion inside comments or string literals. See <a href="#condition-system">the
snippet expansion inside comments or string literals. See <a href="#orgfd922ab">the
condition system</a> for more info.
</p>
</li>
</p></li>
</ul>
</div>
</div>
<div id="outline-container-sec-2-2" class="outline-3">
<h3 id="sec-2-2">The condition system <a id="condition-system" name="condition-system"></a></h3>
<div class="outline-text-3" id="text-2-2">
<div id="outline-container-org075c5ff" class="outline-3">
<h3 id="org075c5ff">The condition system <a id="orgfd922ab"></a></h3>
<div class="outline-text-3" id="text-org075c5ff">
<p>
Consider this scenario: you are an old Emacs hacker. You like the
abbrev-way and bind <a href="snippet-reference.html#yas-expand"><code>yas-expand</code></a> to <code>SPC</code>. However, you don't want
@ -524,7 +610,6 @@ inside a comment? Set <a href="snippet-reference.html#yas-buffer-local-conditio
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(add-hook 'python-mode-hook
(<span class="org-keyword">lambda</span> ()
(<span class="org-keyword">setq</span> yas-buffer-local-condition
@ -548,11 +633,11 @@ For the full set of possible conditions, see the documentation for
</div>
</div>
<div id="outline-container-sec-2-3" class="outline-3">
<h3 id="sec-2-3">Multiples snippet with the same key</h3>
<div class="outline-text-3" id="text-2-3">
<div id="outline-container-org2f6a9be" class="outline-3">
<h3 id="org2f6a9be">Multiples snippet with the same key</h3>
<div class="outline-text-3" id="text-org2f6a9be">
<p>
The rules outlined <i>above</i> can return more than
The rules outlined <a href="#orga555023">above</a> can return more than
one snippet to be expanded at point.
</p>
@ -570,7 +655,6 @@ can put in your emacs-file:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">setq</span> yas-prompt-functions '(yas-x-prompt yas-dropdown-prompt))
</pre>
</div>
@ -580,9 +664,9 @@ Currently there are some alternatives solution with YASnippet.
</p>
</div>
<div id="outline-container-sec-2-3-1" class="outline-4">
<h4 id="sec-2-3-1">Use the X window system</h4>
<div class="outline-text-4" id="text-2-3-1">
<div id="outline-container-org020d7e4" class="outline-4">
<h4 id="org020d7e4">Use the X window system</h4>
<div class="outline-text-4" id="text-org020d7e4">
<div class="figure">
<p><img src="./images/x-menu.png" alt="x-menu.png" />
@ -597,20 +681,17 @@ means:
<ul class="org-ul">
<li>It usually looks beautiful. E.g. when you compile Emacs with gtk
support, this menu will be rendered with your gtk theme.
</li>
support, this menu will be rendered with your gtk theme.</li>
<li>Your window system may or may not allow to you use <code>C-n</code>, <code>C-p</code> to
navigate this menu.
</li>
<li>This function can't be used when in a terminal.
</li>
navigate this menu.</li>
<li>This function can't be used when in a terminal.</li>
</ul>
</div>
</div>
<div id="outline-container-sec-2-3-2" class="outline-4">
<h4 id="sec-2-3-2">Minibuffer prompting</h4>
<div class="outline-text-4" id="text-2-3-2">
<div id="outline-container-org8c16a13" class="outline-4">
<h4 id="org8c16a13">Minibuffer prompting</h4>
<div class="outline-text-4" id="text-org8c16a13">
<div class="figure">
<p><img src="./images/ido-menu.png" alt="ido-menu.png" />
@ -625,9 +706,9 @@ The best way is to try it. This works in a terminal.
</div>
</div>
<div id="outline-container-sec-2-3-3" class="outline-4">
<h4 id="sec-2-3-3">Use <code>dropdown-menu.el</code></h4>
<div class="outline-text-4" id="text-2-3-3">
<div id="outline-container-orgb151bf6" class="outline-4">
<h4 id="orgb151bf6">Use <code>dropdown-menu.el</code></h4>
<div class="outline-text-4" id="text-orgb151bf6">
<div class="figure">
<p><img src="./images/dropdown-menu.png" alt="dropdown-menu.png" />
@ -647,9 +728,9 @@ shortcut to select the 6th candidate.
</div>
</div>
<div id="outline-container-sec-2-3-4" class="outline-4">
<h4 id="sec-2-3-4">Roll your own</h4>
<div class="outline-text-4" id="text-2-3-4">
<div id="outline-container-orgda9ea36" class="outline-4">
<h4 id="orgda9ea36">Roll your own</h4>
<div class="outline-text-4" id="text-orgda9ea36">
<p>
See the documentation on variable <a href="snippet-reference.html#yas-prompt-functions"><code>yas-prompt-functions</code></a>
</p>
@ -659,7 +740,7 @@ See the documentation on variable <a href="snippet-reference.html#yas-prompt-fun
</div>
</div>
<div id="postamble" class="status">
<hr><p class='creator'>Generated by <a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.2.50.5 (<a href="http://orgmode.org">Org</a> mode 8.2.10) from 0.12.2 (2017-08-29 02:08:58)</p>
<hr><p class='creator'>Generated by <a href="https://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="https://orgmode.org">Org</a> mode 9.1.9) from 0.13.0 (2018-05-13 16:12:51)</p>
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,21 +3,28 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>YASnippet menu</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>YASnippet menu</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
@ -44,27 +51,111 @@
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
@ -84,6 +175,7 @@
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="stylesheets/manual.css" />
@ -92,7 +184,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -141,12 +233,12 @@ for the JavaScript code in this tag.
<li> <a href="index.html">Overview</a>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a>
<li class="center">Snippet
<ul>
<li class="center border">Snippet
<ul class="nopad">
<li> <a href="snippet-organization.html">Organization</a>
<li> <a href="snippet-expansion.html">Expansion</a>
<li> <a href="snippet-development.html">Development</a>
<li> <a href="snippet-menu.html">Menu</a>
<li> <span class='current'>Menu</span>
</ul>
<li> <a href="faq.html">FAQ</a>
<li> <a href="snippet-reference.html">Reference</a>
@ -159,11 +251,11 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Loading snippets from menu</a></li>
<li><a href="#sec-2">Snippet menu behavior</a></li>
<li><a href="#sec-3">Controlling indenting</a></li>
<li><a href="#sec-4">Prompting method</a></li>
<li><a href="#sec-5">Misc</a></li>
<li><a href="#org6005667">Loading snippets from menu</a></li>
<li><a href="#orgc3fcfa2">Snippet menu behavior</a></li>
<li><a href="#org047b0f9">Controlling indenting</a></li>
<li><a href="#orgd55cb43">Prompting method</a></li>
<li><a href="#orgb8689fa">Misc</a></li>
</ul>
</div>
</div>
@ -178,17 +270,14 @@ In this menu, you can find
<ul class="org-ul">
<li>The currently loaded snippet definitions, organized by major mode,
and optional grouping.
</li>
and optional grouping.</li>
<li>A rundown of the most common commands, (followed by their
keybindings) including commands to load directories and reload all
snippet definitions.
</li>
snippet definitions.</li>
<li>A series of submenus for customizing and exploring YASnippet
behavior.
</li>
behavior.</li>
</ul>
@ -197,25 +286,25 @@ behavior.
</p>
</div>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">Loading snippets from menu</h2>
<div class="outline-text-2" id="text-1">
<div id="outline-container-org6005667" class="outline-2">
<h2 id="org6005667">Loading snippets from menu</h2>
<div class="outline-text-2" id="text-org6005667">
<p>
Invoking "Load snippets&#x2026;" from the menu invokes <a href="snippet-reference.html#yas-load-directory"><code>yas-load-directory</code></a>
and prompts you for a snippet directory hierarchy to load.
</p>
<p>
Also useful is the "Reload everything" item to invoke <i><code>yas-reload-all</code></i>
Also useful is the "Reload everything" item to invoke <a href="snippet-reference.html#yas-reload-all"><code>yas-reload-all</code></a>
which uncondionally reloads all the snippets directories defined in
<a href="snippet-reference.html#yas-snippet-dirs"><code>yas-snippet-dirs</code></a> and rebuilds the menus.
</p>
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">Snippet menu behavior</h2>
<div class="outline-text-2" id="text-2">
<div id="outline-container-orgc3fcfa2" class="outline-2">
<h2 id="orgc3fcfa2">Snippet menu behavior</h2>
<div class="outline-text-2" id="text-orgc3fcfa2">
<p>
YASnippet will list in this section all the loaded snippet definitions
organized by snippet table name.
@ -251,9 +340,9 @@ These customizations can also be found in the menu itself, under the
</div>
</div>
<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3">Controlling indenting</h2>
<div class="outline-text-2" id="text-3">
<div id="outline-container-org047b0f9" class="outline-2">
<h2 id="org047b0f9">Controlling indenting</h2>
<div class="outline-text-2" id="text-org047b0f9">
<p>
The "Indenting" submenu contains options to control the values of
<a href="snippet-reference.html#yas-indent-line"><code>yas-indent-line</code></a> and <a href="snippet-reference.html#yas-also-auto-indent-first-line"><code>yas-also-auto-indent-first-line</code></a>. See
@ -262,9 +351,9 @@ The "Indenting" submenu contains options to control the values of
</div>
</div>
<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4">Prompting method</h2>
<div class="outline-text-2" id="text-4">
<div id="outline-container-orgd55cb43" class="outline-2">
<h2 id="orgd55cb43">Prompting method</h2>
<div class="outline-text-2" id="text-orgd55cb43">
<p>
The "Prompting method" submenu contains options to control the value of
<a href="snippet-reference.html#yas-prompt-functions"><code>yas-prompt-functions</code></a>. See <a href="./snippet-expansion.html">Expanding snippets</a>.
@ -272,9 +361,9 @@ The "Prompting method" submenu contains options to control the value of
</div>
</div>
<div id="outline-container-sec-5" class="outline-2">
<h2 id="sec-5">Misc</h2>
<div class="outline-text-2" id="text-5">
<div id="outline-container-orgb8689fa" class="outline-2">
<h2 id="orgb8689fa">Misc</h2>
<div class="outline-text-2" id="text-orgb8689fa">
<p>
The "Misc" submenu contains options to control the values of more
variables.
@ -283,7 +372,7 @@ variables.
</div>
</div>
<div id="postamble" class="status">
<hr><p class='creator'>Generated by <a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.2.50.5 (<a href="http://orgmode.org">Org</a> mode 8.2.10) from 0.12.2 (2017-08-29 02:08:58)</p>
<hr><p class='creator'>Generated by <a href="https://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="https://orgmode.org">Org</a> mode 9.1.9) from 0.13.0 (2018-05-13 16:12:51)</p>
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,21 +3,28 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Organizing snippets</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Organizing snippets</title>
<meta name="generator" content="Org mode" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
@ -44,27 +51,111 @@
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
@ -84,6 +175,7 @@
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css" href="stylesheets/manual.css" />
@ -92,7 +184,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
Copyright (C) 2012-2018 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -141,9 +233,9 @@ for the JavaScript code in this tag.
<li> <a href="index.html">Overview</a>
<li> <a href="https://github.com/joaotavora/yasnippet/blob/master/README.mdown">
Intro and Tutorial</a>
<li class="center">Snippet
<ul>
<li> <a href="snippet-organization.html">Organization</a>
<li class="center border">Snippet
<ul class="nopad">
<li> <span class='current'>Organization</span>
<li> <a href="snippet-expansion.html">Expansion</a>
<li> <a href="snippet-development.html">Development</a>
<li> <a href="snippet-menu.html">Menu</a>
@ -159,23 +251,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">Basic structure</a></li>
<li><a href="#sec-2">Setting up <code>yas-snippet-dirs</code></a></li>
<li><a href="#sec-3">The <code>.yas-parents</code> file</a></li>
<li><a href="#sec-4"><span class="todo TODO">TODO</span> The <code>.yas-make-groups</code> file</a></li>
<li><a href="#sec-5">The <code>.yas-setup.el</code> file</a></li>
<li><a href="#sec-6">The <code>.yas-compiled-snippet.el</code> file</a></li>
<li><a href="#sec-7">The <code>.yas-skip</code> file</a></li>
<li><a href="#org91b0471">Basic structure</a></li>
<li><a href="#org10ee311">Setting up <code>yas-snippet-dirs</code></a></li>
<li><a href="#org7468fa9">The <code>.yas-parents</code> file</a></li>
<li><a href="#orgac3b0a5"><span class="todo TODO">TODO</span> The <code>.yas-make-groups</code> file</a></li>
<li><a href="#orge57abf6">The <code>.yas-setup.el</code> file</a></li>
<li><a href="#org40a5619">The <code>.yas-compiled-snippet.el</code> file</a></li>
<li><a href="#org2f7147a">The <code>.yas-skip</code> file</a></li>
</ul>
</div>
</div>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">Basic structure</h2>
<div class="outline-text-2" id="text-1">
<div id="outline-container-org91b0471" class="outline-2">
<h2 id="org91b0471">Basic structure</h2>
<div class="outline-text-2" id="text-org91b0471">
<p>
Snippet collections can be stored in plain text files. They are arranged by
sub-directories naming <b>snippet tables</b>. These mostly name Emacs major names.
Snippet collections can be stored in plain text files. They are
arranged by sub-directories naming <b>snippet tables</b>. These mostly
name Emacs major mode names.
</p>
<pre class="example">
@ -197,9 +290,9 @@ triggering mechanism (see <a href="snippet-expansion.html">Expanding Snippets</a
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">Setting up <code>yas-snippet-dirs</code></h2>
<div class="outline-text-2" id="text-2">
<div id="outline-container-org10ee311" class="outline-2">
<h2 id="org10ee311">Setting up <code>yas-snippet-dirs</code></h2>
<div class="outline-text-2" id="text-org10ee311">
<p>
The emacs variable <a href="snippet-reference.html#yas-snippet-dirs"><code>yas-snippet-dirs</code></a> tells YASnippet
which collections to consider. It's used when you activate
@ -212,10 +305,8 @@ The default considers:
</p>
<ul class="org-ul">
<li>a personal collection that lives in <code>~/.emacs.d/snippets</code>
</li>
<li>the bundled collection, taken as a relative path to <code>yasnippet.el</code> localtion
</li>
<li>a personal collection that lives in <code>~/.emacs.d/snippets</code></li>
<li>the bundled collection, taken as a relative path to <code>yasnippet.el</code> localtion</li>
</ul>
<p>
@ -224,7 +315,6 @@ out:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Develop in ~/emacs.d/mysnippets, but also</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">try out snippets in ~/Downloads/interesting-snippets</span>
(<span class="org-keyword">setq</span> yas-snippet-dirs '(<span class="org-string">"~/emacs.d/mysnippets"</span>
@ -244,9 +334,9 @@ snippets in the first collection.
</div>
</div>
<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3">The <code>.yas-parents</code> file</h2>
<div class="outline-text-2" id="text-3">
<div id="outline-container-org7468fa9" class="outline-2">
<h2 id="org7468fa9">The <code>.yas-parents</code> file</h2>
<div class="outline-text-2" id="text-org7468fa9">
<p>
It's very useful to have certain modes share snippets between
themselves. To do this, choose a mode subdirectory and place a
@ -274,13 +364,13 @@ mode.
</div>
<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4"><span class="todo TODO">TODO</span> The <code>.yas-make-groups</code> file</h2>
<div class="outline-text-2" id="text-4">
<div id="outline-container-orgac3b0a5" class="outline-2">
<h2 id="orgac3b0a5"><span class="todo TODO">TODO</span> The <code>.yas-make-groups</code> file</h2>
<div class="outline-text-2" id="text-orgac3b0a5">
<p>
If you place an empty plain text file <code>.yas-make-groups</code> inside one
of the mode directories, the names of these sub-directories are
considered groups of snippets and <i>the menu</i> is organized much more
considered groups of snippets and <a href="snippet-menu.html">the menu</a> is organized much more
cleanly:
</p>
@ -318,9 +408,9 @@ Yet another way to create a nice snippet menu is to write into
</div>
</div>
<div id="outline-container-sec-5" class="outline-2">
<h2 id="sec-5">The <code>.yas-setup.el</code> file</h2>
<div class="outline-text-2" id="text-5">
<div id="outline-container-orge57abf6" class="outline-2">
<h2 id="orge57abf6">The <code>.yas-setup.el</code> file</h2>
<div class="outline-text-2" id="text-orge57abf6">
<p>
If there is file named <code>.yas-setup.el</code> in a mode's snippet
subdirectory, it is loaded along with the snippets. Utility
@ -329,9 +419,9 @@ functions used by the snippets can be put here.
</div>
</div>
<div id="outline-container-sec-6" class="outline-2">
<h2 id="sec-6">The <code>.yas-compiled-snippet.el</code> file</h2>
<div class="outline-text-2" id="text-6">
<div id="outline-container-org40a5619" class="outline-2">
<h2 id="org40a5619">The <code>.yas-compiled-snippet.el</code> file</h2>
<div class="outline-text-2" id="text-org40a5619">
<p>
You may compile a top-level snippet directory with the
<code>yas-compile-directory</code> function, which will create a
@ -347,9 +437,9 @@ Alternatively, you may compile all directories in the list
</div>
</div>
<div id="outline-container-sec-7" class="outline-2">
<h2 id="sec-7">The <code>.yas-skip</code> file</h2>
<div class="outline-text-2" id="text-7">
<div id="outline-container-org2f7147a" class="outline-2">
<h2 id="org2f7147a">The <code>.yas-skip</code> file</h2>
<div class="outline-text-2" id="text-org2f7147a">
<p>
A <code>.yas-skip</code> file in a mode's snippet subdirectory tells YASnippet
not to load snippets from there.
@ -358,7 +448,7 @@ not to load snippets from there.
</div>
</div>
<div id="postamble" class="status">
<hr><p class='creator'>Generated by <a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.2.50.5 (<a href="http://orgmode.org">Org</a> mode 8.2.10) from 0.12.2 (2017-08-29 02:08:58)</p>
<hr><p class='creator'>Generated by <a href="https://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="https://orgmode.org">Org</a> mode 9.1.9) from 0.13.0 (2018-05-13 16:12:51)</p>
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,14 @@
nav > ul > li.center > ul {
padding: 0;
.center { margin-left: auto; margin-right: auto; text-align: center; }
.current {
font-weight: bold;
background-color: #E0E8F0;
}
body { background-color: #E4F0F4 }
div#content {
max-width: 20cm;
margin-left: auto;
margin-right: auto;
}
nav li {
@ -9,20 +18,22 @@ nav li {
list-style-type: none;
padding: 0.5em;
}
nav > ul > li {
display: inline-block;
}
/* match org's css for <pre> */
code {
background-color: #F3F5F7;
font-family: courier, monospace;
.nopad {
padding: 0;
}
li.border {
border: solid;
border-width: 1px;
}
#content {
margin-left: 5%;
margin-right: 10%;
pre, code{ background-color: #F3F5F7; }
code {
/* http://neugierig.org/software/chromium/notes/2009/09/monospace-fonts-workaround.html */
font-family: WorkAroundWebKitAndMozilla, monospace;
white-space: nowrap;
}
/* Styles for htmlize.el fontification. */