Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > b50d8ee6d7871fcc13c0677a9364ed59 > files > 523

bcfg2-doc-1.3.0-1.fc17.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Emacs + YASnippet mode &mdash; Bcfg2 1.3.0 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.3.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
    <link rel="top" title="Bcfg2 1.3.0 documentation" href="../index.html" />
    <link rel="up" title="Unsorted Docs" href="index.html" />
    <link rel="next" title="HOWTOs" href="howtos.html" />
    <link rel="prev" title="Dynamic Groups" href="dynamic_groups.html" />
 
<link rel="stylesheet" href="../_static/bcfg2.css" type=""/>

  </head>
  <body>

<div style="text-align: left; padding: 10px 10px 15px 15px">
<a href="../index.html"><img src="../_static/bcfg2_logo.png" border="0" alt="sampledoc"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="howtos.html" title="HOWTOs"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="dynamic_groups.html" title="Dynamic Groups"
             accesskey="P">previous</a> |</li>
	<li><a href="../index.html">home</a> |&nbsp;</li>
	<!--<li><a href="../search.html">search</a> |&nbsp;</li>-->
	<li><a href="../help/index.html">help</a> |&nbsp;</li>
	<li><a href="../contents.html">documentation </a> &raquo;</li>

          <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">Unsorted Docs</a> &raquo;</li> 
      </ul>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="emacs-yasnippet-mode">
<span id="unsorted-emacs-snippet"></span><h1>Emacs + YASnippet mode<a class="headerlink" href="#emacs-yasnippet-mode" title="Permalink to this headline">ΒΆ</a></h1>
<p>This page describes using emacs with YASnippet mode with a set of
snippets that allow quick composition of bundles and base files.
More snippets are under development.</p>
<ol class="arabic">
<li><p class="first">Download YASnippet from <a class="reference external" href="http://code.google.com/p/yasnippet/">http://code.google.com/p/yasnippet/</a></p>
</li>
<li><p class="first">Install it into your emacs load path (typically ~/.emacs.d/site-lisp)</p>
</li>
<li><p class="first">Add YASnippet initialization to your .emacs (remember to re-byte-compile it if needed)</p>
<div class="highlight-cl"><div class="highlight"><pre><span class="p">(</span><span class="nb">require</span> <span class="ss">&#39;yasnippet-bundle</span><span class="p">)</span>

<span class="c1">;;; Bcfg2 snippet</span>

<span class="p">(</span><span class="nv">yas/define-snippets</span> <span class="ss">&#39;sgml-mode</span>
<span class="o">&#39;</span><span class="p">(</span>
  <span class="p">(</span><span class="s">&quot;&lt;Bundle&quot;</span> <span class="s">&quot;&lt;Bundle name=&#39;${1:bundlename}&#39; version=&#39;2.0&#39;&gt;</span>
<span class="s">   $0</span>
<span class="s">&lt;/Bundle&gt;&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Base&quot;</span> <span class="s">&quot;&lt;Base&gt;</span>
<span class="s">   $0</span>
<span class="s">&lt;/Base&gt;&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Group&quot;</span> <span class="s">&quot;&lt;Group name=&#39;${1:groupname}&gt;</span>
<span class="s">   $0</span>
<span class="s">&lt;/Group&gt;&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Config&quot;</span> <span class="s">&quot;&lt;ConfigFile name=&#39;${1:filename}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Service&quot;</span> <span class="s">&quot;&lt;Service name=&#39;${1:svcname}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Package&quot;</span> <span class="s">&quot;&lt;Package name=&#39;${1:packagename}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Action&quot;</span> <span class="s">&quot;&lt;Action name=&#39;${1:name}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Directory&quot;</span> <span class="s">&quot;&lt;Directory name=&#39;${1:name}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;SymLink&quot;</span> <span class="s">&quot;&lt;SymLink name=&#39;${1:name}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="s">&quot;&lt;Permissions&quot;</span> <span class="s">&quot;&lt;Permissions name=&#39;${1:name}&#39;/&gt;</span>
<span class="s">$0&quot;</span> <span class="no">nil</span><span class="p">)</span>
<span class="p">)</span>
<span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">One quick M-x eval-current-buffer, and this code is enabled</p>
</li>
</ol>
<p>Each of these snippets activates on the opening element, ie &lt;Bundle.
After this string is entered, but before entering a space, press &lt;TAB&gt;,
and the snippet will be expanded. The template will be inserted into
the text with a set of input prompts, which default to overwrite mode
and can be tabbed through.</p>
<p>The code above only works for bundles and base, but will be expanded
to support other xml files as well.</p>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="dynamic_groups.html"
                        title="previous chapter">Dynamic Groups</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="howtos.html"
                        title="next chapter">HOWTOs</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/unsorted/emacs_snippet.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="howtos.html" title="HOWTOs"
             >next</a> |</li>
        <li class="right" >
          <a href="dynamic_groups.html" title="Dynamic Groups"
             >previous</a> |</li>
	<li><a href="../index.html">home</a> |&nbsp;</li>
	<!--<li><a href="../search.html">search</a> |&nbsp;</li>-->
	<li><a href="../help/index.html">help</a> |&nbsp;</li>
	<li><a href="../contents.html">documentation </a> &raquo;</li>

          <li><a href="../contents.html" >Bcfg2 documentation 1.3.0</a> &raquo;</li>
          <li><a href="index.html" >Unsorted Docs</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2013, Narayan Desai.
      Last updated on Mar 20, 2013.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>