Added warning about applicability to the documentation

This commit is contained in:
capitaomorte 2009-08-26 15:34:37 +00:00
parent 01205f79d6
commit 4cb1ab2ba7
10 changed files with 80 additions and 46 deletions

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>ChangeLog</title> <title>ChangeLog</title>
<link rel="stylesheet" href="styles.css" type="text/css" /> <link rel="stylesheet" href="styles.css" type="text/css" />
</head> </head>
@ -47,8 +47,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="section" id="b-2009-08-23"> <p>
<h1>0.6.1b / 2009-08-23</h1> <b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<p><strong>Upcoming</strong> release:</p>
<ul class="simple"> <ul class="simple">
<li>Much more powerful menu. See <a class="reference external" href="snippet-menu.html">The YASnippet menu</a>.</li> <li>Much more powerful menu. See <a class="reference external" href="snippet-menu.html">The YASnippet menu</a>.</li>
<li>New ways to organize snippets. See <a class="reference external" href="snippet-organization.html">Organizing snippets</a>.</li> <li>New ways to organize snippets. See <a class="reference external" href="snippet-organization.html">Organizing snippets</a>.</li>
@ -63,7 +69,6 @@ rmartin.k...&#64;gmail.com)</li>
<li>Fixed <a class="reference external" href="http://code.google.com/p/yasnippet/issues/detail?id=70">Issue 70</a></li> <li>Fixed <a class="reference external" href="http://code.google.com/p/yasnippet/issues/detail?id=70">Issue 70</a></li>
<li>Fixed <a class="reference external" href="http://code.google.com/p/yasnippet/issues/detail?id=69">Issue 69</a></li> <li>Fixed <a class="reference external" href="http://code.google.com/p/yasnippet/issues/detail?id=69">Issue 69</a></li>
</ul> </ul>
</div>
<div class="section" id="c-2009-07-27"> <div class="section" id="c-2009-07-27">
<h1>0.6.0c / 2009-07-27</h1> <h1>0.6.0c / 2009-07-27</h1>
<ul class="simple"> <ul class="simple">

View File

@ -7,8 +7,7 @@ ChangeLog
.. _Writing Snippets: snippet-development.html .. _Writing Snippets: snippet-development.html
.. _The YASnippet Menu: snippet-menu.html .. _The YASnippet Menu: snippet-menu.html
0.6.1b / 2009-08-23 **Upcoming** release:
===================
* Much more powerful menu. See `The YASnippet menu`_. * Much more powerful menu. See `The YASnippet menu`_.
* New ways to organize snippets. See `Organizing snippets`_. * New ways to organize snippets. See `Organizing snippets`_.

View File

@ -49,7 +49,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="section" id="why-there-s-an-extra-newline"> <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="section" id="why-there-s-an-extra-newline">
<h1>Why there's an extra newline?</h1> <h1>Why there's an extra newline?</h1>
<p>If you have a newline at the end of the snippet definition file, then <p>If you have a newline at the end of the snippet definition file, then
YASnippet will add a newline when you expanding a snippet. Please YASnippet will add a newline when you expanding a snippet. Please

View File

@ -47,7 +47,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="contents topic" id="contents"> <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p> <p class="topic-title first">Contents</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#video-demo" id="id1">Video Demo</a></li> <li><a class="reference internal" href="#video-demo" id="id1">Video Demo</a></li>

View File

@ -47,7 +47,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="contents topic" id="contents"> <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p> <p class="topic-title first">Contents</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#snippet-development" id="id3">Snippet development</a><ul> <li><a class="reference internal" href="#snippet-development" id="id3">Snippet development</a><ul>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Expanding snippets</title> <title>Expanding snippets</title>
<link rel="stylesheet" href="styles.css" type="text/css" /> <link rel="stylesheet" href="styles.css" type="text/css" />
</head> </head>
@ -47,7 +47,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="contents topic" id="contents"> <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p> <p class="topic-title first">Contents</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#triggering-expansion" id="id2">Triggering expansion</a><ul> <li><a class="reference internal" href="#triggering-expansion" id="id2">Triggering expansion</a><ul>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>YASnippet menu</title> <title>YASnippet menu</title>
<link rel="stylesheet" href="styles.css" type="text/css" /> <link rel="stylesheet" href="styles.css" type="text/css" />
</head> </head>
@ -47,7 +47,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="contents topic" id="contents"> <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p> <p class="topic-title first">Contents</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#loading-snippets-from-menu" id="id1">Loading snippets from menu</a></li> <li><a class="reference internal" href="#loading-snippets-from-menu" id="id1">Loading snippets from menu</a></li>

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Organizing snippets</title> <title>Organizing snippets</title>
<link rel="stylesheet" href="styles.css" type="text/css" /> <link rel="stylesheet" href="styles.css" type="text/css" />
</head> </head>
@ -47,7 +47,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
<div class="contents topic" id="contents"> <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p> <p class="topic-title first">Contents</p>
<ul class="simple"> <ul class="simple">
<li><a class="reference internal" href="#loading-snippets" id="id4">Loading snippets</a></li> <li><a class="reference internal" href="#loading-snippets" id="id4">Loading snippets</a></li>

View File

@ -40,7 +40,14 @@
<div id="squeeze"> <div id="squeeze">
<div class="right-corner"> <div class="right-corner">
<div class="left-corner"> <div class="left-corner">
%(body)s <p>
<b>Important:</b> This documentation applies to
the <b>SVN trunk</b> of YASnippet, which you
get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
for other versions can be found <a title=""
href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
</p>
%(body)s
</div> </div>
</div> </div>
</div> </div>

View File

@ -1863,34 +1863,15 @@ visited file in `snippet-mode'."
(message "This snippet was not loaded from a file!"))))) (message "This snippet was not loaded from a file!")))))
(defun yas/guess-snippet-directory () (defun yas/guess-snippet-directory ()
"Try to guess suitable directories based on `major-mode' and "Try to guess suitable directories based on the current active
also the current active tables." tables."
(let ((main-dir (or (and (listp yas/root-directory) (let ((main-dir (or (and (listp yas/root-directory)
(first yas/root-directory)) (first yas/root-directory))
yas/root-directory yas/root-directory
"~/.emacs.d/snippets")) "~/.emacs.d/snippets")))
(mode major-mode) (mapcar #'(lambda (table)
(options)) (concat main-dir "/" (yas/snippet-table-name table)))
;; Lookup main mode and add that to the options (yas/get-snippet-tables))))
;;
(push (format "%s/%s" main-dir mode) options)
;; Next lookup the main active table
;;
(let ((active-tables (first (yas/get-snippet-tables)))
other-path-alternative)
(when active-tables
(setq active-tables (cons active-tables
(yas/snippet-table-get-all-parents active-tables))))
(dolist (table (reverse active-tables))
(setq other-path-alternative
(concat main-dir "/" (yas/snippet-table-name table))))
(when other-path-alternative
(push other-path-alternative options)))
;; Finally add to the options the guessed parent of major-mode
;; (this is almost never works out)
(when (get mode 'derived-mode-parent)
(push (format "%s/%s" main-dir (get mode 'derived-mode-parent)) options))
(reverse options)))
(defun yas/new-snippet (&optional same-window) (defun yas/new-snippet (&optional same-window)
"Create a new snippet in guessed current mode's directory." "Create a new snippet in guessed current mode's directory."
@ -1899,14 +1880,14 @@ also the current active tables."
(read-from-minibuffer "Enter snippet name: "))) (read-from-minibuffer "Enter snippet name: ")))
(defun yas/find-snippets (&optional same-window file-name) (defun yas/find-snippets (&optional same-window snippet-name )
"Look for user snippets in guessed current mode's directory. "Look for user snippets in guessed current mode's directory.
Calls `find-file' interactively in the guessed directory. Calls `find-file' interactively in the guessed directory.
With prefix arg SAME-WINDOW opens the buffer in the same window. With prefix arg SAME-WINDOW opens the buffer in the same window.
With optional FILE-NAME, finds the file directly, i.e. `find-file' is With optional SNIPPET-NAME, finds the file directly, i.e. `find-file' is
called non-interactively. called non-interactively.
Because snippets can be loaded from many different locations, Because snippets can be loaded from many different locations,
@ -1936,10 +1917,10 @@ otherwise, proposes to create the first option returned by
(when target-directory (when target-directory
(let ((default-directory target-directory)) (let ((default-directory target-directory))
(setq buffer (if file-name (setq buffer (if snippet-name
(if same-window (if same-window
(find-file file-name) (find-file snippet-name)
(find-file-other-window file-name)) (find-file-other-window snippet-name))
(call-interactively (if same-window (call-interactively (if same-window
'find-file 'find-file
'find-file-other-window)))) 'find-file-other-window))))